Compare commits

...

32 Commits
11368 ... 11579

Author SHA1 Message Date
Martin-Molinero
2847d9e27d Update readme.md 2021-05-06 21:09:54 -03:00
Martin-Molinero
cf7a26b8b6 Increase pip install timeouts (#5527) 2021-05-06 17:45:49 -03:00
Martin-Molinero
f3c386663b Feature .net 5 (#5505)
* Update projects to use .NET 5.0, the successor to .NET Core

* Fix ambiguous errors. Add IBAutomator net5

* Remove FXCM

* Upgrade IBAutomater to v1.0.51

ignored, and an empty message aborts the commit.

* Fix rebase

- Fix ambiguous Index
- Remove StrategyCapacity.cs
- Update System.Threading.Tasks.Extensionsy

* Remove unrequired references

* Fixes

- Travis will use dotnet, not nunit nor mono
- Remove mono from foundation image
- Fix python setup in research
- Fix unit tests

* Don't call ReadKey when input is redirected

* Fix ConsoleLeanOptimizer

* Research fixes

* Update comment

* Add vsdbg to Dockerfile

* Fixes

- Revert dockerfile FROM custom changes
- Adjust and fix regression algorithms
   - Option assignment will be deterministic in the order
   - 'Rolling Averaged Population' is calculated using doubles, updating
     expected values.
- Update readme, removing references to mono
- Add missing Py.Gil lock

* Replace ICSharp with .NET Interactive

* Fixes after rebase

* CSharp research fixes

- Adding new Initialize.csx that pre loads all assemblies
- Adjusting template research file
- Moving steps in dockerfilejupyter
- Fix unit tests and regression tests after rebase

Co-authored-by: Gerardo Salazar <gsalaz9800@gmail.com>
Co-authored-by: Stefano Raggi <stefano.raggi67@gmail.com>
Co-authored-by: Jasper van Merle <jaspervmerle@gmail.com>
2021-05-06 17:23:51 -03:00
Colton Sellers
865da14540 Scheduled Universe Timed Triggers Bug (#5521)
* Add unit test

* Make test cover issue case

* Filter out times before startTimeUtc

* Refactor solution, fixes missing first date

* Fix case where none is expected

* Cleanup tests, add TriggerTimesNone

* Drop unused imports

* Add missing dipose call

Co-authored-by: Martin-Molinero <martin@quantconnect.com>
2021-05-05 11:23:38 -03:00
Colton Sellers
019ac01a4c Reset SubmissionTimeBuffer to default value for other regressions (#5522) 2021-05-05 11:17:13 -03:00
Martin-Molinero
4a8bcb82db Add reference to quantconnect/research (#5519) 2021-05-03 19:16:51 -03:00
Colton Sellers
7ddee34e86 Configurable MarketOnCloseOrder Buffer (#5516)
* Create a configurable SubmissionTimeBuffer for MarketClose orders.

* Nit error spacing

* Add Py and C# regression
2021-05-03 18:08:27 -03:00
Jasper van Merle
f00d4655cf Add support for ARM64 Docker images (#5497)
* Add support for ARM64 Docker images

* Update DockerfileLeanFoundationARM base image
2021-05-03 12:58:22 -03:00
Jasper van Merle
83431c956c Move Python stubs deployment from Travis to GH Actions (#5512) 2021-04-30 19:10:40 -03:00
Colton Sellers
772eb4650c Stop UniverseSelection from removing the Symbol from the cache (#5513) 2021-04-30 19:01:29 -03:00
Colton Sellers
a7e5acd8d3 Small test adjustment for changes in #5510 (#5514) 2021-04-30 18:47:16 -03:00
Martin-Molinero
83f9499b4a Option Margin Strategies (#5511)
* Refactor HasSufficientBuyingPowerForOrder implementations

Adds Sufficient and Insufficient helper methods to HashSufficientbuyingPowerForOrderParameters
enabling syntax like:

return paraeeters.Sufficient()
returnparameters.Insufficient(reason)

The next change will add the initial margin required which will simply require
updating both of these helper methods to accept the value.

* IBuyingPowerModel: Add margin functions Maintenance/Initial/ForOrder

These were originally hidden in an effort to only expose what's necessary
for the engine to perform its work. Additionally, we encapsulated all of
the method arguments into parameters classes to prevent having to break
anyone in the future. Not including these foundational methods turns out to
be an oversight. These methods are not required by the engine, but rather by
other models. Another possible solution here is to add an additional abstraction
and include these methods on this new abstraction. BuyingPowerModel would then
explicitly implement these methods and models that depend on them would require
two code paths, one for when the buying power model implements this interface
and another for when it doesn't.

Tests were additionally updated to remove test model implementations created for
the sole purpose of exposing these private methods.

* Add ConstantBuyingPowerModel

Provides an implementation of IBuyingPowerModel that returns the same
constant value

* Update BuyingPowerModelPythonWrapper to use reflection for method names

Having a bunch of hard-coded strings is a sure fire way for someone to
overlook when changing methods. This change ensures that noone needs to
remember that this code exists :)

Cleans up the syntax around verifying a python object implements a particular
C# interface via the ValidateImplementationOf<T> method by having it return a
value since the only use cases are in constructors when setting the models.

I was initially going to update ALL python wrappers to validate the passed
in models, but such a change could break many things that are 'working' right
now. Such an effort should be saved for its own dedicated PR.

* Add Parameters/Result types for new buying power model methods

* Support computing maintenance margin for arbitrary quantities

The existing GetMaintenanceMargin function assumes that we're only interested
in the maintenance margin for the entirety of the provided security's holdings.
This makes it impossible to perform what-if analysis or to even ask how much
maintenance margin is devoted to a particular subset of the security's holdings.
This change adds the quantity to the MaintenanceMarginParameters class. Futures
and Options models also depend on holdings cost and holdings value, so they have
also been added to the parameters type. Finally, static factory methods were
added to improve discernment of intent: ForCurrentHoldings provides the existing
behavior and then ForQuantityAtCurrentPrice to support what-if scenarios where
we're looking for the change in maintenance margin if we were to execute an order
for the securiy at the current time step. Obviously a constructor is provided to
set all of the values explicitly, using any price metric the caller desires.

* Address review

- Fix BPM xml documentation
- Fix python unit tests and PythonWrapper validate method

* Add SecurityHolding.QuantityChanged event

Adding event handlers will allow us to orchestrate complex
events from distant parts of the codebase through wiring
them up. If we continue down this path, it will move us away
from the current, very 'mechanical' data flows expressed in
LEAN and towards a more modern, event processing based system.
This is but a baby step in that direction and the initial use
case is using this QuantityChanged event to trigger resolution
of the algoritm's positions groups. This is part of an effort
to improve the fidelity of options margin modeling where we'll
model an OptionStrategy as an IPositionGroup. This will allow
us to compute the margin requirements of an OptionStrategy as
a unit instead of computing margin of each security individually
in isolation.

See #4065

* PortfolioManager: Group fields and remove unused field

This codebase generally places fields as the first members, but
this class had some fields at the top, then some properties, and
then some more fields. This change brings all the fields together
at the top of the file and also removes pointless comments placed
directly above some of the fields. Additionally, an unused field
was removed.

* Remove unused _currencyConverter from Security

Looks like at some point the only code using this member variable was removed
and the necessary clean up was overlooked.

* Add Parse.Enum functions

* Support disabling regression algorithms by language via config.json

Adds 'regression-test-languages' to config.json and filters regerssion algorithms to
run based on this value. When cycling on a particular feature, it's nice to be able
to run the entire regression set while ignoring the python algorithms. Once the C#
algorithms are all passing, one can then go back and run C# and Python in a final run,
since 99% of feature work doesn't impact python specifically.

* Implement IComparable in SecurityIdentitfier

This can be used to deterministically sort securities and symbols

* Add .editorconfig to enforce common formatting for json/sh files

* Fix typo in IBuyingPowerModel.GetBuyingPower xml docs

* Add ListEquals/GetListHashCode and OrderDirection.Closes(PositionSide)

ListEquals and GetListHashCode are designed to be used together as they
complement each other according to C#'s requirements for Equals and
GetHashCode functions.

PositionSide.ToOrderDirection() extension simply converts a PositionSide
to its logical equivalent OrderDirection. Long->Buy, Short->Sell, None->Hold

OrderDirection.Closes(PositionSide) determines if a particular OrderDirection
would have the effect of reducing a position's absolute size. This function
greatly improves the readability of buying power functions that must provide
adjustments when an order/contemplated trade reduces/closes an existing position.
OrderDirection.Buy.Closes(PositionSide.Short)
OrderDirection.Sell.Closes(PositionSide.Long)
All other combinations return false

Adds ToArray/ToImmutableArray convenience functions that combine a call
to Select followed by To(Immutable)Array all in one function call.

* Add decimal.DiscretelyRoundBy extension method

Supports rounding a decimal value by an arbitrarily chosen maximum precision,
or 'quanta'

* Update FutureMarginBuyingPowerModelTests to respect the security's lot size

* Add core position group classes and abstractions

* Add initial/maintenance margin support, buying power model consistency tests

* Add SufficientBuyingPower and GetReservedBuyingPower to position group model

Includes update to BrokerageTransactionHandler to use position group BPM for
sufficient buying power checks.

* Resolve position groups on each fill

We need to update the state of our position groups on each fill so that
we can properly handle multiple orders within the same time step. We
also limit the number of positions sent into the resolver by removing
securities without any holdings.

* fixup! Add SufficientBuyingPower and GetReservedBuyingPower to position group model

* Add GetMaximumLotsFor{Target|Delta}BuyingPower

Instead of computing order quantity, these functions compute the
maximum number of position group lots, which is the position group
quantity, and is guaranteed to be a whole number, for the provided
target/delta buying power parameters.

The SecurityPositionGroupBuyingPowerModel delegates to the security's
IBuyingPowerModel by applying a scaling factor equal to the security's
lot size.

This change also updates references to IBuyingPowerModel.GetMaximum...
to use the new position group model methods.

* Convert remaining IBuyingPowerModel call sites to position groups

* Rename PositionManasger.CreateDefaultGroup -> GetOrCreateDefaultGroup

Better describes its behavior

* Add Position Groups readme.md

* Add Option Strategy BuyingPowerModel

- Adding CompositePrositionGroupResolver and
  OptionStrategyPositionGroupResolver
- Adding OptionStrategyPositionGroupBuyingPowerModel handling option
  strategies based on IBs margin table. Adding regression algorithms
- Few changes so that option strategies executed by multiple orders are
  detected
- Adjust OptionStrategyDefinitionMatch to include equity legs in the
  matching result
- Minor tweaks fixing previous rebase
- Minor fixes for existing option strategies definitions, adding new
  missing strategies.
- Fixing minor bugs in option strategy matcher. Adding more unit tests

* Address self reviews

- Fixing bug in 'PositionGroupCollection'
- Few minor simplificaitons
- Adding BasicTemplateOptionEquityStrategyAlgorithm

* Address reviews

- Improve regression algorithms margin remaining and used assert logic to be exact. Taking into account spread and fees

Co-authored-by: Michael Handschuh <mhandschuh@gmail.com>
2021-04-30 18:45:27 -03:00
Colton Sellers
a3836a64c4 Refactor StartDateLimited Warning Logs (#5510)
* Refactor to queue up start date changes to log on dispose

* Fix typo in warning collection used

Co-authored-by: Martin-Molinero <martin@quantconnect.com>
2021-04-30 10:55:16 -03:00
Colton Sellers
db61cea3db Refactor logging for SubscriptionDataReader FactorFile processing (#5508)
* Collect and log symbols that had start date adjusted because of factor files

* Only post the message if the set has values

* Modify message to be [Symbol, Date] combo for more information on log

* Set a hard limit on the warning set to keep it from growing unnecessarily large

* Enforce a hard limit and improve message if full

* Enforce limit in log message because of possible threading adding past max

* Cleanup
2021-04-29 11:02:04 -03:00
Colton Sellers
fd4e1dc0a0 Address Security Normalization Changed to Raw Logging (#5509)
* Log security mode change once per universe addition process

* Limit max size of the warning queue to 10

* Only allow to emit once per backtest

* Set limit as var, if at limit suggest more

* Always suggest more warnings may exist because we opted to log only once
2021-04-29 10:54:46 -03:00
Gerardo Salazar
bb9cde1cee Adds StandardDeviationOfReturns configurability and improves greeks warmup for Futures/Index Options (#5495)
* Improves greeks configurability and defaults for all option asset types

  * Makes `StandardDeviationOfReturns` configurable by users, so that
    greeks can be loaded according to user expectations and the series
    of returns that they'd like to compute for `n` periods and timespan
    of `T`, as well as resolution of the data in live mode.

  * Changes resolution to max resolution available for the default
    volatility model created for the security. Usually this only applies
    to live mode, but if creating an instance of the
    `StandardDeviationOfReturns` volatility model and no `updateFrequency`
    is provided, the resolution's time span will be used as the default
    value. Backwards compatibility for equities is maintained.

  * Changes defaults for `StandardDeviationOfReturnsVolatilityModel`
    to warmup greeks faster for other derivative asset types

  * Improves comments on `StandardDeviationOfReturns` for clarity on how
    to use the volatility model for end users

* Fixes bug where TradeBar could not have proper Symbol set when getting
max resolution

  * Applies to QCAlgorithm.Universe and StandardDeviationOfReturnsVolatilityModel
  * Adds tests to check volatility model is updated at specified config intervals

* Address review: add shared method for (Relative)StandardDeviation
volatility models

  * Adjusts logic to determine bar type

* Address review: order by TickType when getting configs inside volatility models
2021-04-28 19:05:00 -03:00
Colton Sellers
c082f0dda3 Address Missing StableCoin Pairs in Crypto Exchanges (#5488)
* Allow USDC in cashbook without USDC-USD pair

* Cover more stablecoin cases unique to our crypto brokers

* Add unit test

* Cleanup and expand test cases

* Add USDCEUR and USDCGBP to GDAX Symbols

* Add missing tickers to SPDB

* Cleanup test
2021-04-28 14:20:15 -03:00
Adalyat Nazirov
845e874132 Modify partially filled (#5500)
* allow partially filled orders to be updated
need unit tests

* test is progress

* implement PartialFillModel
2021-04-27 20:36:32 -03:00
Jasper van Merle
706091b25e Update foundation base to latest stable phusion/baseimage (#5506) 2021-04-27 19:20:31 -03:00
Jared
fe040a55e9 Update readme.md 2021-04-23 14:25:14 -07:00
Martin-Molinero
ab82e75885 Fix undeterministic regression algorithms (#5504)
- Testing net5 uncovered these algorithms to be undeterministic
    - Adjusting AllShortableSymbolsCoarseSelectionRegressionAlgorithm
      internal implementation
    - Order removal of universe members will be deterministic, when the
      entire universe is removed.
2021-04-23 11:58:12 -07:00
Derek Melchin
ba4e2b115c Update Summary of DefaultDataProvider (#5503) 2021-04-23 11:19:46 -03:00
Alexandre Catarino
2b0fd2e607 Updates SPY Market Data (#5493)
* Fixes Double to Decimal Cast in GetAnnualPerformance

`GetAnnualPerformance` raises an exception if the `AnnualPerformance` calculation returns a double that cannot be cast to decimal (smaller than `decimal.MinValue` or bigger than `decimal.MaxValue`).
See `ProbabilisticSharpeRatio` where the same solution was applied.

* Updates SPY Market Data

SPY is a key asset since it is the default benchmark, and any change can lead to different `Alpha` and `Beta`

* Updates Unit Tests to Reflect Data Update

* Updates Regression Tests to Reflect Data Update I

Most of the regression tests change because of updated data (market and factors) of SPY (default benchmark) while the total trade remain the same.

* Updates Regression Tests to Reflect Data Update II

The following regression tests were changed to adapt to adjusted prices and keep the total trades:
- `BacktestingBrokerageRegressionAlgorithm`
- `LimitIfTouchedRegressionAlgorithm`
- `PortfolioRebalanceOnCustomFuncRegressionAlgorithm`
- `SetAccountCurrencySecurityMarginModelRegressionAlgorithm`
- `StopLossOnOrderEventRegressionAlgorithm`
- `TimeInForceAlgorithm`

The following regression tests have more trades since adjusted prices allowed more 1-2 shares trades that were rounded down to zero before:
- `FreePortfolioValueRegressionAlgorithm` 2 -> 3
- `PortfolioRebalanceOnDateRulesRegressionAlgorithm` 291 -> 298
- `TrailingStopRiskFrameworkAlgorithm` 5 -> 7

Especial cases:
- `AutoRegressiveIntegratedMovingAverageRegressionAlgorithm` 65 -> 52
 - ARIMA model sensibility
- `BlackLittermanPortfolioOptimizationFrameworkAlgorithm` 18 -> 19
 - BLM model sensibility
- `ExtendedMarketHoursHistoryRegressionAlgorithm` 20 -> 18
 - Less minute bars before market opens

* Addresses Peer-Review

Fix `BacktestingBrokerageRegressionAlgorithm` to use `CalculateOrderQuantity` and round down `quantity` to an even number to pass a value assertion and update the expected value from 50 to 52.
The quantity calculated by `CalculateOrderQuantity` has changed from 50 to 53 because of factor file update.
2021-04-19 13:31:01 -03:00
Colton Sellers
5b10b3b509 Refactor of Auxiliary Data Filtering (#5485)
* Add futures regression reproducing the issue

* Cleanup futures regression

* Add Options regression

* Add IRegressionAlgorithmDefinition

* Add IRegressionAlgorithmDefinition

* Adjust regressions to compare to expiration date; delisting time is not always correct

* Refactor subscription enumerator filtering of AuxData to top of the stack

* Update broken tests to reflect the split/dividends/delisting subscriptions

* Update regression statistics because of Delisting EOD instead of at time

* Let custom data configurations bypass filter

* Adjust expected count, now that we are letting aux data through to history requests

* another small adjustment

* Use ExpectedBarCount in error message

* Add filter test for both cases

* Add some clarifying comments

* Verify we did recieve data in the regressions

* Make _shouldEmitAuxiliaryData private readonly

* Filter out aux data for history requests

* Remove option to not include aux data in subscriptions

* Refactor filtering to be more explicit for each piece of data; fixes universe selection aux data

* Cleanup comments after removed var

* Refactor order of filtering for performance reasons.
2021-04-19 11:10:47 -03:00
Alexandre Catarino
a7b2d9450f Fixes Double to Decimal Cast in GetAnnualPerformance (#5492)
`GetAnnualPerformance` raises an exception if the `AnnualPerformance` calculation returns a double that cannot be cast to decimal (smaller than `decimal.MinValue` or bigger than `decimal.MaxValue`).
See `ProbabilisticSharpeRatio` where the same solution was applied.
2021-04-19 10:43:47 -03:00
Jasper van Merle
6af20c3d8a Fix using Bitfinex data feed in paper trading (#5490)
* Fix using Bitfinex data feed in paper trading

* Add BrokerageFactory to TradierBrokerage
2021-04-16 12:04:14 -03:00
Colton Sellers
cb9bc95c37 Refactor IndicatorExtensions to use SafeAsManagedObject to convert PyObjects (#5489) 2021-04-16 10:59:10 -03:00
David Acker
72b6a22230 Add Wilder Accumulative Swing Index (#5476)
* Add SI

* Add ASI

* Add Swing Index

* Add Accumulative Swing Index

* Fix XML comment

* Add SI and ASI

* Add test data

* Add SI tests

* Add ASI tests

* Convert get only properties to methods

* Fix indicator name

* Replace special characters

* Fix indicator formula

* Replace test data

* Replace test data

* Update QCAlgorithm.Indicators.cs

* Minor format tweaks

Co-authored-by: Jared <jaredbroad@gmail.com>
Co-authored-by: Martin-Molinero <martin@quantconnect.com>
2021-04-16 10:54:02 -03:00
Stefano Raggi
6fbc3786b0 GDAXBrokerage bug fixes (#5477)
- Fixed GDAXBrokerage missing fills caused by an incorrect assumption of a global counter for order fills (it is actually per-symbol)
- Filtered out rate limit messages in the fill monitor task
2021-04-12 12:56:52 -03:00
Colton Sellers
ea11fb41c9 LiveDataBasedDelistingEventProvider Fix (#5471)
* Fix race condition in DelistingEventProvider

* Remove logging and speed up test time advancement

* Reduce timeout to original
2021-04-09 20:26:09 -03:00
Colton Sellers
f5b729dc0d Accept symbol array or IEnumerable for TRIN (#5473) 2021-04-09 12:43:55 -07:00
Jasper van Merle
9ba15b23e3 Make random data generator generate symbols with entries in SPD (#5470)
* Make random data generator generate symbols with entries in SPD

* Cap symbol count in generator when needed
2021-04-09 10:37:35 -07:00
460 changed files with 27724 additions and 7299 deletions

13
.editorconfig Normal file
View File

@@ -0,0 +1,13 @@
root = true
[*]
charset = utf-8
indent_size = 4
indent_style = space
insert_final_newline = true
[*.{js,yml,json,config,csproj}]
indent_size = 2
[*.sh]
end_of_line = lf

View File

@@ -3,29 +3,28 @@ name: Build & Test Lean
on:
push:
branches: ['*']
tags: ['*']
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-16.04
runs-on: ubuntu-20.04
container:
image: quantconnect/lean:foundation
steps:
- uses: actions/checkout@v2
- name: Restore nuget dependencies
run: |
nuget restore QuantConnect.Lean.sln -v quiet
nuget install NUnit.Runners -Version 3.11.1 -OutputDirectory testrunner
- name: Build
run: msbuild /p:Configuration=Release /p:VbcToolExe=vbnc.exe /v:quiet /p:WarningLevel=1 QuantConnect.Lean.sln
run: dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.Lean.sln
- name: Run Tests
run: mono ./testrunner/NUnit.ConsoleRunner.3.11.1/tools/nunit3-console.exe ./Tests/bin/Release/QuantConnect.Tests.dll --where "cat != TravisExclude" --labels=Off --params:log-handler=ConsoleErrorLogHandler
run: dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter TestCategory!=TravisExclude -- TestRunParameters.Parameter\(name=\"log-handler\", value=\"ConsoleErrorLogHandler\"\)
- name: Generate & Publish python stubs
if: startsWith(github.ref, 'refs/tags/')
run: |
chmod +x ci_build_stubs.sh
./ci_build_stubs.sh -d -t -g #Ignore Publish as of since credentials are missing on CI
./ci_build_stubs.sh -t -g -p
env:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}

View File

@@ -1,9 +1,8 @@
sudo: required
language: csharp
mono: none
dotnet: 5.0
mono:
- 5.12.0
solution: QuantConnect.Lean.sln
os: linux
dist: focal
before_install:
- export PATH="$HOME/miniconda3/bin:$PATH"
- export PYTHONNET_PYDLL="$HOME/miniconda3/lib/libpython3.6m.so"
@@ -18,11 +17,7 @@ before_install:
- conda install -y cython=0.29.15
- conda install -y scipy=1.4.1
- conda install -y wrapt=1.12.1
install:
- nuget install NUnit.Runners -Version 3.11.1 -OutputDirectory testrunner
script:
- dotnet nuget add source $TRAVIS_BUILD_DIR/LocalPackages
- dotnet build /p:Configuration=Release /p:VbcToolExe=vbnc.exe /v:quiet /p:WarningLevel=1 QuantConnect.Lean.sln
- mono ./testrunner/NUnit.ConsoleRunner.3.11.1/tools/nunit3-console.exe ./Tests/bin/Release/QuantConnect.Tests.dll --where "cat != TravisExclude" --labels=Off --params:log-handler=ConsoleErrorLogHandler
- chmod +x ci_build_stubs.sh
- sudo -E ./ci_build_stubs.sh -d -t -g -p
- dotnet build /p:Configuration=Release /v:quiet /p:WarningLevel=1 QuantConnect.Lean.sln
- dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter TestCategory!=TravisExclude -- TestRunParameters.Parameter\(name=\"log-handler\", value=\"ConsoleErrorLogHandler\"\)

View File

@@ -77,44 +77,44 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "199"},
{"Average Win", "0.00%"},
{"Average Loss", "0.00%"},
{"Compounding Annual Return", "-12.472%"},
{"Compounding Annual Return", "-12.392%"},
{"Drawdown", "0.200%"},
{"Expectancy", "-0.586"},
{"Net Profit", "-0.170%"},
{"Sharpe Ratio", "-9.693"},
{"Probabilistic Sharpe Ratio", "12.704%"},
{"Net Profit", "-0.169%"},
{"Sharpe Ratio", "-9.597"},
{"Probabilistic Sharpe Ratio", "13.309%"},
{"Loss Rate", "79%"},
{"Win Rate", "21%"},
{"Profit-Loss Ratio", "0.95"},
{"Alpha", "-0.149"},
{"Beta", "0.037"},
{"Beta", "0.036"},
{"Annual Standard Deviation", "0.008"},
{"Annual Variance", "0"},
{"Information Ratio", "-9.471"},
{"Tracking Error", "0.212"},
{"Treynor Ratio", "-2.13"},
{"Information Ratio", "-9.605"},
{"Tracking Error", "0.214"},
{"Treynor Ratio", "-2.136"},
{"Total Fees", "$199.00"},
{"Estimated Strategy Capacity", "$23000000.00"},
{"Estimated Strategy Capacity", "$22000000.00"},
{"Fitness Score", "0.002"},
{"Kelly Criterion Estimate", "38.64"},
{"Kelly Criterion Probability Value", "0.229"},
{"Sortino Ratio", "-21.545"},
{"Return Over Maximum Drawdown", "-77.972"},
{"Portfolio Turnover", "1.135"},
{"Kelly Criterion Estimate", "38.796"},
{"Kelly Criterion Probability Value", "0.228"},
{"Sortino Ratio", "-21.623"},
{"Return Over Maximum Drawdown", "-77.986"},
{"Portfolio Turnover", "1.154"},
{"Total Insights Generated", "100"},
{"Total Insights Closed", "99"},
{"Total Insights Analysis Completed", "99"},
{"Long Insight Count", "100"},
{"Short Insight Count", "0"},
{"Long/Short Ratio", "100%"},
{"Estimated Monthly Alpha Value", "$126657.6305"},
{"Total Accumulated Estimated Alpha Value", "$20405.9516"},
{"Mean Population Estimated Insight Value", "$206.1207"},
{"Mean Population Direction", "54.5455%"},
{"Mean Population Magnitude", "54.5455%"},
{"Rolling Averaged Population Direction", "59.8056%"},
{"Rolling Averaged Population Magnitude", "59.8056%"},
{"OrderListHash", "0a28eedf6304023f5002ef672b489b88"}
{"Estimated Monthly Alpha Value", "$117277.2200"},
{"Total Accumulated Estimated Alpha Value", "$18894.6632"},
{"Mean Population Estimated Insight Value", "$190.8552"},
{"Mean Population Direction", "53.5354%"},
{"Mean Population Magnitude", "53.5354%"},
{"Rolling Averaged Population Direction", "58.2788%"},
{"Rolling Averaged Population Magnitude", "58.2788%"},
{"OrderListHash", "7baad0d75f652da1b801ec2fc368e710"}
};
}
}

View File

@@ -113,29 +113,29 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "9"},
{"Average Win", "0.89%"},
{"Average Loss", "-0.27%"},
{"Compounding Annual Return", "196.104%"},
{"Compounding Annual Return", "196.304%"},
{"Drawdown", "1.700%"},
{"Expectancy", "1.853"},
{"Net Profit", "1.498%"},
{"Sharpe Ratio", "4.275"},
{"Probabilistic Sharpe Ratio", "60.462%"},
{"Expectancy", "1.854"},
{"Net Profit", "1.499%"},
{"Sharpe Ratio", "4.265"},
{"Probabilistic Sharpe Ratio", "60.408%"},
{"Loss Rate", "33%"},
{"Win Rate", "67%"},
{"Profit-Loss Ratio", "3.28"},
{"Alpha", "1.574"},
{"Beta", "-0.289"},
{"Annual Standard Deviation", "0.276"},
{"Annual Variance", "0.076"},
{"Information Ratio", "-0.495"},
{"Tracking Error", "0.367"},
{"Treynor Ratio", "-4.079"},
{"Total Fees", "$14.33"},
{"Alpha", "1.579"},
{"Beta", "-0.284"},
{"Annual Standard Deviation", "0.277"},
{"Annual Variance", "0.077"},
{"Information Ratio", "-0.586"},
{"Tracking Error", "0.369"},
{"Treynor Ratio", "-4.159"},
{"Total Fees", "$14.46"},
{"Estimated Strategy Capacity", "$38000000.00"},
{"Fitness Score", "0.408"},
{"Kelly Criterion Estimate", "16.447"},
{"Kelly Criterion Probability Value", "0.315"},
{"Sortino Ratio", "13.611"},
{"Return Over Maximum Drawdown", "117.635"},
{"Kelly Criterion Estimate", "16.438"},
{"Kelly Criterion Probability Value", "0.314"},
{"Sortino Ratio", "13.495"},
{"Return Over Maximum Drawdown", "117.2"},
{"Portfolio Turnover", "0.411"},
{"Total Insights Generated", "3"},
{"Total Insights Closed", "3"},
@@ -143,14 +143,14 @@ namespace QuantConnect.Algorithm.CSharp
{"Long Insight Count", "0"},
{"Short Insight Count", "3"},
{"Long/Short Ratio", "0%"},
{"Estimated Monthly Alpha Value", "$19868365.6628"},
{"Total Accumulated Estimated Alpha Value", "$3421774.0864"},
{"Mean Population Estimated Insight Value", "$1140591.3621"},
{"Estimated Monthly Alpha Value", "$19348842.7070"},
{"Total Accumulated Estimated Alpha Value", "$3332300.6884"},
{"Mean Population Estimated Insight Value", "$1110766.8961"},
{"Mean Population Direction", "100%"},
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "100%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "506e9fe18984ba6e569b2e327030de3a"}
{"OrderListHash", "4e0e07a4b92e6d23d681220125617e62"}
};
}
}

View File

@@ -132,12 +132,12 @@ namespace QuantConnect.Algorithm.CSharp
{"Win Rate", "50%"},
{"Profit-Loss Ratio", "0.92"},
{"Alpha", "-0.021"},
{"Beta", "-0.01"},
{"Beta", "-0.011"},
{"Annual Standard Deviation", "0.006"},
{"Annual Variance", "0"},
{"Information Ratio", "-3.374"},
{"Information Ratio", "-3.385"},
{"Tracking Error", "0.058"},
{"Treynor Ratio", "2.133"},
{"Treynor Ratio", "2.117"},
{"Total Fees", "$2.00"},
{"Estimated Strategy Capacity", "$45000000.00"},
{"Fitness Score", "0"},

View File

@@ -183,13 +183,13 @@ namespace QuantConnect.Algorithm.CSharp
{"Loss Rate", "100%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0.027"},
{"Beta", "-0.174"},
{"Alpha", "0.024"},
{"Beta", "-0.171"},
{"Annual Standard Deviation", "0.006"},
{"Annual Variance", "0"},
{"Information Ratio", "-11.586"},
{"Tracking Error", "0.042"},
{"Treynor Ratio", "0.286"},
{"Information Ratio", "-11.082"},
{"Tracking Error", "0.043"},
{"Treynor Ratio", "0.291"},
{"Total Fees", "$2.00"},
{"Estimated Strategy Capacity", "$2800000.00"},
{"Fitness Score", "0"},

View File

@@ -79,19 +79,19 @@ namespace QuantConnect.Algorithm.CSharp
// things like manually added, auto added, internal, and any other boolean state we need to track against a single security)
throw new Exception("The underlying equity data should NEVER be removed in this algorithm because it was manually added");
}
if (_expectedSecurities.AreDifferent(LinqExtensions.ToHashSet(Securities.Keys)))
if (_expectedSecurities.AreDifferent(Securities.Keys.ToHashSet()))
{
var expected = string.Join(Environment.NewLine, _expectedSecurities.OrderBy(s => s.ToString()));
var actual = string.Join(Environment.NewLine, Securities.Keys.OrderBy(s => s.ToString()));
throw new Exception($"{Time}:: Detected differences in expected and actual securities{Environment.NewLine}Expected:{Environment.NewLine}{expected}{Environment.NewLine}Actual:{Environment.NewLine}{actual}");
}
if (_expectedUniverses.AreDifferent(LinqExtensions.ToHashSet(UniverseManager.Keys)))
if (_expectedUniverses.AreDifferent(UniverseManager.Keys.ToHashSet()))
{
var expected = string.Join(Environment.NewLine, _expectedUniverses.OrderBy(s => s.ToString()));
var actual = string.Join(Environment.NewLine, UniverseManager.Keys.OrderBy(s => s.ToString()));
throw new Exception($"{Time}:: Detected differences in expected and actual universes{Environment.NewLine}Expected:{Environment.NewLine}{expected}{Environment.NewLine}Actual:{Environment.NewLine}{actual}");
}
if (_expectedData.AreDifferent(LinqExtensions.ToHashSet(data.Keys)))
if (_expectedData.AreDifferent(data.Keys.ToHashSet()))
{
var expected = string.Join(Environment.NewLine, _expectedData.OrderBy(s => s.ToString()));
var actual = string.Join(Environment.NewLine, data.Keys.OrderBy(s => s.ToString()));
@@ -183,7 +183,7 @@ namespace QuantConnect.Algorithm.CSharp
if (changes.RemovedSecurities
.Where(x => x.Symbol.SecurityType == SecurityType.Option)
.ToHashSet(s => s.Symbol)
.AreDifferent(LinqExtensions.ToHashSet(_expectedContracts)))
.AreDifferent(_expectedContracts.ToHashSet()))
{
throw new Exception("Expected removed securities to equal expected contracts added");
}
@@ -250,7 +250,7 @@ namespace QuantConnect.Algorithm.CSharp
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "cf8f76fa441c2a5e3b2dbbabcab32cd2"}
{"OrderListHash", "1e7b3e90918777b9dbf46353a96f3329"}
};
}
}

View File

@@ -114,29 +114,29 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "5"},
{"Average Win", "0.47%"},
{"Average Loss", "0%"},
{"Compounding Annual Return", "293.067%"},
{"Compounding Annual Return", "297.013%"},
{"Drawdown", "1.400%"},
{"Expectancy", "0"},
{"Net Profit", "1.765%"},
{"Sharpe Ratio", "13.11"},
{"Probabilistic Sharpe Ratio", "80.231%"},
{"Net Profit", "1.778%"},
{"Sharpe Ratio", "13.156"},
{"Probabilistic Sharpe Ratio", "80.461%"},
{"Loss Rate", "0%"},
{"Win Rate", "100%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0.705"},
{"Alpha", "0.697"},
{"Beta", "0.7"},
{"Annual Standard Deviation", "0.157"},
{"Annual Standard Deviation", "0.158"},
{"Annual Variance", "0.025"},
{"Information Ratio", "1.76"},
{"Tracking Error", "0.072"},
{"Treynor Ratio", "2.933"},
{"Total Fees", "$26.39"},
{"Information Ratio", "1.405"},
{"Tracking Error", "0.073"},
{"Treynor Ratio", "2.978"},
{"Total Fees", "$26.48"},
{"Estimated Strategy Capacity", "$4400000.00"},
{"Fitness Score", "0.374"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "79228162514264337593543950335"},
{"Return Over Maximum Drawdown", "373.973"},
{"Return Over Maximum Drawdown", "373.688"},
{"Portfolio Turnover", "0.374"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
@@ -151,7 +151,7 @@ namespace QuantConnect.Algorithm.CSharp
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "5f7ba8b5defb310a2eaf98b11abd3b74"}
{"OrderListHash", "7d0e013e09d9d5f831d24720686fd724"}
};
}
}

View File

@@ -67,29 +67,29 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "3"},
{"Average Win", "1.02%"},
{"Average Loss", "0%"},
{"Compounding Annual Return", "289.119%"},
{"Compounding Annual Return", "296.066%"},
{"Drawdown", "2.200%"},
{"Expectancy", "0"},
{"Net Profit", "1.752%"},
{"Sharpe Ratio", "9.235"},
{"Probabilistic Sharpe Ratio", "68.013%"},
{"Net Profit", "1.775%"},
{"Sharpe Ratio", "9.373"},
{"Probabilistic Sharpe Ratio", "68.302%"},
{"Loss Rate", "0%"},
{"Win Rate", "100%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0.105"},
{"Beta", "1.022"},
{"Annual Standard Deviation", "0.224"},
{"Annual Variance", "0.05"},
{"Information Ratio", "24.59"},
{"Beta", "1.021"},
{"Annual Standard Deviation", "0.227"},
{"Annual Variance", "0.052"},
{"Information Ratio", "25.083"},
{"Tracking Error", "0.006"},
{"Treynor Ratio", "2.029"},
{"Total Fees", "$9.77"},
{"Estimated Strategy Capacity", "$37000000.00"},
{"Treynor Ratio", "2.086"},
{"Total Fees", "$10.33"},
{"Estimated Strategy Capacity", "$32000000.00"},
{"Fitness Score", "0.747"},
{"Kelly Criterion Estimate", "38.64"},
{"Kelly Criterion Probability Value", "0.229"},
{"Kelly Criterion Estimate", "38.796"},
{"Kelly Criterion Probability Value", "0.228"},
{"Sortino Ratio", "79228162514264337593543950335"},
{"Return Over Maximum Drawdown", "107.109"},
{"Return Over Maximum Drawdown", "107.013"},
{"Portfolio Turnover", "0.747"},
{"Total Insights Generated", "100"},
{"Total Insights Closed", "99"},
@@ -97,14 +97,14 @@ namespace QuantConnect.Algorithm.CSharp
{"Long Insight Count", "100"},
{"Short Insight Count", "0"},
{"Long/Short Ratio", "100%"},
{"Estimated Monthly Alpha Value", "$126657.6305"},
{"Total Accumulated Estimated Alpha Value", "$20405.9516"},
{"Mean Population Estimated Insight Value", "$206.1207"},
{"Mean Population Direction", "54.5455%"},
{"Mean Population Magnitude", "54.5455%"},
{"Rolling Averaged Population Direction", "59.8056%"},
{"Rolling Averaged Population Magnitude", "59.8056%"},
{"OrderListHash", "0b8cbbafdb77bae2f7abe3cf5e05ac5c"}
{"Estimated Monthly Alpha Value", "$117277.2200"},
{"Total Accumulated Estimated Alpha Value", "$18894.6632"},
{"Mean Population Estimated Insight Value", "$190.8552"},
{"Mean Population Direction", "53.5354%"},
{"Mean Population Magnitude", "53.5354%"},
{"Rolling Averaged Population Direction", "58.2788%"},
{"Rolling Averaged Population Magnitude", "58.2788%"},
{"OrderListHash", "af3a9c98c190d1b6b36fad184e796b0b"}
};
}
}

View File

@@ -86,29 +86,29 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "10"},
{"Average Win", "0%"},
{"Average Loss", "-0.01%"},
{"Compounding Annual Return", "-14.333%"},
{"Compounding Annual Return", "-14.502%"},
{"Drawdown", "3.300%"},
{"Expectancy", "-1"},
{"Net Profit", "-0.169%"},
{"Sharpe Ratio", "-0.131"},
{"Probabilistic Sharpe Ratio", "45.057%"},
{"Net Profit", "-0.172%"},
{"Sharpe Ratio", "-0.133"},
{"Probabilistic Sharpe Ratio", "45.048%"},
{"Loss Rate", "100%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "-3.068"},
{"Beta", "0.595"},
{"Annual Standard Deviation", "0.382"},
{"Annual Variance", "0.146"},
{"Information Ratio", "-13.618"},
{"Tracking Error", "0.376"},
{"Treynor Ratio", "-0.084"},
{"Total Fees", "$13.98"},
{"Alpha", "-2.956"},
{"Beta", "0.563"},
{"Annual Standard Deviation", "0.384"},
{"Annual Variance", "0.147"},
{"Information Ratio", "-13.74"},
{"Tracking Error", "0.38"},
{"Treynor Ratio", "-0.091"},
{"Total Fees", "$14.04"},
{"Estimated Strategy Capacity", "$61000000.00"},
{"Fitness Score", "0.146"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "1"},
{"Sortino Ratio", "79228162514264337593543950335"},
{"Return Over Maximum Drawdown", "-4.398"},
{"Return Over Maximum Drawdown", "-4.436"},
{"Portfolio Turnover", "0.268"},
{"Total Insights Generated", "15"},
{"Total Insights Closed", "12"},
@@ -123,7 +123,7 @@ namespace QuantConnect.Algorithm.CSharp
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "8971c92ba163cec8526379865d9b9ee4"}
{"OrderListHash", "32f5f657f91216b1583e8ed89a511550"}
};
}
}

View File

@@ -91,31 +91,31 @@ namespace QuantConnect.Algorithm.CSharp
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
{
{"Total Trades", "23"},
{"Average Win", "0.00%"},
{"Average Win", "0.01%"},
{"Average Loss", "-0.01%"},
{"Compounding Annual Return", "-75.307%"},
{"Compounding Annual Return", "-75.293%"},
{"Drawdown", "5.800%"},
{"Expectancy", "-0.859"},
{"Net Profit", "-5.586%"},
{"Sharpe Ratio", "-3.257"},
{"Probabilistic Sharpe Ratio", "5.931%"},
{"Expectancy", "-0.822"},
{"Net Profit", "-5.584%"},
{"Sharpe Ratio", "-3.264"},
{"Probabilistic Sharpe Ratio", "5.887%"},
{"Loss Rate", "92%"},
{"Win Rate", "8%"},
{"Profit-Loss Ratio", "0.70"},
{"Profit-Loss Ratio", "1.13"},
{"Alpha", "-0.593"},
{"Beta", "0.692"},
{"Beta", "0.711"},
{"Annual Standard Deviation", "0.204"},
{"Annual Variance", "0.042"},
{"Information Ratio", "-2.884"},
{"Tracking Error", "0.194"},
{"Treynor Ratio", "-0.962"},
{"Total Fees", "$25.92"},
{"Information Ratio", "-2.924"},
{"Tracking Error", "0.193"},
{"Treynor Ratio", "-0.935"},
{"Total Fees", "$25.95"},
{"Estimated Strategy Capacity", "$69000000.00"},
{"Fitness Score", "0.004"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "1"},
{"Sortino Ratio", "-4.462"},
{"Return Over Maximum Drawdown", "-13.032"},
{"Sortino Ratio", "-4.452"},
{"Return Over Maximum Drawdown", "-13.058"},
{"Portfolio Turnover", "0.083"},
{"Total Insights Generated", "33"},
{"Total Insights Closed", "30"},
@@ -130,7 +130,7 @@ namespace QuantConnect.Algorithm.CSharp
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "ce59e51c8e404b5dbbc02911473aed1c"}
{"OrderListHash", "be3b0d8b0e2cb312aae1b043e1bef9aa"}
};
}
}

View File

@@ -101,7 +101,7 @@ namespace QuantConnect.Algorithm.CSharp
return;
}
foreach (var symbol in ActiveSecurities.Keys)
foreach (var symbol in ActiveSecurities.Keys.OrderBy(symbol => symbol))
{
if (!Portfolio.ContainsKey(symbol) || !Portfolio[symbol].Invested)
{
@@ -194,22 +194,22 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "5"},
{"Average Win", "0%"},
{"Average Loss", "0%"},
{"Compounding Annual Return", "36.294%"},
{"Compounding Annual Return", "36.239%"},
{"Drawdown", "0%"},
{"Expectancy", "0"},
{"Net Profit", "0.340%"},
{"Sharpe Ratio", "21.2"},
{"Probabilistic Sharpe Ratio", "99.990%"},
{"Net Profit", "0.339%"},
{"Sharpe Ratio", "21.173"},
{"Probabilistic Sharpe Ratio", "99.997%"},
{"Loss Rate", "0%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0.274"},
{"Alpha", "0.271"},
{"Beta", "0.138"},
{"Annual Standard Deviation", "0.011"},
{"Annual Variance", "0"},
{"Information Ratio", "7.202"},
{"Tracking Error", "0.068"},
{"Treynor Ratio", "1.722"},
{"Information Ratio", "6.894"},
{"Tracking Error", "0.069"},
{"Treynor Ratio", "1.727"},
{"Total Fees", "$307.50"},
{"Estimated Strategy Capacity", "$2800000.00"},
{"Fitness Score", "0.173"},
@@ -231,7 +231,7 @@ namespace QuantConnect.Algorithm.CSharp
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "6b1b205e5a6461ffd5bed645099714cd"}
{"OrderListHash", "5ce14f87f21733ec686385da7404484c"}
};
}
}

View File

@@ -78,32 +78,32 @@ namespace QuantConnect.Algorithm.CSharp
/// </summary>
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
{
{"Total Trades", "65"},
{"Total Trades", "52"},
{"Average Win", "0.00%"},
{"Average Loss", "0.00%"},
{"Compounding Annual Return", "0.145%"},
{"Compounding Annual Return", "0.096%"},
{"Drawdown", "0.100%"},
{"Expectancy", "2.190"},
{"Net Profit", "0.134%"},
{"Sharpe Ratio", "0.993"},
{"Probabilistic Sharpe Ratio", "49.669%"},
{"Loss Rate", "29%"},
{"Win Rate", "71%"},
{"Profit-Loss Ratio", "3.50"},
{"Expectancy", "3.321"},
{"Net Profit", "0.089%"},
{"Sharpe Ratio", "0.868"},
{"Probabilistic Sharpe Ratio", "44.482%"},
{"Loss Rate", "24%"},
{"Win Rate", "76%"},
{"Profit-Loss Ratio", "4.67"},
{"Alpha", "0.001"},
{"Beta", "0"},
{"Annual Standard Deviation", "0.001"},
{"Annual Variance", "0"},
{"Information Ratio", "-2.168"},
{"Tracking Error", "0.099"},
{"Treynor Ratio", "-5.187"},
{"Total Fees", "$65.00"},
{"Estimated Strategy Capacity", "$16000000000.00"},
{"Information Ratio", "-2.148"},
{"Tracking Error", "0.101"},
{"Treynor Ratio", "-4.168"},
{"Total Fees", "$52.00"},
{"Estimated Strategy Capacity", "$27000000000.00"},
{"Fitness Score", "0"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "1.51"},
{"Return Over Maximum Drawdown", "1.819"},
{"Sortino Ratio", "1.266"},
{"Return Over Maximum Drawdown", "1.622"},
{"Portfolio Turnover", "0"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
@@ -118,7 +118,7 @@ namespace QuantConnect.Algorithm.CSharp
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "c4c9c272037cfd8f6887052b8d739466"}
{"OrderListHash", "cf43585a8d1781f04b53a4f1ee3380cb"}
};
}
}

View File

@@ -160,13 +160,13 @@ namespace QuantConnect.Algorithm.CSharp
{"Loss Rate", "0%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "5.579"},
{"Beta", "-63.972"},
{"Alpha", "5.56"},
{"Beta", "-71.105"},
{"Annual Standard Deviation", "0.434"},
{"Annual Variance", "0.188"},
{"Information Ratio", "0.996"},
{"Tracking Error", "0.441"},
{"Treynor Ratio", "-0.008"},
{"Information Ratio", "1.016"},
{"Tracking Error", "0.44"},
{"Treynor Ratio", "-0.007"},
{"Total Fees", "$20.35"},
{"Estimated Strategy Capacity", "$19000000.00"},
{"Fitness Score", "0.138"},

View File

@@ -113,29 +113,29 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "1"},
{"Average Win", "0%"},
{"Average Loss", "0%"},
{"Compounding Annual Return", "264.819%"},
{"Compounding Annual Return", "271.453%"},
{"Drawdown", "2.200%"},
{"Expectancy", "0"},
{"Net Profit", "1.668%"},
{"Sharpe Ratio", "8.749"},
{"Probabilistic Sharpe Ratio", "67.311%"},
{"Net Profit", "1.692%"},
{"Sharpe Ratio", "8.888"},
{"Probabilistic Sharpe Ratio", "67.609%"},
{"Loss Rate", "0%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "-0.005"},
{"Beta", "0.996"},
{"Annual Standard Deviation", "0.219"},
{"Annual Variance", "0.048"},
{"Information Ratio", "-14.189"},
{"Annual Standard Deviation", "0.222"},
{"Annual Variance", "0.049"},
{"Information Ratio", "-14.565"},
{"Tracking Error", "0.001"},
{"Treynor Ratio", "1.922"},
{"Total Fees", "$3.26"},
{"Estimated Strategy Capacity", "$58000000.00"},
{"Treynor Ratio", "1.978"},
{"Total Fees", "$3.44"},
{"Estimated Strategy Capacity", "$48000000.00"},
{"Fitness Score", "0.248"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "79228162514264337593543950335"},
{"Return Over Maximum Drawdown", "93.761"},
{"Return Over Maximum Drawdown", "93.728"},
{"Portfolio Turnover", "0.248"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
@@ -150,7 +150,7 @@ namespace QuantConnect.Algorithm.CSharp
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "25885f979ca8c7b44f5d0f7daf00b241"}
{"OrderListHash", "9e4bfd2eb0b81ee5bc1b197a87ccedbe"}
};
}
}

View File

@@ -76,9 +76,11 @@ namespace QuantConnect.Algorithm.CSharp
/// <param name="data">Slice object keyed by symbol containing the stock data</param>
public override void OnData(Slice data)
{
if (!_equityBought && data.ContainsKey(_spy)) {
//Buy our Equity
var quantity = CalculateOrderQuantity(_spy, .1m);
if (!_equityBought && data.ContainsKey(_spy))
{
//Buy our Equity.
//Quantity is rounded down to an even number since it will be split in two equal halves
var quantity = Math.Floor(CalculateOrderQuantity(_spy, .1m) / 2) * 2;
_equityBuy = MarketOrder(_spy, quantity, asynchronous: true);
_equityBought = true;
}
@@ -119,7 +121,7 @@ namespace QuantConnect.Algorithm.CSharp
var order = Transactions.GetOrderById(orderEvent.OrderId);
// Based on the type verify the order
switch(order.Type)
switch (order.Type)
{
case OrderType.Market:
VerifyMarketOrder(order, orderEvent);
@@ -140,7 +142,7 @@ namespace QuantConnect.Algorithm.CSharp
/// <param name="order">Order object to analyze</param>
public void VerifyMarketOrder(Order order, OrderEvent orderEvent)
{
switch(order.Status)
switch (order.Status)
{
case OrderStatus.Submitted:
break;
@@ -152,7 +154,7 @@ namespace QuantConnect.Algorithm.CSharp
throw new Exception("LastFillTime should not be null");
}
if (order.Quantity/2 != orderEvent.FillQuantity)
if (order.Quantity / 2 != orderEvent.FillQuantity)
{
throw new Exception("Order size should be half");
}
@@ -215,9 +217,9 @@ namespace QuantConnect.Algorithm.CSharp
}
//Check equity holding, should be invested, profit should be
//Quantity should be 50, AveragePrice should be ticket AverageFillPrice
//Quantity should be 52, AveragePrice should be ticket AverageFillPrice
var equityHolding = Portfolio[_equityBuy.Symbol];
if (!equityHolding.Invested || equityHolding.Quantity != 50 || equityHolding.AveragePrice != _equityBuy.AverageFillPrice)
if (!equityHolding.Invested || equityHolding.Quantity != 52 || equityHolding.AveragePrice != _equityBuy.AverageFillPrice)
{
throw new Exception("Equity holding does not match expected outcome");
}
@@ -299,30 +301,30 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "3"},
{"Average Win", "0%"},
{"Average Loss", "-0.40%"},
{"Compounding Annual Return", "-22.335%"},
{"Compounding Annual Return", "-22.231%"},
{"Drawdown", "0.400%"},
{"Expectancy", "-1"},
{"Net Profit", "-0.323%"},
{"Sharpe Ratio", "-11.098"},
{"Net Profit", "-0.321%"},
{"Sharpe Ratio", "-11.083"},
{"Probabilistic Sharpe Ratio", "0%"},
{"Loss Rate", "100%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "-0.002"},
{"Beta", "0.099"},
{"Alpha", "-0.003"},
{"Beta", "0.097"},
{"Annual Standard Deviation", "0.002"},
{"Annual Variance", "0"},
{"Information Ratio", "9.899"},
{"Tracking Error", "0.019"},
{"Treynor Ratio", "-0.23"},
{"Information Ratio", "9.742"},
{"Tracking Error", "0.021"},
{"Treynor Ratio", "-0.26"},
{"Total Fees", "$2.00"},
{"Estimated Strategy Capacity", "$0"},
{"Fitness Score", "0.213"},
{"Fitness Score", "0.212"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "79228162514264337593543950335"},
{"Return Over Maximum Drawdown", "-73.456"},
{"Portfolio Turnover", "0.426"},
{"Return Over Maximum Drawdown", "-73.565"},
{"Portfolio Turnover", "0.425"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
{"Total Insights Analysis Completed", "0"},
@@ -336,7 +338,7 @@ namespace QuantConnect.Algorithm.CSharp
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "72a6ced0ed0c2da7136f3be652eb4744"}
{"OrderListHash", "7f99e1a8ce4675a1e8bbe1ba45967ccd"}
};
}
}
}

View File

@@ -80,29 +80,29 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "1"},
{"Average Win", "0%"},
{"Average Loss", "0%"},
{"Compounding Annual Return", "264.819%"},
{"Compounding Annual Return", "271.453%"},
{"Drawdown", "2.200%"},
{"Expectancy", "0"},
{"Net Profit", "1.668%"},
{"Sharpe Ratio", "8.749"},
{"Probabilistic Sharpe Ratio", "67.311%"},
{"Net Profit", "1.692%"},
{"Sharpe Ratio", "8.888"},
{"Probabilistic Sharpe Ratio", "67.609%"},
{"Loss Rate", "0%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "-0.005"},
{"Beta", "0.996"},
{"Annual Standard Deviation", "0.219"},
{"Annual Variance", "0.048"},
{"Information Ratio", "-14.189"},
{"Annual Standard Deviation", "0.222"},
{"Annual Variance", "0.049"},
{"Information Ratio", "-14.565"},
{"Tracking Error", "0.001"},
{"Treynor Ratio", "1.922"},
{"Total Fees", "$3.26"},
{"Estimated Strategy Capacity", "$58000000.00"},
{"Treynor Ratio", "1.978"},
{"Total Fees", "$3.44"},
{"Estimated Strategy Capacity", "$48000000.00"},
{"Fitness Score", "0.248"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "79228162514264337593543950335"},
{"Return Over Maximum Drawdown", "93.761"},
{"Return Over Maximum Drawdown", "93.728"},
{"Portfolio Turnover", "0.248"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
@@ -117,7 +117,7 @@ namespace QuantConnect.Algorithm.CSharp
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "25885f979ca8c7b44f5d0f7daf00b241"}
{"OrderListHash", "9e4bfd2eb0b81ee5bc1b197a87ccedbe"}
};
}
}

View File

@@ -71,30 +71,30 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "1"},
{"Average Win", "0%"},
{"Average Loss", "0%"},
{"Compounding Annual Return", "246.000%"},
{"Drawdown", "1.100%"},
{"Compounding Annual Return", "246.546%"},
{"Drawdown", "1.200%"},
{"Expectancy", "0"},
{"Net Profit", "3.459%"},
{"Sharpe Ratio", "10.11"},
{"Probabilistic Sharpe Ratio", "83.150%"},
{"Net Profit", "3.464%"},
{"Sharpe Ratio", "9.933"},
{"Probabilistic Sharpe Ratio", "82.470%"},
{"Loss Rate", "0%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "1.935"},
{"Beta", "-0.119"},
{"Annual Standard Deviation", "0.16"},
{"Annual Variance", "0.026"},
{"Information Ratio", "-4.556"},
{"Tracking Error", "0.221"},
{"Treynor Ratio", "-13.568"},
{"Total Fees", "$3.26"},
{"Estimated Strategy Capacity", "$890000000.00"},
{"Fitness Score", "0.111"},
{"Alpha", "1.957"},
{"Beta", "-0.125"},
{"Annual Standard Deviation", "0.164"},
{"Annual Variance", "0.027"},
{"Information Ratio", "-4.577"},
{"Tracking Error", "0.225"},
{"Treynor Ratio", "-13.006"},
{"Total Fees", "$3.45"},
{"Estimated Strategy Capacity", "$840000000.00"},
{"Fitness Score", "0.112"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "52.533"},
{"Return Over Maximum Drawdown", "214.75"},
{"Portfolio Turnover", "0.111"},
{"Sortino Ratio", "53.951"},
{"Return Over Maximum Drawdown", "209.464"},
{"Portfolio Turnover", "0.112"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
{"Total Insights Analysis Completed", "0"},
@@ -108,7 +108,7 @@ namespace QuantConnect.Algorithm.CSharp
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "82fee25cd17100c53bb173834ab5f0b2"}
{"OrderListHash", "33d01821923c397f999cfb2e5b5928ad"}
};
}
}

View File

@@ -92,29 +92,29 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "3"},
{"Average Win", "0%"},
{"Average Loss", "-1.01%"},
{"Compounding Annual Return", "254.782%"},
{"Compounding Annual Return", "261.134%"},
{"Drawdown", "2.200%"},
{"Expectancy", "-1"},
{"Net Profit", "1.632%"},
{"Sharpe Ratio", "8.371"},
{"Probabilistic Sharpe Ratio", "66.555%"},
{"Net Profit", "1.655%"},
{"Sharpe Ratio", "8.505"},
{"Probabilistic Sharpe Ratio", "66.840%"},
{"Loss Rate", "100%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "-0.088"},
{"Alpha", "-0.091"},
{"Beta", "1.006"},
{"Annual Standard Deviation", "0.221"},
{"Annual Variance", "0.049"},
{"Information Ratio", "-32.586"},
{"Annual Standard Deviation", "0.224"},
{"Annual Variance", "0.05"},
{"Information Ratio", "-33.445"},
{"Tracking Error", "0.002"},
{"Treynor Ratio", "1.839"},
{"Total Fees", "$9.77"},
{"Estimated Strategy Capacity", "$27000000.00"},
{"Treynor Ratio", "1.893"},
{"Total Fees", "$10.32"},
{"Estimated Strategy Capacity", "$23000000.00"},
{"Fitness Score", "0.747"},
{"Kelly Criterion Estimate", "38.64"},
{"Kelly Criterion Probability Value", "0.229"},
{"Kelly Criterion Estimate", "38.796"},
{"Kelly Criterion Probability Value", "0.228"},
{"Sortino Ratio", "79228162514264337593543950335"},
{"Return Over Maximum Drawdown", "85.209"},
{"Return Over Maximum Drawdown", "85.095"},
{"Portfolio Turnover", "0.747"},
{"Total Insights Generated", "100"},
{"Total Insights Closed", "99"},
@@ -122,14 +122,14 @@ namespace QuantConnect.Algorithm.CSharp
{"Long Insight Count", "100"},
{"Short Insight Count", "0"},
{"Long/Short Ratio", "100%"},
{"Estimated Monthly Alpha Value", "$126657.6305"},
{"Total Accumulated Estimated Alpha Value", "$20405.9516"},
{"Mean Population Estimated Insight Value", "$206.1207"},
{"Mean Population Direction", "54.5455%"},
{"Mean Population Magnitude", "54.5455%"},
{"Rolling Averaged Population Direction", "59.8056%"},
{"Rolling Averaged Population Magnitude", "59.8056%"},
{"OrderListHash", "17e29d58e5dabd93569da752c4552c70"}
{"Estimated Monthly Alpha Value", "$117277.2200"},
{"Total Accumulated Estimated Alpha Value", "$18894.6632"},
{"Mean Population Estimated Insight Value", "$190.8552"},
{"Mean Population Direction", "53.5354%"},
{"Mean Population Magnitude", "53.5354%"},
{"Rolling Averaged Population Direction", "58.2788%"},
{"Rolling Averaged Population Magnitude", "58.2788%"},
{"OrderListHash", "ad2216297c759d8e5aef48ff065f8919"}
};
}
}

View File

@@ -139,13 +139,13 @@ namespace QuantConnect.Algorithm.CSharp
{"Loss Rate", "89%"},
{"Win Rate", "11%"},
{"Profit-Loss Ratio", "0.69"},
{"Alpha", "4.398"},
{"Beta", "-0.989"},
{"Alpha", "4.469"},
{"Beta", "-0.961"},
{"Annual Standard Deviation", "0.373"},
{"Annual Variance", "0.139"},
{"Information Ratio", "-12.816"},
{"Tracking Error", "0.504"},
{"Treynor Ratio", "1.011"},
{"Information Ratio", "-13.191"},
{"Tracking Error", "0.507"},
{"Treynor Ratio", "1.04"},
{"Total Fees", "$15207.00"},
{"Estimated Strategy Capacity", "$7700.00"},
{"Fitness Score", "0.033"},

View File

@@ -147,13 +147,13 @@ namespace QuantConnect.Algorithm.CSharp
{"Loss Rate", "0%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "-1.347"},
{"Alpha", "-1.362"},
{"Beta", "0.257"},
{"Annual Standard Deviation", "0.109"},
{"Annual Variance", "0.012"},
{"Information Ratio", "-14.763"},
{"Tracking Error", "0.188"},
{"Treynor Ratio", "-3.318"},
{"Information Ratio", "-14.947"},
{"Tracking Error", "0.19"},
{"Treynor Ratio", "-3.309"},
{"Total Fees", "$3.70"},
{"Estimated Strategy Capacity", "$52000000.00"},
{"Fitness Score", "0.009"},

View File

@@ -123,13 +123,13 @@ namespace QuantConnect.Algorithm.CSharp
{"Loss Rate", "100%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0"},
{"Beta", "0"},
{"Alpha", "-0.908"},
{"Beta", "0.468"},
{"Annual Standard Deviation", "0.139"},
{"Annual Variance", "0.019"},
{"Information Ratio", "-4.217"},
{"Tracking Error", "0.139"},
{"Treynor Ratio", "0"},
{"Information Ratio", "-9.003"},
{"Tracking Error", "0.142"},
{"Treynor Ratio", "-1.251"},
{"Total Fees", "$0.00"},
{"Estimated Strategy Capacity", "$14000000.00"},
{"Fitness Score", "0.044"},

View File

@@ -0,0 +1,150 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System.Linq;
using QuantConnect.Data;
using QuantConnect.Orders;
using QuantConnect.Interfaces;
using QuantConnect.Data.Market;
using System.Collections.Generic;
using QuantConnect.Securities.Option;
namespace QuantConnect.Algorithm.CSharp
{
/// <summary>
/// Basic template algorithm trading a Call Butterfly option equity strategy
/// </summary>
/// <meta name="tag" content="options" />
/// <meta name="tag" content="using data" />
/// <meta name="tag" content="using quantconnect" />
/// <meta name="tag" content="trading and orders" />
public class BasicTemplateOptionEquityStrategyAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition
{
protected Symbol _optionSymbol;
public override void Initialize()
{
SetStartDate(2015, 12, 24);
SetEndDate(2015, 12, 24);
var equity = AddEquity("GOOG", leverage: 4);
var option = AddOption(equity.Symbol);
_optionSymbol = option.Symbol;
// set our strike/expiry filter for this option chain
option.SetFilter(u => u.Strikes(-2, +2)
// Expiration method accepts TimeSpan objects or integer for days.
// The following statements yield the same filtering criteria
.Expiration(0, 180));
}
/// <summary>
/// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
/// </summary>
/// <param name="slice">Slice object keyed by symbol containing the stock data</param>
public override void OnData(Slice slice)
{
if (!Portfolio.Invested)
{
OptionChain chain;
if (IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain))
{
var callContracts = chain.Where(contract => contract.Right == OptionRight.Call)
.GroupBy(x => x.Expiry)
.OrderBy(grouping => grouping.Key)
.First()
.OrderBy(x => x.Strike)
.ToList();
var expiry = callContracts[0].Expiry;
var lowerStrike = callContracts[0].Strike;
var middleStrike = callContracts[1].Strike;
var higherStrike = callContracts[2].Strike;
var optionStrategy = OptionStrategies.CallButterfly(_optionSymbol, higherStrike, middleStrike, lowerStrike, expiry);
Order(optionStrategy, 10);
}
}
}
/// <summary>
/// Order fill event handler. On an order fill update the resulting information is passed to this method.
/// </summary>
/// <param name="orderEvent">Order event details containing details of the evemts</param>
/// <remarks>This method can be called asynchronously and so should only be used by seasoned C# experts. Ensure you use proper locks on thread-unsafe objects</remarks>
public override void OnOrderEvent(OrderEvent orderEvent)
{
Log($"{orderEvent}");
}
/// <summary>
/// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.
/// </summary>
public bool CanRunLocally => true;
/// <summary>
/// This is used by the regression test system to indicate which languages this algorithm is written in.
/// </summary>
public Language[] Languages { get; } = { Language.CSharp, Language.Python };
/// <summary>
/// This is used by the regression test system to indicate what the expected statistics are from running the algorithm
/// </summary>
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
{
{"Total Trades", "3"},
{"Average Win", "0%"},
{"Average Loss", "0%"},
{"Compounding Annual Return", "0%"},
{"Drawdown", "0%"},
{"Expectancy", "0"},
{"Net Profit", "0%"},
{"Sharpe Ratio", "0"},
{"Probabilistic Sharpe Ratio", "0%"},
{"Loss Rate", "0%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0"},
{"Beta", "0"},
{"Annual Standard Deviation", "0"},
{"Annual Variance", "0"},
{"Information Ratio", "0"},
{"Tracking Error", "0"},
{"Treynor Ratio", "0"},
{"Total Fees", "$10.00"},
{"Estimated Strategy Capacity", "$84000.00"},
{"Fitness Score", "0"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "0"},
{"Return Over Maximum Drawdown", "0"},
{"Portfolio Turnover", "0"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
{"Total Insights Analysis Completed", "0"},
{"Long Insight Count", "0"},
{"Short Insight Count", "0"},
{"Long/Short Ratio", "100%"},
{"Estimated Monthly Alpha Value", "$0"},
{"Total Accumulated Estimated Alpha Value", "$0"},
{"Mean Population Estimated Insight Value", "$0"},
{"Mean Population Direction", "0%"},
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "82c29cc9db9a300074d6ff136253f4ac"}
};
}
}

View File

@@ -74,32 +74,32 @@ namespace QuantConnect.Algorithm.CSharp
/// </summary>
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
{
{"Total Trades", "18"},
{"Total Trades", "19"},
{"Average Win", "0%"},
{"Average Loss", "-0.16%"},
{"Compounding Annual Return", "72.164%"},
{"Compounding Annual Return", "71.962%"},
{"Drawdown", "1.100%"},
{"Expectancy", "-1"},
{"Net Profit", "0.747%"},
{"Sharpe Ratio", "4.086"},
{"Probabilistic Sharpe Ratio", "61.091%"},
{"Net Profit", "0.745%"},
{"Sharpe Ratio", "4.072"},
{"Probabilistic Sharpe Ratio", "61.045%"},
{"Loss Rate", "100%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "-0.305"},
{"Beta", "0.564"},
{"Alpha", "-0.314"},
{"Beta", "0.554"},
{"Annual Standard Deviation", "0.113"},
{"Annual Variance", "0.013"},
{"Information Ratio", "-10.007"},
{"Tracking Error", "0.09"},
{"Treynor Ratio", "0.82"},
{"Total Fees", "$41.70"},
{"Information Ratio", "-10.043"},
{"Tracking Error", "0.093"},
{"Treynor Ratio", "0.832"},
{"Total Fees", "$42.71"},
{"Estimated Strategy Capacity", "$3000000.00"},
{"Fitness Score", "0.634"},
{"Kelly Criterion Estimate", "13.656"},
{"Kelly Criterion Probability Value", "0.228"},
{"Sortino Ratio", "79228162514264337593543950335"},
{"Return Over Maximum Drawdown", "80.05"},
{"Return Over Maximum Drawdown", "79.683"},
{"Portfolio Turnover", "0.634"},
{"Total Insights Generated", "17"},
{"Total Insights Closed", "14"},
@@ -107,14 +107,14 @@ namespace QuantConnect.Algorithm.CSharp
{"Long Insight Count", "6"},
{"Short Insight Count", "7"},
{"Long/Short Ratio", "85.71%"},
{"Estimated Monthly Alpha Value", "$72447.6813"},
{"Total Accumulated Estimated Alpha Value", "$12477.1007"},
{"Mean Population Estimated Insight Value", "$891.2215"},
{"Estimated Monthly Alpha Value", "$44645.2887"},
{"Total Accumulated Estimated Alpha Value", "$7688.9108"},
{"Mean Population Estimated Insight Value", "$549.2079"},
{"Mean Population Direction", "50%"},
{"Mean Population Magnitude", "50%"},
{"Rolling Averaged Population Direction", "12.6429%"},
{"Rolling Averaged Population Magnitude", "12.6429%"},
{"OrderListHash", "3edd51956c7c97af4863aa6059c11f1a"}
{"OrderListHash", "b1dc004bd5163b865e17a429d402a9c5"}
};
}
}

View File

@@ -151,9 +151,9 @@ namespace QuantConnect.Algorithm.CSharp
{"Beta", "0"},
{"Annual Standard Deviation", "0"},
{"Annual Variance", "0"},
{"Information Ratio", "-7.067"},
{"Tracking Error", "0.193"},
{"Treynor Ratio", "7.887"},
{"Information Ratio", "-7.163"},
{"Tracking Error", "0.195"},
{"Treynor Ratio", "8.093"},
{"Total Fees", "$0.00"},
{"Estimated Strategy Capacity", "$0"},
{"Fitness Score", "0"},

View File

@@ -173,13 +173,13 @@ namespace QuantConnect.Algorithm.CSharp
{"Loss Rate", "0%"},
{"Win Rate", "100%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0.237"},
{"Beta", "-0.182"},
{"Alpha", "0.238"},
{"Beta", "-0.183"},
{"Annual Standard Deviation", "0.09"},
{"Annual Variance", "0.008"},
{"Information Ratio", "2.425"},
{"Tracking Error", "0.149"},
{"Treynor Ratio", "-1.405"},
{"Information Ratio", "2.41"},
{"Tracking Error", "0.148"},
{"Treynor Ratio", "-1.399"},
{"Total Fees", "$2.00"},
{"Estimated Strategy Capacity", "$42000000.00"},
{"Fitness Score", "0.076"},

View File

@@ -151,18 +151,18 @@ namespace QuantConnect.Algorithm.CSharp
{"Drawdown", "0.500%"},
{"Expectancy", "1.393"},
{"Net Profit", "32.840%"},
{"Sharpe Ratio", "7.14272222483913E+15"},
{"Sharpe Ratio", "7142722224839133"},
{"Probabilistic Sharpe Ratio", "0%"},
{"Loss Rate", "83%"},
{"Win Rate", "17%"},
{"Profit-Loss Ratio", "13.36"},
{"Alpha", "2.59468989671647E+16"},
{"Beta", "67.661"},
{"Alpha", "25946898967164744"},
{"Beta", "66.241"},
{"Annual Standard Deviation", "3.633"},
{"Annual Variance", "13.196"},
{"Information Ratio", "7.24987266907741E+15"},
{"Tracking Error", "3.579"},
{"Treynor Ratio", "383485597312030"},
{"Information Ratio", "7252204536250480"},
{"Tracking Error", "3.578"},
{"Treynor Ratio", "391705233723349.5"},
{"Total Fees", "$13.00"},
{"Estimated Strategy Capacity", "$3000000.00"},
{"Fitness Score", "0.232"},

View File

@@ -119,29 +119,29 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "11"},
{"Average Win", "0.51%"},
{"Average Loss", "-0.33%"},
{"Compounding Annual Return", "-31.082%"},
{"Drawdown", "2.700%"},
{"Compounding Annual Return", "-31.050%"},
{"Drawdown", "2.600%"},
{"Expectancy", "0.263"},
{"Net Profit", "-1.518%"},
{"Sharpe Ratio", "-2.118"},
{"Probabilistic Sharpe Ratio", "23.259%"},
{"Net Profit", "-1.516%"},
{"Sharpe Ratio", "-2.123"},
{"Probabilistic Sharpe Ratio", "23.232%"},
{"Loss Rate", "50%"},
{"Win Rate", "50%"},
{"Profit-Loss Ratio", "1.53"},
{"Alpha", "-0.208"},
{"Beta", "0.415"},
{"Annual Standard Deviation", "0.119"},
{"Alpha", "-0.21"},
{"Beta", "0.416"},
{"Annual Standard Deviation", "0.118"},
{"Annual Variance", "0.014"},
{"Information Ratio", "-1.167"},
{"Tracking Error", "0.126"},
{"Treynor Ratio", "-0.607"},
{"Information Ratio", "-1.2"},
{"Tracking Error", "0.125"},
{"Treynor Ratio", "-0.605"},
{"Total Fees", "$11.63"},
{"Estimated Strategy Capacity", "$46000000.00"},
{"Fitness Score", "0.013"},
{"Fitness Score", "0.012"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "-5.1"},
{"Return Over Maximum Drawdown", "-11.717"},
{"Sortino Ratio", "-5.19"},
{"Return Over Maximum Drawdown", "-11.761"},
{"Portfolio Turnover", "0.282"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
@@ -156,7 +156,7 @@ namespace QuantConnect.Algorithm.CSharp
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "3d1ae61492b34c39115b76757510c058"}
{"OrderListHash", "d2412df9590523bc33e97ffa7683ce96"}
};
}
}

View File

@@ -103,29 +103,29 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "1"},
{"Average Win", "0%"},
{"Average Loss", "0%"},
{"Compounding Annual Return", "58.336%"},
{"Drawdown", "0.900%"},
{"Compounding Annual Return", "57.657%"},
{"Drawdown", "1.000%"},
{"Expectancy", "0"},
{"Net Profit", "1.012%"},
{"Sharpe Ratio", "5.09"},
{"Probabilistic Sharpe Ratio", "68.472%"},
{"Net Profit", "1.003%"},
{"Sharpe Ratio", "5.024"},
{"Probabilistic Sharpe Ratio", "68.421%"},
{"Loss Rate", "0%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0.322"},
{"Beta", "0.265"},
{"Alpha", "0.312"},
{"Beta", "0.27"},
{"Annual Standard Deviation", "0.087"},
{"Annual Variance", "0.008"},
{"Information Ratio", "-0.088"},
{"Information Ratio", "-0.242"},
{"Tracking Error", "0.105"},
{"Treynor Ratio", "1.667"},
{"Total Fees", "$2.91"},
{"Estimated Strategy Capacity", "$670000000.00"},
{"Treynor Ratio", "1.616"},
{"Total Fees", "$3.08"},
{"Estimated Strategy Capacity", "$630000000.00"},
{"Fitness Score", "0.141"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "9.731"},
{"Return Over Maximum Drawdown", "61.515"},
{"Sortino Ratio", "10.385"},
{"Return Over Maximum Drawdown", "58.709"},
{"Portfolio Turnover", "0.143"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
@@ -140,7 +140,7 @@ namespace QuantConnect.Algorithm.CSharp
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "718d73fbddccb63aeacbf4659938b4b8"}
{"OrderListHash", "50145c3c1d58b09f38ec1b77cfe69eae"}
};
}
}

View File

@@ -83,13 +83,13 @@ namespace QuantConnect.Algorithm.CSharp
{"Loss Rate", "33%"},
{"Win Rate", "67%"},
{"Profit-Loss Ratio", "0.02"},
{"Alpha", "4.314"},
{"Beta", "1.239"},
{"Alpha", "4.267"},
{"Beta", "1.227"},
{"Annual Standard Deviation", "0.285"},
{"Annual Variance", "0.081"},
{"Information Ratio", "47.452"},
{"Tracking Error", "0.101"},
{"Treynor Ratio", "5.409"},
{"Information Ratio", "48.639"},
{"Tracking Error", "0.097"},
{"Treynor Ratio", "5.459"},
{"Total Fees", "$67.00"},
{"Estimated Strategy Capacity", "$3200000.00"},
{"Fitness Score", "0.501"},

View File

@@ -66,31 +66,31 @@ namespace QuantConnect.Algorithm.CSharp
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
{
{"Total Trades", "7"},
{"Average Win", "1.02%"},
{"Average Win", "1.01%"},
{"Average Loss", "-1.01%"},
{"Compounding Annual Return", "205.606%"},
{"Compounding Annual Return", "210.936%"},
{"Drawdown", "2.200%"},
{"Expectancy", "0.339"},
{"Net Profit", "1.439%"},
{"Sharpe Ratio", "7.166"},
{"Probabilistic Sharpe Ratio", "64.794%"},
{"Net Profit", "1.461%"},
{"Sharpe Ratio", "7.289"},
{"Probabilistic Sharpe Ratio", "65.077%"},
{"Loss Rate", "33%"},
{"Win Rate", "67%"},
{"Profit-Loss Ratio", "1.01"},
{"Alpha", "-0.341"},
{"Alpha", "-0.349"},
{"Beta", "0.968"},
{"Annual Standard Deviation", "0.213"},
{"Annual Variance", "0.045"},
{"Information Ratio", "-46.719"},
{"Annual Standard Deviation", "0.216"},
{"Annual Variance", "0.046"},
{"Information Ratio", "-47.59"},
{"Tracking Error", "0.009"},
{"Treynor Ratio", "1.575"},
{"Total Fees", "$22.77"},
{"Estimated Strategy Capacity", "$22000000.00"},
{"Treynor Ratio", "1.623"},
{"Total Fees", "$24.07"},
{"Estimated Strategy Capacity", "$20000000.00"},
{"Fitness Score", "0.999"},
{"Kelly Criterion Estimate", "38.64"},
{"Kelly Criterion Probability Value", "0.229"},
{"Kelly Criterion Estimate", "38.796"},
{"Kelly Criterion Probability Value", "0.228"},
{"Sortino Ratio", "79228162514264337593543950335"},
{"Return Over Maximum Drawdown", "69.159"},
{"Return Over Maximum Drawdown", "69.017"},
{"Portfolio Turnover", "1.242"},
{"Total Insights Generated", "100"},
{"Total Insights Closed", "99"},
@@ -98,14 +98,14 @@ namespace QuantConnect.Algorithm.CSharp
{"Long Insight Count", "100"},
{"Short Insight Count", "0"},
{"Long/Short Ratio", "100%"},
{"Estimated Monthly Alpha Value", "$126657.6305"},
{"Total Accumulated Estimated Alpha Value", "$20405.9516"},
{"Mean Population Estimated Insight Value", "$206.1207"},
{"Mean Population Direction", "54.5455%"},
{"Mean Population Magnitude", "54.5455%"},
{"Rolling Averaged Population Direction", "59.8056%"},
{"Rolling Averaged Population Magnitude", "59.8056%"},
{"OrderListHash", "e0f388bf9e88b34388c866150b292573"}
{"Estimated Monthly Alpha Value", "$117277.2200"},
{"Total Accumulated Estimated Alpha Value", "$18894.6632"},
{"Mean Population Estimated Insight Value", "$190.8552"},
{"Mean Population Direction", "53.5354%"},
{"Mean Population Magnitude", "53.5354%"},
{"Rolling Averaged Population Direction", "58.2788%"},
{"Rolling Averaged Population Magnitude", "58.2788%"},
{"OrderListHash", "d8d556bcf963ba50f85cea387c55922b"}
};
}
}

View File

@@ -75,31 +75,31 @@ namespace QuantConnect.Algorithm.CSharp
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
{
{"Total Trades", "6"},
{"Average Win", "0.00%"},
{"Average Win", "0%"},
{"Average Loss", "0.00%"},
{"Compounding Annual Return", "38.059%"},
{"Compounding Annual Return", "38.832%"},
{"Drawdown", "0.600%"},
{"Expectancy", "-0.502"},
{"Net Profit", "0.413%"},
{"Sharpe Ratio", "5.518"},
{"Probabilistic Sharpe Ratio", "66.933%"},
{"Loss Rate", "67%"},
{"Win Rate", "33%"},
{"Profit-Loss Ratio", "0.50"},
{"Alpha", "-0.178"},
{"Beta", "0.249"},
{"Expectancy", "-1"},
{"Net Profit", "0.420%"},
{"Sharpe Ratio", "5.579"},
{"Probabilistic Sharpe Ratio", "67.318%"},
{"Loss Rate", "100%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "-0.184"},
{"Beta", "0.248"},
{"Annual Standard Deviation", "0.055"},
{"Annual Variance", "0.003"},
{"Information Ratio", "-9.844"},
{"Tracking Error", "0.165"},
{"Treynor Ratio", "1.212"},
{"Information Ratio", "-10.012"},
{"Tracking Error", "0.167"},
{"Treynor Ratio", "1.241"},
{"Total Fees", "$6.00"},
{"Estimated Strategy Capacity", "$42000000.00"},
{"Estimated Strategy Capacity", "$33000000.00"},
{"Fitness Score", "0.063"},
{"Kelly Criterion Estimate", "38.64"},
{"Kelly Criterion Probability Value", "0.229"},
{"Kelly Criterion Estimate", "38.796"},
{"Kelly Criterion Probability Value", "0.228"},
{"Sortino Ratio", "79228162514264337593543950335"},
{"Return Over Maximum Drawdown", "70.188"},
{"Return Over Maximum Drawdown", "70.89"},
{"Portfolio Turnover", "0.063"},
{"Total Insights Generated", "100"},
{"Total Insights Closed", "99"},
@@ -107,14 +107,14 @@ namespace QuantConnect.Algorithm.CSharp
{"Long Insight Count", "100"},
{"Short Insight Count", "0"},
{"Long/Short Ratio", "100%"},
{"Estimated Monthly Alpha Value", "$126657.6305"},
{"Total Accumulated Estimated Alpha Value", "$20405.9516"},
{"Mean Population Estimated Insight Value", "$206.1207"},
{"Mean Population Direction", "54.5455%"},
{"Mean Population Magnitude", "54.5455%"},
{"Rolling Averaged Population Direction", "59.8056%"},
{"Rolling Averaged Population Magnitude", "59.8056%"},
{"OrderListHash", "07eb3e2c199575b547459a534057eb5e"}
{"Estimated Monthly Alpha Value", "$117277.2200"},
{"Total Accumulated Estimated Alpha Value", "$18894.6632"},
{"Mean Population Estimated Insight Value", "$190.8552"},
{"Mean Population Direction", "53.5354%"},
{"Mean Population Magnitude", "53.5354%"},
{"Rolling Averaged Population Direction", "58.2788%"},
{"Rolling Averaged Population Magnitude", "58.2788%"},
{"OrderListHash", "21e4704a124ba562d042e1e9962f4316"}
};
}
}

View File

@@ -156,13 +156,13 @@ namespace QuantConnect.Algorithm.CSharp
{"Loss Rate", "0%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "5.579"},
{"Beta", "-63.972"},
{"Alpha", "5.56"},
{"Beta", "-71.105"},
{"Annual Standard Deviation", "0.434"},
{"Annual Variance", "0.188"},
{"Information Ratio", "0.996"},
{"Tracking Error", "0.441"},
{"Treynor Ratio", "-0.008"},
{"Information Ratio", "1.016"},
{"Tracking Error", "0.44"},
{"Treynor Ratio", "-0.007"},
{"Total Fees", "$20.35"},
{"Estimated Strategy Capacity", "$19000000.00"},
{"Fitness Score", "0.138"},

View File

@@ -182,13 +182,13 @@ namespace QuantConnect.Algorithm.CSharp
{"Loss Rate", "100%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "-0.443"},
{"Alpha", "-0.449"},
{"Beta", "0.157"},
{"Annual Standard Deviation", "0.074"},
{"Annual Variance", "0.005"},
{"Information Ratio", "-9.046"},
{"Tracking Error", "0.176"},
{"Treynor Ratio", "-1.46"},
{"Information Ratio", "-9.158"},
{"Tracking Error", "0.178"},
{"Treynor Ratio", "-1.456"},
{"Total Fees", "$7.82"},
{"Estimated Strategy Capacity", "$12000000.00"},
{"Fitness Score", "0.1"},

View File

@@ -128,29 +128,29 @@ namespace QuantConnect.Algorithm.CSharp
{
{"Total Trades", "85"},
{"Average Win", "4.85%"},
{"Average Loss", "-4.21%"},
{"Compounding Annual Return", "-3.100%"},
{"Drawdown", "52.900%"},
{"Expectancy", "-0.052"},
{"Net Profit", "-29.298%"},
{"Sharpe Ratio", "-0.076"},
{"Average Loss", "-4.22%"},
{"Compounding Annual Return", "-3.124%"},
{"Drawdown", "53.000%"},
{"Expectancy", "-0.053"},
{"Net Profit", "-29.486%"},
{"Sharpe Ratio", "-0.078"},
{"Probabilistic Sharpe Ratio", "0.004%"},
{"Loss Rate", "56%"},
{"Win Rate", "44%"},
{"Profit-Loss Ratio", "1.15"},
{"Alpha", "-0.013"},
{"Beta", "0.009"},
{"Annual Standard Deviation", "0.164"},
{"Beta", "0.007"},
{"Annual Standard Deviation", "0.163"},
{"Annual Variance", "0.027"},
{"Information Ratio", "-0.391"},
{"Tracking Error", "0.239"},
{"Treynor Ratio", "-1.435"},
{"Total Fees", "$755.29"},
{"Estimated Strategy Capacity", "$1100000000.00"},
{"Information Ratio", "-0.393"},
{"Tracking Error", "0.238"},
{"Treynor Ratio", "-1.72"},
{"Total Fees", "$796.82"},
{"Estimated Strategy Capacity", "$1000000000.00"},
{"Fitness Score", "0.024"},
{"Kelly Criterion Estimate", "-0.84"},
{"Kelly Criterion Probability Value", "0.53"},
{"Sortino Ratio", "-0.224"},
{"Kelly Criterion Estimate", "-0.9"},
{"Kelly Criterion Probability Value", "0.532"},
{"Sortino Ratio", "-0.228"},
{"Return Over Maximum Drawdown", "-0.058"},
{"Portfolio Turnover", "0.05"},
{"Total Insights Generated", "85"},
@@ -159,14 +159,14 @@ namespace QuantConnect.Algorithm.CSharp
{"Long Insight Count", "42"},
{"Short Insight Count", "43"},
{"Long/Short Ratio", "97.67%"},
{"Estimated Monthly Alpha Value", "$-617339.2"},
{"Total Accumulated Estimated Alpha Value", "$-82686580"},
{"Mean Population Estimated Insight Value", "$-972783.3"},
{"Estimated Monthly Alpha Value", "$-579527.4"},
{"Total Accumulated Estimated Alpha Value", "$-77622060"},
{"Mean Population Estimated Insight Value", "$-913200.7"},
{"Mean Population Direction", "51.7647%"},
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "48.2217%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "95f34359f25a7a7a2725f0343a75a105"}
{"OrderListHash", "177fb7f308a252864365442a30dd9eeb"}
};
}
}

View File

@@ -82,29 +82,29 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "1"},
{"Average Win", "0%"},
{"Average Loss", "0%"},
{"Compounding Annual Return", "264.819%"},
{"Compounding Annual Return", "272.157%"},
{"Drawdown", "2.200%"},
{"Expectancy", "0"},
{"Net Profit", "1.668%"},
{"Sharpe Ratio", "8.749"},
{"Probabilistic Sharpe Ratio", "67.311%"},
{"Net Profit", "1.694%"},
{"Sharpe Ratio", "8.897"},
{"Probabilistic Sharpe Ratio", "67.609%"},
{"Loss Rate", "0%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "1.119"},
{"Alpha", "1.178"},
{"Beta", "0.805"},
{"Annual Standard Deviation", "0.219"},
{"Annual Variance", "0.048"},
{"Information Ratio", "5.494"},
{"Tracking Error", "0.168"},
{"Treynor Ratio", "2.38"},
{"Total Fees", "$3.26"},
{"Estimated Strategy Capacity", "$300000000.00"},
{"Fitness Score", "0.245"},
{"Annual Standard Deviation", "0.222"},
{"Annual Variance", "0.049"},
{"Information Ratio", "5.718"},
{"Tracking Error", "0.172"},
{"Treynor Ratio", "2.453"},
{"Total Fees", "$3.45"},
{"Estimated Strategy Capacity", "$270000000.00"},
{"Fitness Score", "0.246"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "9.606"},
{"Return Over Maximum Drawdown", "105.85"},
{"Sortino Ratio", "9.761"},
{"Return Over Maximum Drawdown", "107.509"},
{"Portfolio Turnover", "0.249"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
@@ -119,7 +119,7 @@ namespace QuantConnect.Algorithm.CSharp
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "9cd604d2c1e3c273697e2ff2cc7faef1"}
{"OrderListHash", "e10039d74166b161f3ea2851a5e85843"}
};
}
}

View File

@@ -74,7 +74,11 @@ namespace QuantConnect.Algorithm.CSharp
public override HasSufficientBuyingPowerForOrderResult HasSufficientBuyingPowerForOrder(
HasSufficientBuyingPowerForOrderParameters parameters)
{
return new HasSufficientBuyingPowerForOrderResult(true);
// if portfolio doesn't have enough buying power:
// parameters.Insufficient()
// this model never allows a lack of funds get in the way of buying securities
return parameters.Sufficient();
}
}
@@ -96,30 +100,30 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "1"},
{"Average Win", "0%"},
{"Average Loss", "0%"},
{"Compounding Annual Return", "5672.520%"},
{"Drawdown", "22.500%"},
{"Compounding Annual Return", "4775.196%"},
{"Drawdown", "21.600%"},
{"Expectancy", "0"},
{"Net Profit", "40.601%"},
{"Sharpe Ratio", "40.201"},
{"Probabilistic Sharpe Ratio", "77.339%"},
{"Net Profit", "38.619%"},
{"Sharpe Ratio", "33.779"},
{"Probabilistic Sharpe Ratio", "77.029%"},
{"Loss Rate", "0%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "41.848"},
{"Beta", "9.224"},
{"Annual Standard Deviation", "1.164"},
{"Annual Variance", "1.355"},
{"Information Ratio", "44.459"},
{"Tracking Error", "1.04"},
{"Treynor Ratio", "5.073"},
{"Alpha", "32.812"},
{"Beta", "8.756"},
{"Annual Standard Deviation", "1.11"},
{"Annual Variance", "1.231"},
{"Information Ratio", "37.501"},
{"Tracking Error", "0.985"},
{"Treynor Ratio", "4.281"},
{"Total Fees", "$30.00"},
{"Estimated Strategy Capacity", "$20000000.00"},
{"Fitness Score", "0.418"},
{"Estimated Strategy Capacity", "$19000000.00"},
{"Fitness Score", "0.395"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "113.05"},
{"Return Over Maximum Drawdown", "442.81"},
{"Portfolio Turnover", "0.418"},
{"Sortino Ratio", "98.148"},
{"Return Over Maximum Drawdown", "384.626"},
{"Portfolio Turnover", "0.395"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
{"Total Insights Analysis Completed", "0"},
@@ -133,7 +137,7 @@ namespace QuantConnect.Algorithm.CSharp
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "b88362c462e9ab2942cbcb8dfddc6ce0"}
{"OrderListHash", "3df007afa8125770e8f1a49263af90a2"}
};
}
}

View File

@@ -112,12 +112,12 @@ namespace QuantConnect.Algorithm.CSharp
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "-0.273"},
{"Beta", "0.045"},
{"Beta", "0.047"},
{"Annual Standard Deviation", "0.057"},
{"Annual Variance", "0.003"},
{"Information Ratio", "-1.537"},
{"Information Ratio", "-1.581"},
{"Tracking Error", "0.112"},
{"Treynor Ratio", "-6.121"},
{"Treynor Ratio", "-5.872"},
{"Total Fees", "$3.50"},
{"Estimated Strategy Capacity", "$48000000.00"},
{"Fitness Score", "0"},

View File

@@ -117,12 +117,12 @@ namespace QuantConnect.Algorithm.CSharp
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "-0.273"},
{"Beta", "0.045"},
{"Beta", "0.047"},
{"Annual Standard Deviation", "0.057"},
{"Annual Variance", "0.003"},
{"Information Ratio", "-1.537"},
{"Information Ratio", "-1.581"},
{"Tracking Error", "0.112"},
{"Treynor Ratio", "-6.121"},
{"Treynor Ratio", "-5.872"},
{"Total Fees", "$3.50"},
{"Estimated Strategy Capacity", "$48000000.00"},
{"Fitness Score", "0"},

View File

@@ -124,12 +124,12 @@ namespace QuantConnect.Algorithm.CSharp
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0.079"},
{"Beta", "0.099"},
{"Beta", "0.095"},
{"Annual Standard Deviation", "0.079"},
{"Annual Variance", "0.006"},
{"Information Ratio", "-6.058"},
{"Tracking Error", "0.19"},
{"Treynor Ratio", "2.159"},
{"Information Ratio", "-6.162"},
{"Tracking Error", "0.192"},
{"Treynor Ratio", "2.232"},
{"Total Fees", "$1.00"},
{"Estimated Strategy Capacity", "$58000000.00"},
{"Fitness Score", "0.1"},

View File

@@ -124,12 +124,12 @@ namespace QuantConnect.Algorithm.CSharp
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "1.736"},
{"Beta", "0.136"},
{"Beta", "0.142"},
{"Annual Standard Deviation", "0.84"},
{"Annual Variance", "0.706"},
{"Information Ratio", "1.925"},
{"Tracking Error", "0.846"},
{"Treynor Ratio", "12.904"},
{"Treynor Ratio", "12.334"},
{"Total Fees", "$0.00"},
{"Estimated Strategy Capacity", "$0"},
{"Fitness Score", "0"},

View File

@@ -94,12 +94,12 @@ namespace QuantConnect.Algorithm.CSharp
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "1.736"},
{"Beta", "0.136"},
{"Beta", "0.142"},
{"Annual Standard Deviation", "0.84"},
{"Annual Variance", "0.706"},
{"Information Ratio", "1.925"},
{"Tracking Error", "0.846"},
{"Treynor Ratio", "12.903"},
{"Treynor Ratio", "12.333"},
{"Total Fees", "$0.00"},
{"Estimated Strategy Capacity", "$0"},
{"Fitness Score", "0"},

View File

@@ -133,13 +133,13 @@ namespace QuantConnect.Algorithm.CSharp
{"Loss Rate", "0%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "-0.898"},
{"Beta", "-7.027"},
{"Alpha", "-0.909"},
{"Beta", "-5.676"},
{"Annual Standard Deviation", "0.651"},
{"Annual Variance", "0.424"},
{"Information Ratio", "-1.396"},
{"Tracking Error", "0.726"},
{"Treynor Ratio", "0.142"},
{"Information Ratio", "-1.362"},
{"Tracking Error", "0.745"},
{"Treynor Ratio", "0.176"},
{"Total Fees", "$0.00"},
{"Estimated Strategy Capacity", "$0"},
{"Fitness Score", "0.127"},

View File

@@ -193,31 +193,31 @@ namespace QuantConnect.Algorithm.CSharp
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
{
{"Total Trades", "62"},
{"Average Win", "0.10%"},
{"Average Win", "0.11%"},
{"Average Loss", "-0.06%"},
{"Compounding Annual Return", "-7.727%"},
{"Compounding Annual Return", "-7.236%"},
{"Drawdown", "2.400%"},
{"Expectancy", "-0.197"},
{"Net Profit", "-0.673%"},
{"Sharpe Ratio", "-1.565"},
{"Probabilistic Sharpe Ratio", "22.763%"},
{"Expectancy", "-0.187"},
{"Net Profit", "-0.629%"},
{"Sharpe Ratio", "-1.475"},
{"Probabilistic Sharpe Ratio", "23.597%"},
{"Loss Rate", "70%"},
{"Win Rate", "30%"},
{"Profit-Loss Ratio", "1.70"},
{"Alpha", "-0.14"},
{"Beta", "0.124"},
{"Profit-Loss Ratio", "1.73"},
{"Alpha", "-0.136"},
{"Beta", "0.126"},
{"Annual Standard Deviation", "0.047"},
{"Annual Variance", "0.002"},
{"Information Ratio", "-5.163"},
{"Information Ratio", "-5.094"},
{"Tracking Error", "0.118"},
{"Treynor Ratio", "-0.591"},
{"Total Fees", "$62.24"},
{"Estimated Strategy Capacity", "$49000000.00"},
{"Fitness Score", "0.147"},
{"Treynor Ratio", "-0.547"},
{"Total Fees", "$62.25"},
{"Estimated Strategy Capacity", "$45000000.00"},
{"Fitness Score", "0.16"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "-2.792"},
{"Return Over Maximum Drawdown", "-3.569"},
{"Sortino Ratio", "-2.59"},
{"Return Over Maximum Drawdown", "-3.337"},
{"Portfolio Turnover", "2.562"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
@@ -232,7 +232,7 @@ namespace QuantConnect.Algorithm.CSharp
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "71c17655bd0731eb25433727526e95ba"}
{"OrderListHash", "1118fb362bfe261323a6b496d50bddde"}
};
}
}

View File

@@ -86,29 +86,29 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "1"},
{"Average Win", "0%"},
{"Average Loss", "0%"},
{"Compounding Annual Return", "241.885%"},
{"Drawdown", "1.100%"},
{"Compounding Annual Return", "240.939%"},
{"Drawdown", "1.200%"},
{"Expectancy", "0"},
{"Net Profit", "1.698%"},
{"Sharpe Ratio", "7.17"},
{"Probabilistic Sharpe Ratio", "68.718%"},
{"Net Profit", "1.694%"},
{"Sharpe Ratio", "6.988"},
{"Probabilistic Sharpe Ratio", "68.188%"},
{"Loss Rate", "0%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "1.171"},
{"Beta", "0.147"},
{"Annual Standard Deviation", "0.191"},
{"Annual Variance", "0.037"},
{"Information Ratio", "0.035"},
{"Tracking Error", "0.251"},
{"Treynor Ratio", "9.323"},
{"Total Fees", "$3.26"},
{"Estimated Strategy Capacity", "$890000000.00"},
{"Alpha", "1.172"},
{"Beta", "0.14"},
{"Annual Standard Deviation", "0.196"},
{"Annual Variance", "0.038"},
{"Information Ratio", "-0.118"},
{"Tracking Error", "0.256"},
{"Treynor Ratio", "9.783"},
{"Total Fees", "$3.45"},
{"Estimated Strategy Capacity", "$840000000.00"},
{"Fitness Score", "0.201"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "79228162514264337593543950335"},
{"Return Over Maximum Drawdown", "211.158"},
{"Return Over Maximum Drawdown", "204.701"},
{"Portfolio Turnover", "0.201"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
@@ -123,7 +123,7 @@ namespace QuantConnect.Algorithm.CSharp
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "82fee25cd17100c53bb173834ab5f0b2"}
{"OrderListHash", "33d01821923c397f999cfb2e5b5928ad"}
};
}
}

View File

@@ -189,8 +189,8 @@ namespace QuantConnect.Algorithm.CSharp
{"Beta", "0"},
{"Annual Standard Deviation", "0"},
{"Annual Variance", "0"},
{"Information Ratio", "-2.53"},
{"Tracking Error", "0.211"},
{"Information Ratio", "-2.564"},
{"Tracking Error", "0.214"},
{"Treynor Ratio", "0"},
{"Total Fees", "$0.00"},
{"Estimated Strategy Capacity", "$0"},

View File

@@ -114,8 +114,8 @@ namespace QuantConnect.Algorithm.CSharp
{"Beta", "0"},
{"Annual Standard Deviation", "0"},
{"Annual Variance", "0"},
{"Information Ratio", "-0.084"},
{"Tracking Error", "0.183"},
{"Information Ratio", "-0.098"},
{"Tracking Error", "0.179"},
{"Treynor Ratio", "0"},
{"Total Fees", "$0.00"},
{"Estimated Strategy Capacity", "$0"},

View File

@@ -114,8 +114,8 @@ namespace QuantConnect.Algorithm.CSharp
{"Beta", "0"},
{"Annual Standard Deviation", "0"},
{"Annual Variance", "0"},
{"Information Ratio", "-0.096"},
{"Tracking Error", "0.212"},
{"Information Ratio", "-0.111"},
{"Tracking Error", "0.207"},
{"Treynor Ratio", "0"},
{"Total Fees", "$0.00"},
{"Estimated Strategy Capacity", "$0"},

View File

@@ -106,12 +106,12 @@ namespace QuantConnect.Algorithm.CSharp
{"Win Rate", "100%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0.006"},
{"Beta", "0.158"},
{"Beta", "0.157"},
{"Annual Standard Deviation", "0.033"},
{"Annual Variance", "0.001"},
{"Information Ratio", "-4.942"},
{"Tracking Error", "0.08"},
{"Treynor Ratio", "0.517"},
{"Information Ratio", "-4.901"},
{"Tracking Error", "0.081"},
{"Treynor Ratio", "0.519"},
{"Total Fees", "$3.70"},
{"Estimated Strategy Capacity", "$270000000.00"},
{"Fitness Score", "0.019"},

View File

@@ -119,9 +119,9 @@ namespace QuantConnect.Algorithm.CSharp
{"Beta", "-0.001"},
{"Annual Standard Deviation", "0.001"},
{"Annual Variance", "0"},
{"Information Ratio", "-1.187"},
{"Tracking Error", "0.115"},
{"Treynor Ratio", "1.545"},
{"Information Ratio", "-1.182"},
{"Tracking Error", "0.117"},
{"Treynor Ratio", "1.617"},
{"Total Fees", "$37.00"},
{"Estimated Strategy Capacity", "$400000.00"},
{"Fitness Score", "0"},

View File

@@ -167,31 +167,31 @@ namespace QuantConnect.Algorithm.CSharp
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
{
{"Total Trades", "7"},
{"Average Win", "19.16%"},
{"Average Win", "19.18%"},
{"Average Loss", "0%"},
{"Compounding Annual Return", "16.727%"},
{"Drawdown", "12.200%"},
{"Compounding Annual Return", "16.740%"},
{"Drawdown", "12.400%"},
{"Expectancy", "0"},
{"Net Profit", "153.058%"},
{"Sharpe Ratio", "1.239"},
{"Probabilistic Sharpe Ratio", "66.414%"},
{"Net Profit", "153.224%"},
{"Sharpe Ratio", "1.233"},
{"Probabilistic Sharpe Ratio", "65.906%"},
{"Loss Rate", "0%"},
{"Win Rate", "100%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0.146"},
{"Beta", "-0.018"},
{"Annual Standard Deviation", "0.116"},
{"Annual Variance", "0.013"},
{"Information Ratio", "-0.053"},
{"Beta", "-0.016"},
{"Annual Standard Deviation", "0.117"},
{"Annual Variance", "0.014"},
{"Information Ratio", "-0.052"},
{"Tracking Error", "0.204"},
{"Treynor Ratio", "-8.165"},
{"Total Fees", "$46.75"},
{"Estimated Strategy Capacity", "$670000000.00"},
{"Treynor Ratio", "-8.847"},
{"Total Fees", "$49.43"},
{"Estimated Strategy Capacity", "$630000000.00"},
{"Fitness Score", "0.002"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "1.607"},
{"Return Over Maximum Drawdown", "1.366"},
{"Sortino Ratio", "1.609"},
{"Return Over Maximum Drawdown", "1.351"},
{"Portfolio Turnover", "0.003"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
@@ -206,7 +206,7 @@ namespace QuantConnect.Algorithm.CSharp
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "7c4fcd79dd817a9cd3bf44525eaed96c"}
{"OrderListHash", "44481c3d7eeb5acd5e3bccfec501a132"}
};
}
}

View File

@@ -187,30 +187,30 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "6441"},
{"Average Win", "0.07%"},
{"Average Loss", "-0.07%"},
{"Compounding Annual Return", "13.331%"},
{"Compounding Annual Return", "13.366%"},
{"Drawdown", "10.700%"},
{"Expectancy", "0.061"},
{"Net Profit", "13.331%"},
{"Sharpe Ratio", "0.963"},
{"Probabilistic Sharpe Ratio", "46.232%"},
{"Expectancy", "0.062"},
{"Net Profit", "13.366%"},
{"Sharpe Ratio", "0.966"},
{"Probabilistic Sharpe Ratio", "46.330%"},
{"Loss Rate", "46%"},
{"Win Rate", "54%"},
{"Profit-Loss Ratio", "0.97"},
{"Alpha", "0.124"},
{"Beta", "-0.066"},
{"Alpha", "0.125"},
{"Beta", "-0.067"},
{"Annual Standard Deviation", "0.121"},
{"Annual Variance", "0.015"},
{"Information Ratio", "0.006"},
{"Information Ratio", "-0.021"},
{"Tracking Error", "0.171"},
{"Treynor Ratio", "-1.761"},
{"Total Fees", "$8669.41"},
{"Treynor Ratio", "-1.747"},
{"Total Fees", "$8669.28"},
{"Estimated Strategy Capacity", "$320000.00"},
{"Fitness Score", "0.675"},
{"Fitness Score", "0.676"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "1.127"},
{"Return Over Maximum Drawdown", "1.246"},
{"Portfolio Turnover", "1.64"},
{"Sortino Ratio", "1.13"},
{"Return Over Maximum Drawdown", "1.251"},
{"Portfolio Turnover", "1.639"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
{"Total Insights Analysis Completed", "0"},
@@ -224,7 +224,7 @@ namespace QuantConnect.Algorithm.CSharp
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "0b6746b5759ecd45ab21360fd40858bb"}
{"OrderListHash", "a5b4f8473c39a7e9d62659fa9f6a4e2f"}
};
}
}

View File

@@ -160,30 +160,30 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "5059"},
{"Average Win", "0.08%"},
{"Average Loss", "-0.08%"},
{"Compounding Annual Return", "14.950%"},
{"Compounding Annual Return", "14.983%"},
{"Drawdown", "10.600%"},
{"Expectancy", "0.075"},
{"Net Profit", "14.950%"},
{"Sharpe Ratio", "1.072"},
{"Probabilistic Sharpe Ratio", "50.327%"},
{"Loss Rate", "45%"},
{"Win Rate", "55%"},
{"Net Profit", "14.983%"},
{"Sharpe Ratio", "1.075"},
{"Probabilistic Sharpe Ratio", "50.443%"},
{"Loss Rate", "46%"},
{"Win Rate", "54%"},
{"Profit-Loss Ratio", "0.97"},
{"Alpha", "0.137"},
{"Beta", "-0.066"},
{"Alpha", "0.138"},
{"Beta", "-0.067"},
{"Annual Standard Deviation", "0.121"},
{"Annual Variance", "0.015"},
{"Information Ratio", "0.083"},
{"Information Ratio", "0.056"},
{"Tracking Error", "0.171"},
{"Treynor Ratio", "-1.971"},
{"Total Fees", "$6806.67"},
{"Treynor Ratio", "-1.948"},
{"Total Fees", "$6806.62"},
{"Estimated Strategy Capacity", "$320000.00"},
{"Fitness Score", "0.694"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "1.265"},
{"Return Over Maximum Drawdown", "1.409"},
{"Portfolio Turnover", "1.296"},
{"Sortino Ratio", "1.268"},
{"Return Over Maximum Drawdown", "1.411"},
{"Portfolio Turnover", "1.295"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
{"Total Insights Analysis Completed", "0"},
@@ -197,7 +197,7 @@ namespace QuantConnect.Algorithm.CSharp
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "a7a893a17a5afa7c2f73a444a7aea507"}
{"OrderListHash", "5e8e2426162c22b45935db2175c4bbfd"}
};
}
}

View File

@@ -106,8 +106,8 @@ namespace QuantConnect.Algorithm.CSharp
{"Beta", "0"},
{"Annual Standard Deviation", "0"},
{"Annual Variance", "0"},
{"Information Ratio", "-7.068"},
{"Tracking Error", "0.193"},
{"Information Ratio", "-7.163"},
{"Tracking Error", "0.195"},
{"Treynor Ratio", "0"},
{"Total Fees", "$0.00"},
{"Estimated Strategy Capacity", "$0"},

View File

@@ -114,30 +114,30 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "5"},
{"Average Win", "0%"},
{"Average Loss", "-0.02%"},
{"Compounding Annual Return", "-72.415%"},
{"Drawdown", "2.800%"},
{"Compounding Annual Return", "-72.266%"},
{"Drawdown", "2.900%"},
{"Expectancy", "-1"},
{"Net Profit", "-1.749%"},
{"Sharpe Ratio", "-3.059"},
{"Probabilistic Sharpe Ratio", "21.811%"},
{"Net Profit", "-1.742%"},
{"Sharpe Ratio", "-2.983"},
{"Probabilistic Sharpe Ratio", "22.301%"},
{"Loss Rate", "100%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "-0.385"},
{"Beta", "-0.146"},
{"Annual Standard Deviation", "0.191"},
{"Annual Variance", "0.036"},
{"Information Ratio", "-6.701"},
{"Tracking Error", "0.29"},
{"Treynor Ratio", "4.005"},
{"Total Fees", "$18.28"},
{"Estimated Strategy Capacity", "$500000000.00"},
{"Fitness Score", "0.052"},
{"Alpha", "-0.388"},
{"Beta", "-0.138"},
{"Annual Standard Deviation", "0.195"},
{"Annual Variance", "0.038"},
{"Information Ratio", "-6.727"},
{"Tracking Error", "0.294"},
{"Treynor Ratio", "4.204"},
{"Total Fees", "$19.23"},
{"Estimated Strategy Capacity", "$470000000.00"},
{"Fitness Score", "0.054"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "-4.187"},
{"Return Over Maximum Drawdown", "-25.473"},
{"Portfolio Turnover", "0.998"},
{"Sortino Ratio", "-4.06"},
{"Return Over Maximum Drawdown", "-25.225"},
{"Portfolio Turnover", "0.999"},
{"Total Insights Generated", "1"},
{"Total Insights Closed", "0"},
{"Total Insights Analysis Completed", "0"},
@@ -151,7 +151,7 @@ namespace QuantConnect.Algorithm.CSharp
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "17245c38f1b192d2041ca1f3e88250be"}
{"OrderListHash", "39c512346541c1d40c04a514d605b723"}
};
}
}

View File

@@ -108,46 +108,46 @@ namespace QuantConnect.Algorithm.CSharp
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
{
{"Total Trades", "4"},
{"Average Win", "0.96%"},
{"Average Loss", "-0.95%"},
{"Compounding Annual Return", "-44.357%"},
{"Drawdown", "1.100%"},
{"Expectancy", "0.005"},
{"Net Profit", "-0.800%"},
{"Sharpe Ratio", "-2.218"},
{"Probabilistic Sharpe Ratio", "32.508%"},
{"Average Win", "0.94%"},
{"Average Loss", "-0.98%"},
{"Compounding Annual Return", "-47.257%"},
{"Drawdown", "1.200%"},
{"Expectancy", "-0.021"},
{"Net Profit", "-0.873%"},
{"Sharpe Ratio", "-2.308"},
{"Probabilistic Sharpe Ratio", "31.792%"},
{"Loss Rate", "50%"},
{"Win Rate", "50%"},
{"Profit-Loss Ratio", "1.01"},
{"Alpha", "-0.64"},
{"Beta", "0.23"},
{"Annual Standard Deviation", "0.147"},
{"Annual Variance", "0.022"},
{"Information Ratio", "-8.259"},
{"Tracking Error", "0.204"},
{"Treynor Ratio", "-1.424"},
{"Total Fees", "$16.26"},
{"Estimated Strategy Capacity", "$590000000.00"},
{"Fitness Score", "0.003"},
{"Kelly Criterion Estimate", "12.539"},
{"Kelly Criterion Probability Value", "0.367"},
{"Sortino Ratio", "-22.336"},
{"Return Over Maximum Drawdown", "-38.722"},
{"Portfolio Turnover", "1.003"},
{"Profit-Loss Ratio", "0.96"},
{"Alpha", "-0.675"},
{"Beta", "0.232"},
{"Annual Standard Deviation", "0.152"},
{"Annual Variance", "0.023"},
{"Information Ratio", "-8.38"},
{"Tracking Error", "0.209"},
{"Treynor Ratio", "-1.514"},
{"Total Fees", "$17.19"},
{"Estimated Strategy Capacity", "$560000000.00"},
{"Fitness Score", "0.002"},
{"Kelly Criterion Estimate", "12.812"},
{"Kelly Criterion Probability Value", "0.363"},
{"Sortino Ratio", "-29.284"},
{"Return Over Maximum Drawdown", "-40.149"},
{"Portfolio Turnover", "1.004"},
{"Total Insights Generated", "7"},
{"Total Insights Closed", "4"},
{"Total Insights Analysis Completed", "4"},
{"Long Insight Count", "5"},
{"Short Insight Count", "2"},
{"Long/Short Ratio", "250.0%"},
{"Estimated Monthly Alpha Value", "$19016880.2887"},
{"Total Accumulated Estimated Alpha Value", "$3275129.3830"},
{"Mean Population Estimated Insight Value", "$818782.3458"},
{"Estimated Monthly Alpha Value", "$18576432.8867"},
{"Total Accumulated Estimated Alpha Value", "$3199274.5527"},
{"Mean Population Estimated Insight Value", "$799818.6382"},
{"Mean Population Direction", "50%"},
{"Mean Population Magnitude", "50%"},
{"Rolling Averaged Population Direction", "50%"},
{"Rolling Averaged Population Magnitude", "50%"},
{"OrderListHash", "4178a84209934b1eb6d03c2267654f32"}
{"OrderListHash", "657b9cb12ee7097df61fff5661192ccf"}
};
}
}

View File

@@ -140,13 +140,13 @@ namespace QuantConnect.Algorithm.CSharp
{"Loss Rate", "100%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "-13.685"},
{"Beta", "6.59"},
{"Alpha", "-13.915"},
{"Beta", "6.519"},
{"Annual Standard Deviation", "1.632"},
{"Annual Variance", "2.665"},
{"Information Ratio", "-2.023"},
{"Tracking Error", "1.441"},
{"Treynor Ratio", "-0.15"},
{"Information Ratio", "-2.066"},
{"Tracking Error", "1.438"},
{"Treynor Ratio", "-0.152"},
{"Total Fees", "$33.30"},
{"Estimated Strategy Capacity", "$17000000.00"},
{"Fitness Score", "0.079"},

View File

@@ -99,8 +99,8 @@ namespace QuantConnect.Algorithm.CSharp
{"Beta", "0"},
{"Annual Standard Deviation", "0"},
{"Annual Variance", "0"},
{"Information Ratio", "-8.769"},
{"Tracking Error", "0.22"},
{"Information Ratio", "-8.91"},
{"Tracking Error", "0.223"},
{"Treynor Ratio", "0"},
{"Total Fees", "$6.41"},
{"Estimated Strategy Capacity", "$0"},

View File

@@ -176,13 +176,13 @@ namespace QuantConnect.Algorithm.CSharp
{"Loss Rate", "65%"},
{"Win Rate", "35%"},
{"Profit-Loss Ratio", "1.17"},
{"Alpha", "-1.423"},
{"Beta", "0.537"},
{"Alpha", "-1.43"},
{"Beta", "0.528"},
{"Annual Standard Deviation", "0.134"},
{"Annual Variance", "0.018"},
{"Information Ratio", "-16.652"},
{"Tracking Error", "0.123"},
{"Treynor Ratio", "-1.288"},
{"Information Ratio", "-16.594"},
{"Tracking Error", "0.126"},
{"Treynor Ratio", "-1.311"},
{"Total Fees", "$669.76"},
{"Estimated Strategy Capacity", "$210000.00"},
{"Fitness Score", "0.021"},

View File

@@ -127,33 +127,33 @@ namespace QuantConnect.Algorithm.CSharp
/// </summary>
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
{
{"Total Trades", "20"},
{"Total Trades", "18"},
{"Average Win", "0%"},
{"Average Loss", "0.00%"},
{"Compounding Annual Return", "-74.182%"},
{"Drawdown", "2.200%"},
{"Compounding Annual Return", "-74.117%"},
{"Drawdown", "2.500%"},
{"Expectancy", "-1"},
{"Net Profit", "-1.046%"},
{"Net Profit", "-1.044%"},
{"Sharpe Ratio", "-8.269"},
{"Probabilistic Sharpe Ratio", "0%"},
{"Loss Rate", "100%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "-0.19"},
{"Beta", "0.579"},
{"Alpha", "-0.187"},
{"Beta", "0.584"},
{"Annual Standard Deviation", "0.065"},
{"Annual Variance", "0.004"},
{"Information Ratio", "1.326"},
{"Tracking Error", "0.049"},
{"Treynor Ratio", "-0.934"},
{"Total Fees", "$22.26"},
{"Estimated Strategy Capacity", "$360000.00"},
{"Information Ratio", "1.354"},
{"Tracking Error", "0.048"},
{"Treynor Ratio", "-0.926"},
{"Total Fees", "$20.45"},
{"Estimated Strategy Capacity", "$300000.00"},
{"Fitness Score", "0.002"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "-11.855"},
{"Return Over Maximum Drawdown", "-70.945"},
{"Portfolio Turnover", "0.342"},
{"Sortino Ratio", "-11.829"},
{"Return Over Maximum Drawdown", "-71.014"},
{"Portfolio Turnover", "0.341"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
{"Total Insights Analysis Completed", "0"},
@@ -167,7 +167,7 @@ namespace QuantConnect.Algorithm.CSharp
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "9f381f81ea9939f285b432207fa0d024"}
{"OrderListHash", "fbefbed1d94294a14bc563a71b336056"}
};
}
}

View File

@@ -105,30 +105,30 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "4"},
{"Average Win", "0%"},
{"Average Loss", "0%"},
{"Compounding Annual Return", "8.332%"},
{"Compounding Annual Return", "7.848%"},
{"Drawdown", "0.100%"},
{"Expectancy", "0"},
{"Net Profit", "0.106%"},
{"Sharpe Ratio", "7.474"},
{"Probabilistic Sharpe Ratio", "85.145%"},
{"Net Profit", "0.100%"},
{"Sharpe Ratio", "7.449"},
{"Probabilistic Sharpe Ratio", "85.066%"},
{"Loss Rate", "0%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0.007"},
{"Beta", "0.036"},
{"Alpha", "0.006"},
{"Beta", "0.033"},
{"Annual Standard Deviation", "0.007"},
{"Annual Variance", "0"},
{"Information Ratio", "-7.03"},
{"Tracking Error", "0.186"},
{"Treynor Ratio", "1.557"},
{"Information Ratio", "-7.131"},
{"Tracking Error", "0.189"},
{"Treynor Ratio", "1.576"},
{"Total Fees", "$4.00"},
{"Estimated Strategy Capacity", "$5200000.00"},
{"Fitness Score", "0.012"},
{"Fitness Score", "0.011"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "38.663"},
{"Return Over Maximum Drawdown", "238.773"},
{"Portfolio Turnover", "0.012"},
{"Sortino Ratio", "38.493"},
{"Return Over Maximum Drawdown", "236.57"},
{"Portfolio Turnover", "0.011"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
{"Total Insights Analysis Completed", "0"},
@@ -142,7 +142,7 @@ namespace QuantConnect.Algorithm.CSharp
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "ee79a87e6a386f5ee620d77b7bfbd964"}
{"OrderListHash", "65e705bf0e78139c376903d4ff241afc"}
};
}
}

View File

@@ -97,13 +97,13 @@ namespace QuantConnect.Algorithm.CSharp
{"Loss Rate", "0%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "2.211"},
{"Beta", "-0.467"},
{"Alpha", "2.206"},
{"Beta", "-0.473"},
{"Annual Standard Deviation", "0.166"},
{"Annual Variance", "0.028"},
{"Information Ratio", "7.778"},
{"Tracking Error", "0.394"},
{"Treynor Ratio", "-5.313"},
{"Information Ratio", "7.853"},
{"Tracking Error", "0.391"},
{"Treynor Ratio", "-5.253"},
{"Total Fees", "$5.40"},
{"Estimated Strategy Capacity", "$230000000.00"},
{"Fitness Score", "0.244"},

View File

@@ -149,8 +149,8 @@ namespace QuantConnect.Algorithm.CSharp
{"Beta", "0"},
{"Annual Standard Deviation", "0"},
{"Annual Variance", "0"},
{"Information Ratio", "5.853"},
{"Tracking Error", "0.107"},
{"Information Ratio", "5.865"},
{"Tracking Error", "0.106"},
{"Treynor Ratio", "0"},
{"Total Fees", "$0.00"},
{"Estimated Strategy Capacity", "$0"},

View File

@@ -153,8 +153,8 @@ namespace QuantConnect.Algorithm.CSharp
{"Beta", "0"},
{"Annual Standard Deviation", "0"},
{"Annual Variance", "0"},
{"Information Ratio", "5.853"},
{"Tracking Error", "0.107"},
{"Information Ratio", "5.865"},
{"Tracking Error", "0.106"},
{"Treynor Ratio", "0"},
{"Total Fees", "$0.00"},
{"Estimated Strategy Capacity", "$0"},

View File

@@ -79,31 +79,31 @@ namespace QuantConnect.Algorithm.CSharp
/// </summary>
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
{
{"Total Trades", "2"},
{"Total Trades", "3"},
{"Average Win", "0%"},
{"Average Loss", "0.00%"},
{"Compounding Annual Return", "8.172%"},
{"Drawdown", "55.100%"},
{"Compounding Annual Return", "8.171%"},
{"Drawdown", "55.000%"},
{"Expectancy", "-1"},
{"Net Profit", "125.433%"},
{"Sharpe Ratio", "0.468"},
{"Probabilistic Sharpe Ratio", "2.573%"},
{"Net Profit", "125.419%"},
{"Sharpe Ratio", "0.469"},
{"Probabilistic Sharpe Ratio", "2.603%"},
{"Loss Rate", "100%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0.093"},
{"Beta", "-0.099"},
{"Annual Standard Deviation", "0.18"},
{"Alpha", "0.092"},
{"Beta", "-0.091"},
{"Annual Standard Deviation", "0.179"},
{"Annual Variance", "0.032"},
{"Information Ratio", "-0.001"},
{"Tracking Error", "0.267"},
{"Treynor Ratio", "-0.847"},
{"Total Fees", "$41.17"},
{"Estimated Strategy Capacity", "$340000000.00"},
{"Tracking Error", "0.265"},
{"Treynor Ratio", "-0.927"},
{"Total Fees", "$44.46"},
{"Estimated Strategy Capacity", "$1000000000.00"},
{"Fitness Score", "0"},
{"Kelly Criterion Estimate", "38.884"},
{"Kelly Criterion Probability Value", "0.009"},
{"Sortino Ratio", "0.501"},
{"Kelly Criterion Estimate", "37.332"},
{"Kelly Criterion Probability Value", "0.01"},
{"Sortino Ratio", "0.505"},
{"Return Over Maximum Drawdown", "0.148"},
{"Portfolio Turnover", "0"},
{"Total Insights Generated", "2604"},
@@ -112,14 +112,14 @@ namespace QuantConnect.Algorithm.CSharp
{"Long Insight Count", "2604"},
{"Short Insight Count", "0"},
{"Long/Short Ratio", "100%"},
{"Estimated Monthly Alpha Value", "$1176372.2118"},
{"Total Accumulated Estimated Alpha Value", "$148113430.7231"},
{"Mean Population Estimated Insight Value", "$56901.0491"},
{"Mean Population Direction", "43.2962%"},
{"Mean Population Magnitude", "43.2962%"},
{"Rolling Averaged Population Direction", "48.763%"},
{"Rolling Averaged Population Magnitude", "48.763%"},
{"OrderListHash", "0ae9067022a716a31e7bc1cd6dbc3746"}
{"Estimated Monthly Alpha Value", "$1128748.4737"},
{"Total Accumulated Estimated Alpha Value", "$142117271.3667"},
{"Mean Population Estimated Insight Value", "$54597.4919"},
{"Mean Population Direction", "43.4499%"},
{"Mean Population Magnitude", "43.4499%"},
{"Rolling Averaged Population Direction", "48.5717%"},
{"Rolling Averaged Population Magnitude", "48.5717%"},
{"OrderListHash", "03cc0ad5b1c4b7803b2e9483da1d7543"}
};
}
}

View File

@@ -121,30 +121,30 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "6"},
{"Average Win", "2.93%"},
{"Average Loss", "-4.15%"},
{"Compounding Annual Return", "-6.023%"},
{"Compounding Annual Return", "-5.673%"},
{"Drawdown", "5.700%"},
{"Expectancy", "-0.148"},
{"Net Profit", "-2.802%"},
{"Sharpe Ratio", "-0.501"},
{"Probabilistic Sharpe Ratio", "10.679%"},
{"Sharpe Ratio", "-0.49"},
{"Probabilistic Sharpe Ratio", "10.317%"},
{"Loss Rate", "50%"},
{"Win Rate", "50%"},
{"Profit-Loss Ratio", "0.70"},
{"Alpha", "-0.045"},
{"Beta", "-0.001"},
{"Annual Standard Deviation", "0.089"},
{"Annual Variance", "0.008"},
{"Information Ratio", "0.966"},
{"Tracking Error", "0.195"},
{"Treynor Ratio", "55.977"},
{"Alpha", "-0.042"},
{"Beta", "-0.012"},
{"Annual Standard Deviation", "0.087"},
{"Annual Variance", "0.007"},
{"Information Ratio", "-0.162"},
{"Tracking Error", "0.418"},
{"Treynor Ratio", "3.493"},
{"Total Fees", "$14.80"},
{"Estimated Strategy Capacity", "$15000000.00"},
{"Fitness Score", "0.018"},
{"Fitness Score", "0.017"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "-0.103"},
{"Return Over Maximum Drawdown", "-1.063"},
{"Portfolio Turnover", "0.045"},
{"Sortino Ratio", "-0.097"},
{"Return Over Maximum Drawdown", "-1.002"},
{"Portfolio Turnover", "0.043"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
{"Total Insights Analysis Completed", "0"},

View File

@@ -205,30 +205,30 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "3"},
{"Average Win", "1.22%"},
{"Average Loss", "-7.42%"},
{"Compounding Annual Return", "-13.222%"},
{"Compounding Annual Return", "-12.482%"},
{"Drawdown", "6.300%"},
{"Expectancy", "-0.417"},
{"Net Profit", "-6.282%"},
{"Sharpe Ratio", "-1.345"},
{"Probabilistic Sharpe Ratio", "0.005%"},
{"Sharpe Ratio", "-1.316"},
{"Probabilistic Sharpe Ratio", "0.004%"},
{"Loss Rate", "50%"},
{"Win Rate", "50%"},
{"Profit-Loss Ratio", "0.17"},
{"Alpha", "-0.105"},
{"Beta", "-0.003"},
{"Annual Standard Deviation", "0.078"},
{"Alpha", "-0.1"},
{"Beta", "0.004"},
{"Annual Standard Deviation", "0.076"},
{"Annual Variance", "0.006"},
{"Information Ratio", "0.678"},
{"Tracking Error", "0.191"},
{"Treynor Ratio", "33.18"},
{"Information Ratio", "-0.305"},
{"Tracking Error", "0.411"},
{"Treynor Ratio", "-27.616"},
{"Total Fees", "$7.40"},
{"Estimated Strategy Capacity", "$9000000.00"},
{"Fitness Score", "0.008"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "-0.217"},
{"Return Over Maximum Drawdown", "-2.105"},
{"Portfolio Turnover", "0.024"},
{"Sortino Ratio", "-0.205"},
{"Return Over Maximum Drawdown", "-1.989"},
{"Portfolio Turnover", "0.023"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
{"Total Insights Analysis Completed", "0"},

View File

@@ -33,7 +33,7 @@ namespace QuantConnect.Algorithm.CSharp
{
private bool _invested;
private int _onDataCalls;
private Symbol _es19m20;
private Security _es19m20;
private Option _esOption;
private Symbol _expectedOptionContract;
@@ -47,10 +47,17 @@ namespace QuantConnect.Algorithm.CSharp
Futures.Indices.SP500EMini,
Market.CME,
new DateTime(2020, 6, 19)),
Resolution.Minute).Symbol;
Resolution.Minute);
// We must set the volatility model on the underlying, since the defaults are
// too strict to calculate greeks with when we only have data for a single day
_es19m20.VolatilityModel = new StandardDeviationOfReturnsVolatilityModel(
60,
Resolution.Minute,
TimeSpan.FromMinutes(1));
// Select a future option expiring ITM, and adds it to the algorithm.
_esOption = AddFutureOptionContract(OptionChainProvider.GetOptionContractList(_es19m20, new DateTime(2020, 1, 5))
_esOption = AddFutureOptionContract(OptionChainProvider.GetOptionContractList(_es19m20.Symbol, new DateTime(2020, 1, 5))
.Where(x => x.ID.StrikePrice <= 3200m && x.ID.OptionRight == OptionRight.Call)
.OrderByDescending(x => x.ID.StrikePrice)
.Take(1)
@@ -58,7 +65,7 @@ namespace QuantConnect.Algorithm.CSharp
_esOption.PriceModel = OptionPriceModels.BjerksundStensland();
_expectedOptionContract = QuantConnect.Symbol.CreateOption(_es19m20, Market.CME, OptionStyle.American, OptionRight.Call, 3200m, new DateTime(2020, 6, 19));
_expectedOptionContract = QuantConnect.Symbol.CreateOption(_es19m20.Symbol, Market.CME, OptionStyle.American, OptionRight.Call, 3200m, new DateTime(2020, 6, 19));
if (_esOption.Symbol != _expectedOptionContract)
{
throw new Exception($"Contract {_expectedOptionContract} was not found in the chain");
@@ -105,22 +112,22 @@ namespace QuantConnect.Algorithm.CSharp
{
throw new AggregateException("Option contract Gamma was equal to zero");
}
//if (lambda.Any(l => l == 0))
//{
// throw new AggregateException("Option contract Lambda was equal to zero");
//}
if (lambda.Any(l => l == 0))
{
throw new AggregateException("Option contract Lambda was equal to zero");
}
if (rho.Any(r => r == 0))
{
throw new AggregateException("Option contract Rho was equal to zero");
}
//if (theta.Any(t => t == 0))
//{
// throw new AggregateException("Option contract Theta was equal to zero");
//}
//if (vega.Any(v => v == 0))
//{
// throw new AggregateException("Option contract Vega was equal to zero");
//}
if (theta.Any(t => t == 0))
{
throw new AggregateException("Option contract Theta was equal to zero");
}
if (vega.Any(v => v == 0))
{
throw new AggregateException("Option contract Vega was equal to zero");
}
if (!_invested)
{
@@ -163,30 +170,30 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "3"},
{"Average Win", "27.44%"},
{"Average Loss", "-62.81%"},
{"Compounding Annual Return", "-80.444%"},
{"Compounding Annual Return", "-78.438%"},
{"Drawdown", "52.600%"},
{"Expectancy", "-0.282"},
{"Net Profit", "-52.604%"},
{"Sharpe Ratio", "-0.867"},
{"Probabilistic Sharpe Ratio", "0.021%"},
{"Sharpe Ratio", "-0.862"},
{"Probabilistic Sharpe Ratio", "0.019%"},
{"Loss Rate", "50%"},
{"Win Rate", "50%"},
{"Profit-Loss Ratio", "0.44"},
{"Alpha", "-0.611"},
{"Beta", "-0.033"},
{"Annual Standard Deviation", "0.695"},
{"Annual Variance", "0.484"},
{"Information Ratio", "-0.513"},
{"Tracking Error", "0.718"},
{"Treynor Ratio", "18.473"},
{"Alpha", "-0.586"},
{"Beta", "0.031"},
{"Annual Standard Deviation", "0.679"},
{"Annual Variance", "0.461"},
{"Information Ratio", "-0.779"},
{"Tracking Error", "0.784"},
{"Treynor Ratio", "-18.756"},
{"Total Fees", "$66.60"},
{"Estimated Strategy Capacity", "$8300000.00"},
{"Fitness Score", "0.162"},
{"Fitness Score", "0.156"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "-0.136"},
{"Return Over Maximum Drawdown", "-1.529"},
{"Portfolio Turnover", "0.427"},
{"Sortino Ratio", "-0.133"},
{"Return Over Maximum Drawdown", "-1.491"},
{"Portfolio Turnover", "0.408"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
{"Total Insights Analysis Completed", "0"},

View File

@@ -180,29 +180,29 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "2"},
{"Average Win", "0%"},
{"Average Loss", "-4.03%"},
{"Compounding Annual Return", "-8.595%"},
{"Compounding Annual Return", "-8.103%"},
{"Drawdown", "4.000%"},
{"Expectancy", "-1"},
{"Net Profit", "-4.029%"},
{"Sharpe Ratio", "-1.294"},
{"Probabilistic Sharpe Ratio", "0.017%"},
{"Sharpe Ratio", "-1.266"},
{"Probabilistic Sharpe Ratio", "0.015%"},
{"Loss Rate", "100%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "-0.069"},
{"Beta", "-0.002"},
{"Annual Standard Deviation", "0.053"},
{"Alpha", "-0.065"},
{"Beta", "0.002"},
{"Annual Standard Deviation", "0.051"},
{"Annual Variance", "0.003"},
{"Information Ratio", "0.911"},
{"Tracking Error", "0.182"},
{"Treynor Ratio", "28.46"},
{"Information Ratio", "-0.222"},
{"Tracking Error", "0.408"},
{"Treynor Ratio", "-27.32"},
{"Total Fees", "$3.70"},
{"Estimated Strategy Capacity", "$5800000.00"},
{"Fitness Score", "0"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "-0.195"},
{"Return Over Maximum Drawdown", "-2.134"},
{"Sortino Ratio", "-0.184"},
{"Return Over Maximum Drawdown", "-2.013"},
{"Portfolio Turnover", "0"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},

View File

@@ -206,30 +206,30 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "3"},
{"Average Win", "4.15%"},
{"Average Loss", "-8.27%"},
{"Compounding Annual Return", "-9.486%"},
{"Compounding Annual Return", "-8.944%"},
{"Drawdown", "4.500%"},
{"Expectancy", "-0.249"},
{"Net Profit", "-4.457%"},
{"Sharpe Ratio", "-1.412"},
{"Sharpe Ratio", "-1.381"},
{"Probabilistic Sharpe Ratio", "0.002%"},
{"Loss Rate", "50%"},
{"Win Rate", "50%"},
{"Profit-Loss Ratio", "0.50"},
{"Alpha", "-0.076"},
{"Beta", "-0.002"},
{"Annual Standard Deviation", "0.053"},
{"Alpha", "-0.072"},
{"Beta", "0.003"},
{"Annual Standard Deviation", "0.052"},
{"Annual Variance", "0.003"},
{"Information Ratio", "0.871"},
{"Tracking Error", "0.183"},
{"Treynor Ratio", "37.798"},
{"Information Ratio", "-0.239"},
{"Tracking Error", "0.408"},
{"Treynor Ratio", "-28.523"},
{"Total Fees", "$7.40"},
{"Estimated Strategy Capacity", "$9900000.00"},
{"Fitness Score", "0.008"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "-0.238"},
{"Return Over Maximum Drawdown", "-2.128"},
{"Portfolio Turnover", "0.024"},
{"Sortino Ratio", "-0.224"},
{"Return Over Maximum Drawdown", "-2.009"},
{"Portfolio Turnover", "0.023"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
{"Total Insights Analysis Completed", "0"},

View File

@@ -179,29 +179,29 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "2"},
{"Average Win", "0%"},
{"Average Loss", "-5.12%"},
{"Compounding Annual Return", "-10.844%"},
{"Compounding Annual Return", "-10.230%"},
{"Drawdown", "5.100%"},
{"Expectancy", "-1"},
{"Net Profit", "-5.116%"},
{"Sharpe Ratio", "-1.28"},
{"Probabilistic Sharpe Ratio", "0.017%"},
{"Sharpe Ratio", "-1.253"},
{"Probabilistic Sharpe Ratio", "0.015%"},
{"Loss Rate", "100%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "-0.086"},
{"Beta", "-0.003"},
{"Annual Standard Deviation", "0.067"},
{"Alpha", "-0.082"},
{"Beta", "0.003"},
{"Annual Standard Deviation", "0.065"},
{"Annual Variance", "0.004"},
{"Information Ratio", "0.794"},
{"Tracking Error", "0.187"},
{"Treynor Ratio", "28.078"},
{"Information Ratio", "-0.262"},
{"Tracking Error", "0.409"},
{"Treynor Ratio", "-27.056"},
{"Total Fees", "$3.70"},
{"Estimated Strategy Capacity", "$8700000.00"},
{"Fitness Score", "0"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "-0.193"},
{"Return Over Maximum Drawdown", "-2.12"},
{"Sortino Ratio", "-0.182"},
{"Return Over Maximum Drawdown", "-2.002"},
{"Portfolio Turnover", "0"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},

View File

@@ -190,30 +190,30 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "3"},
{"Average Win", "10.05%"},
{"Average Loss", "-5.63%"},
{"Compounding Annual Return", "8.619%"},
{"Compounding Annual Return", "8.083%"},
{"Drawdown", "0.500%"},
{"Expectancy", "0.393"},
{"Net Profit", "3.855%"},
{"Sharpe Ratio", "1.212"},
{"Probabilistic Sharpe Ratio", "59.039%"},
{"Sharpe Ratio", "1.182"},
{"Probabilistic Sharpe Ratio", "57.797%"},
{"Loss Rate", "50%"},
{"Win Rate", "50%"},
{"Profit-Loss Ratio", "1.79"},
{"Alpha", "0.071"},
{"Beta", "0.003"},
{"Annual Standard Deviation", "0.058"},
{"Alpha", "0.067"},
{"Beta", "-0.002"},
{"Annual Standard Deviation", "0.057"},
{"Annual Variance", "0.003"},
{"Information Ratio", "1.663"},
{"Tracking Error", "0.183"},
{"Treynor Ratio", "22.266"},
{"Information Ratio", "0.101"},
{"Tracking Error", "0.41"},
{"Treynor Ratio", "-27.331"},
{"Total Fees", "$7.40"},
{"Estimated Strategy Capacity", "$13000000.00"},
{"Fitness Score", "0.021"},
{"Fitness Score", "0.02"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "79228162514264337593543950335"},
{"Return Over Maximum Drawdown", "18.319"},
{"Portfolio Turnover", "0.021"},
{"Return Over Maximum Drawdown", "17.201"},
{"Portfolio Turnover", "0.02"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
{"Total Insights Analysis Completed", "0"},

View File

@@ -173,29 +173,29 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "2"},
{"Average Win", "1.81%"},
{"Average Loss", "0%"},
{"Compounding Annual Return", "3.996%"},
{"Compounding Annual Return", "3.752%"},
{"Drawdown", "0.000%"},
{"Expectancy", "0"},
{"Net Profit", "1.809%"},
{"Sharpe Ratio", "1.315"},
{"Probabilistic Sharpe Ratio", "66.818%"},
{"Sharpe Ratio", "1.283"},
{"Probabilistic Sharpe Ratio", "65.521%"},
{"Loss Rate", "0%"},
{"Win Rate", "100%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0.032"},
{"Beta", "0.001"},
{"Alpha", "0.031"},
{"Beta", "-0.001"},
{"Annual Standard Deviation", "0.024"},
{"Annual Variance", "0.001"},
{"Information Ratio", "1.516"},
{"Tracking Error", "0.176"},
{"Treynor Ratio", "27.339"},
{"Information Ratio", "0.013"},
{"Tracking Error", "0.406"},
{"Treynor Ratio", "-28.184"},
{"Total Fees", "$3.70"},
{"Estimated Strategy Capacity", "$3200000.00"},
{"Fitness Score", "0"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "79228162514264337593543950335"},
{"Return Over Maximum Drawdown", "101.571"},
{"Return Over Maximum Drawdown", "95.495"},
{"Portfolio Turnover", "0"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},

View File

@@ -187,30 +187,30 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "3"},
{"Average Win", "10.18%"},
{"Average Loss", "-8.05%"},
{"Compounding Annual Return", "2.902%"},
{"Compounding Annual Return", "2.726%"},
{"Drawdown", "0.500%"},
{"Expectancy", "0.133"},
{"Net Profit", "1.318%"},
{"Sharpe Ratio", "0.95"},
{"Probabilistic Sharpe Ratio", "47.360%"},
{"Sharpe Ratio", "0.927"},
{"Probabilistic Sharpe Ratio", "46.325%"},
{"Loss Rate", "50%"},
{"Win Rate", "50%"},
{"Profit-Loss Ratio", "1.27"},
{"Alpha", "0.024"},
{"Beta", "0.002"},
{"Annual Standard Deviation", "0.025"},
{"Alpha", "0.022"},
{"Beta", "-0.001"},
{"Annual Standard Deviation", "0.024"},
{"Annual Variance", "0.001"},
{"Information Ratio", "1.467"},
{"Tracking Error", "0.176"},
{"Treynor Ratio", "14.729"},
{"Information Ratio", "-0.008"},
{"Tracking Error", "0.406"},
{"Treynor Ratio", "-24.058"},
{"Total Fees", "$7.40"},
{"Estimated Strategy Capacity", "$14000000.00"},
{"Fitness Score", "0.022"},
{"Fitness Score", "0.021"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "79228162514264337593543950335"},
{"Return Over Maximum Drawdown", "6.087"},
{"Portfolio Turnover", "0.023"},
{"Return Over Maximum Drawdown", "5.725"},
{"Portfolio Turnover", "0.022"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
{"Total Insights Analysis Completed", "0"},

View File

@@ -172,29 +172,29 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "2"},
{"Average Win", "3.28%"},
{"Average Loss", "0%"},
{"Compounding Annual Return", "7.317%"},
{"Compounding Annual Return", "6.865%"},
{"Drawdown", "0.000%"},
{"Expectancy", "0"},
{"Net Profit", "3.284%"},
{"Sharpe Ratio", "1.343"},
{"Probabilistic Sharpe Ratio", "67.503%"},
{"Sharpe Ratio", "1.309"},
{"Probabilistic Sharpe Ratio", "66.205%"},
{"Loss Rate", "0%"},
{"Win Rate", "100%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0.06"},
{"Beta", "0.002"},
{"Annual Standard Deviation", "0.044"},
{"Alpha", "0.056"},
{"Beta", "-0.002"},
{"Annual Standard Deviation", "0.043"},
{"Annual Variance", "0.002"},
{"Information Ratio", "1.636"},
{"Tracking Error", "0.179"},
{"Treynor Ratio", "28.253"},
{"Information Ratio", "0.076"},
{"Tracking Error", "0.408"},
{"Treynor Ratio", "-28.646"},
{"Total Fees", "$3.70"},
{"Estimated Strategy Capacity", "$5400000.00"},
{"Fitness Score", "0"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "79228162514264337593543950335"},
{"Return Over Maximum Drawdown", "160.505"},
{"Return Over Maximum Drawdown", "150.763"},
{"Portfolio Turnover", "0"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},

View File

@@ -94,13 +94,13 @@ namespace QuantConnect.Algorithm.CSharp
{"Loss Rate", "0%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "1.545"},
{"Beta", "-0.45"},
{"Alpha", "1.575"},
{"Beta", "-0.437"},
{"Annual Standard Deviation", "0.194"},
{"Annual Variance", "0.038"},
{"Information Ratio", "-19.15"},
{"Tracking Error", "0.332"},
{"Treynor Ratio", "2.021"},
{"Information Ratio", "-19.629"},
{"Tracking Error", "0.336"},
{"Treynor Ratio", "2.082"},
{"Total Fees", "$1.85"},
{"Estimated Strategy Capacity", "$93000000.00"},
{"Fitness Score", "0.005"},

View File

@@ -156,30 +156,30 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "3"},
{"Average Win", "10.15%"},
{"Average Loss", "-11.34%"},
{"Compounding Annual Return", "-5.054%"},
{"Compounding Annual Return", "-2.578%"},
{"Drawdown", "2.300%"},
{"Expectancy", "-0.053"},
{"Net Profit", "-2.345%"},
{"Sharpe Ratio", "-1.289"},
{"Probabilistic Sharpe Ratio", "0.028%"},
{"Sharpe Ratio", "-0.969"},
{"Probabilistic Sharpe Ratio", "0.004%"},
{"Loss Rate", "50%"},
{"Win Rate", "50%"},
{"Profit-Loss Ratio", "0.89"},
{"Alpha", "-0.031"},
{"Beta", "-0.001"},
{"Annual Standard Deviation", "0.024"},
{"Annual Variance", "0.001"},
{"Information Ratio", "1.155"},
{"Tracking Error", "0.176"},
{"Treynor Ratio", "29.128"},
{"Alpha", "-0.018"},
{"Beta", "0.001"},
{"Annual Standard Deviation", "0.018"},
{"Annual Variance", "0"},
{"Information Ratio", "-0.696"},
{"Tracking Error", "0.33"},
{"Treynor Ratio", "-16.321"},
{"Total Fees", "$7.40"},
{"Estimated Strategy Capacity", "$71000000.00"},
{"Fitness Score", "0.007"},
{"Fitness Score", "0.005"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "-0.354"},
{"Return Over Maximum Drawdown", "-2.155"},
{"Portfolio Turnover", "0.024"},
{"Sortino Ratio", "-0.181"},
{"Return Over Maximum Drawdown", "-1.1"},
{"Portfolio Turnover", "0.013"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
{"Total Insights Analysis Completed", "0"},

View File

@@ -0,0 +1,111 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using QuantConnect.Data;
using QuantConnect.Interfaces;
using QuantConnect.Securities;
namespace QuantConnect.Algorithm.CSharp
{
/// <summary>
/// Regression algorithm to test if expired futures contract chains are making their
/// way into the timeslices being delivered to OnData()
/// </summary>
public class FuturesExpiredContractRegression : QCAlgorithm, IRegressionAlgorithmDefinition
{
private bool _receivedData;
/// <summary>
/// Initializes the algorithm state.
/// </summary>
public override void Initialize()
{
SetStartDate(2013, 10, 1);
SetEndDate(2013, 12, 23);
SetCash(1000000);
// Subscribe to futures ES
var future = AddFuture(Futures.Indices.SP500EMini, Resolution.Minute, Market.CME, false);
future.SetFilter(TimeSpan.FromDays(0), TimeSpan.FromDays(90));
}
public override void OnData(Slice data)
{
foreach (var chain in data.FutureChains)
{
_receivedData = true;
foreach (var contract in chain.Value.OrderBy(x => x.Expiry))
{
if (contract.Expiry.Date < Time.Date)
{
throw new Exception($"Received expired contract {contract} expired: {contract.Expiry} current time: {Time}");
}
}
}
}
public override void OnEndOfAlgorithm()
{
if (!_receivedData)
{
throw new Exception("No Futures chains were received in this regression");
}
}
/// <summary>
/// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.
/// </summary>
public bool CanRunLocally { get; } = true;
/// <summary>
/// This is used by the regression test system to indicate which languages this algorithm is written in.
/// </summary>
public Language[] Languages { get; } = { Language.CSharp };
/// <summary>
/// This is used by the regression test system to indicate what the expected statistics are from running the algorithm
/// </summary>
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
{
{"Total Trades", "0"},
{"Average Win", "0%"},
{"Average Loss", "0%"},
{"Compounding Annual Return", "0%"},
{"Drawdown", "0%"},
{"Expectancy", "0"},
{"Net Profit", "0%"},
{"Sharpe Ratio", "0"},
{"Probabilistic Sharpe Ratio", "0%"},
{"Loss Rate", "0%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0"},
{"Beta", "0"},
{"Annual Standard Deviation", "0"},
{"Annual Variance", "0"},
{"Information Ratio", "-3.464"},
{"Tracking Error", "0.097"},
{"Treynor Ratio", "0"},
{"Total Fees", "$0.00"},
{"Estimated Strategy Capacity", "$0"},
{"Fitness Score", "0"},
{"OrderListHash", "d41d8cd98f00b204e9800998ecf8427e"}
};
}
}

View File

@@ -300,30 +300,30 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "1"},
{"Average Win", "0%"},
{"Average Loss", "0%"},
{"Compounding Annual Return", "364.889%"},
{"Drawdown", "1.100%"},
{"Compounding Annual Return", "363.283%"},
{"Drawdown", "1.200%"},
{"Expectancy", "0"},
{"Net Profit", "1.698%"},
{"Sharpe Ratio", "8.904"},
{"Probabilistic Sharpe Ratio", "67.623%"},
{"Net Profit", "1.694%"},
{"Sharpe Ratio", "8.671"},
{"Probabilistic Sharpe Ratio", "67.159%"},
{"Loss Rate", "0%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "1.575"},
{"Beta", "0.072"},
{"Annual Standard Deviation", "0.218"},
{"Annual Variance", "0.047"},
{"Information Ratio", "-11.876"},
{"Tracking Error", "0.264"},
{"Treynor Ratio", "26.924"},
{"Total Fees", "$3.26"},
{"Estimated Strategy Capacity", "$890000000.00"},
{"Fitness Score", "0.251"},
{"Alpha", "1.614"},
{"Beta", "0.062"},
{"Annual Standard Deviation", "0.223"},
{"Annual Variance", "0.05"},
{"Information Ratio", "-11.911"},
{"Tracking Error", "0.271"},
{"Treynor Ratio", "31.034"},
{"Total Fees", "$3.45"},
{"Estimated Strategy Capacity", "$840000000.00"},
{"Fitness Score", "0.252"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "79228162514264337593543950335"},
{"Return Over Maximum Drawdown", "318.537"},
{"Portfolio Turnover", "0.251"},
{"Return Over Maximum Drawdown", "308.644"},
{"Portfolio Turnover", "0.252"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
{"Total Insights Analysis Completed", "0"},
@@ -337,7 +337,7 @@ namespace QuantConnect.Algorithm.CSharp
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "82fee25cd17100c53bb173834ab5f0b2"}
{"OrderListHash", "33d01821923c397f999cfb2e5b5928ad"}
};
/// <summary>

View File

@@ -46,7 +46,6 @@ namespace QuantConnect.Algorithm.CSharp
}
var totalBars = history.Count(slice => slice.Bars.Count > 0 && slice.Bars.ContainsKey(symbol));
if (totalBars != expectedSliceCount)
{
throw new Exception($"History bars - expected: {expectedSliceCount}, actual: {totalBars}");
@@ -90,8 +89,8 @@ namespace QuantConnect.Algorithm.CSharp
{"Beta", "0"},
{"Annual Standard Deviation", "0"},
{"Annual Variance", "0"},
{"Information Ratio", "-7.068"},
{"Tracking Error", "0.193"},
{"Information Ratio", "-7.163"},
{"Tracking Error", "0.195"},
{"Treynor Ratio", "0"},
{"Total Fees", "$0.00"},
{"Estimated Strategy Capacity", "$0"},

View File

@@ -98,13 +98,13 @@ namespace QuantConnect.Algorithm.CSharp
{"Loss Rate", "0%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0.431"},
{"Beta", "1.976"},
{"Alpha", "0.45"},
{"Beta", "2.007"},
{"Annual Standard Deviation", "1.118"},
{"Annual Variance", "1.25"},
{"Information Ratio", "-0.071"},
{"Tracking Error", "0.866"},
{"Treynor Ratio", "-0.286"},
{"Information Ratio", "-0.069"},
{"Tracking Error", "0.869"},
{"Treynor Ratio", "-0.282"},
{"Total Fees", "$5.40"},
{"Estimated Strategy Capacity", "$2400000.00"},
{"Fitness Score", "0.008"},

View File

@@ -99,29 +99,29 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "9"},
{"Average Win", "0.11%"},
{"Average Loss", "-0.24%"},
{"Compounding Annual Return", "28.263%"},
{"Compounding Annual Return", "28.386%"},
{"Drawdown", "1.200%"},
{"Expectancy", "-0.265"},
{"Net Profit", "2.113%"},
{"Sharpe Ratio", "4.037"},
{"Probabilistic Sharpe Ratio", "77.550%"},
{"Net Profit", "2.122%"},
{"Sharpe Ratio", "4.051"},
{"Probabilistic Sharpe Ratio", "77.669%"},
{"Loss Rate", "50%"},
{"Win Rate", "50%"},
{"Profit-Loss Ratio", "0.47"},
{"Alpha", "0.018"},
{"Beta", "0.477"},
{"Alpha", "0.022"},
{"Beta", "0.474"},
{"Annual Standard Deviation", "0.068"},
{"Annual Variance", "0.005"},
{"Information Ratio", "-3.604"},
{"Tracking Error", "0.073"},
{"Treynor Ratio", "0.573"},
{"Total Fees", "$14.75"},
{"Information Ratio", "-3.517"},
{"Tracking Error", "0.074"},
{"Treynor Ratio", "0.58"},
{"Total Fees", "$14.84"},
{"Estimated Strategy Capacity", "$6300000.00"},
{"Fitness Score", "0.2"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "9.401"},
{"Return Over Maximum Drawdown", "38.513"},
{"Sortino Ratio", "9.071"},
{"Return Over Maximum Drawdown", "38.369"},
{"Portfolio Turnover", "0.203"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
@@ -136,7 +136,7 @@ namespace QuantConnect.Algorithm.CSharp
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "599d18b0751e5efc95116bab44beeb97"}
{"OrderListHash", "b6cfdaac811f9f81e70c2846048508af"}
};
}
}

View File

@@ -132,13 +132,13 @@ namespace QuantConnect.Algorithm.CSharp
{"Loss Rate", "100%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0"},
{"Beta", "0"},
{"Alpha", "-0.014"},
{"Beta", "-0.004"},
{"Annual Standard Deviation", "0.004"},
{"Annual Variance", "0"},
{"Information Ratio", "-3.525"},
{"Tracking Error", "0.004"},
{"Treynor Ratio", "0"},
{"Information Ratio", "-0.453"},
{"Tracking Error", "0.156"},
{"Treynor Ratio", "3.397"},
{"Total Fees", "$0.00"},
{"Estimated Strategy Capacity", "$0"},
{"Fitness Score", "0"},

View File

@@ -194,13 +194,13 @@ namespace QuantConnect.Algorithm.CSharp
{"Loss Rate", "100%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0"},
{"Beta", "0"},
{"Alpha", "2.674"},
{"Beta", "-0.22"},
{"Annual Standard Deviation", "0.386"},
{"Annual Variance", "0.149"},
{"Information Ratio", "6.904"},
{"Tracking Error", "0.386"},
{"Treynor Ratio", "0"},
{"Information Ratio", "6.086"},
{"Tracking Error", "0.428"},
{"Treynor Ratio", "-12.111"},
{"Total Fees", "$0.00"},
{"Estimated Strategy Capacity", "$0"},
{"Fitness Score", "0.024"},

View File

@@ -22,6 +22,7 @@ using QuantConnect.Interfaces;
using QuantConnect.Orders;
using QuantConnect.Securities;
using QuantConnect.Securities.Option;
using QuantConnect.Securities.Volatility;
namespace QuantConnect.Algorithm.CSharp
{
@@ -42,7 +43,9 @@ namespace QuantConnect.Algorithm.CSharp
SetStartDate(2021, 1, 4);
SetEndDate(2021, 1, 31);
_spx = AddIndex("SPX", Resolution.Minute).Symbol;
var spx = AddIndex("SPX", Resolution.Minute);
spx.VolatilityModel = new StandardDeviationOfReturnsVolatilityModel(60, Resolution.Minute, TimeSpan.FromMinutes(1));
_spx = spx.Symbol;
// Select an index option expiring ITM, and adds it to the algorithm.
_spxOption = AddIndexOptionContract(OptionChainProvider.GetOptionContractList(_spx, Time)
@@ -96,14 +99,15 @@ namespace QuantConnect.Algorithm.CSharp
{
throw new AggregateException("Option contract Delta was equal to zero");
}
//if (gammas.Any(g => g == 0))
//{
// throw new AggregateException("Option contract Gamma was equal to zero");
//}
//if (lambda.Any(l => l == 0))
//{
// throw new AggregateException("Option contract Lambda was equal to zero");
//}
// Delta is 1, therefore we expect a gamma of 0
if (gammas.Any(g => deltas.Any() && deltas[0] == 1 ? g != 0 : g == 0))
{
throw new AggregateException("Option contract Gamma was equal to zero");
}
if (lambda.Any(l => l == 0))
{
throw new AggregateException("Option contract Lambda was equal to zero");
}
if (rho.Any(r => r == 0))
{
throw new AggregateException("Option contract Rho was equal to zero");
@@ -112,10 +116,12 @@ namespace QuantConnect.Algorithm.CSharp
{
throw new AggregateException("Option contract Theta was equal to zero");
}
//if (vega.Any(v => v == 0))
//{
// throw new AggregateException("Option contract Vega was equal to zero");
//}
// The strike is far away from the underlying asset's price, and we're very close to expiry.
// Zero is an expected value here.
if (vega.Any(v => v != 0))
{
throw new AggregateException("Option contract Vega was equal to zero");
}
if (!_invested)
{
@@ -167,13 +173,13 @@ namespace QuantConnect.Algorithm.CSharp
{"Loss Rate", "100%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0"},
{"Beta", "0"},
{"Alpha", "3.219"},
{"Beta", "-0.229"},
{"Annual Standard Deviation", "0.417"},
{"Annual Variance", "0.174"},
{"Information Ratio", "7.691"},
{"Tracking Error", "0.417"},
{"Treynor Ratio", "0"},
{"Information Ratio", "6.893"},
{"Tracking Error", "0.457"},
{"Treynor Ratio", "-14.008"},
{"Total Fees", "$0.00"},
{"Estimated Strategy Capacity", "$46000000.00"},
{"Fitness Score", "0.023"},

View File

@@ -184,13 +184,13 @@ namespace QuantConnect.Algorithm.CSharp
{"Loss Rate", "100%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0"},
{"Alpha", "-0.001"},
{"Beta", "0"},
{"Annual Standard Deviation", "0"},
{"Annual Variance", "0"},
{"Information Ratio", "-5.154"},
{"Tracking Error", "0"},
{"Treynor Ratio", "0"},
{"Information Ratio", "-0.374"},
{"Tracking Error", "0.155"},
{"Treynor Ratio", "-4.059"},
{"Total Fees", "$0.00"},
{"Estimated Strategy Capacity", "$23000.00"},
{"Fitness Score", "0"},

View File

@@ -199,13 +199,13 @@ namespace QuantConnect.Algorithm.CSharp
{"Loss Rate", "100%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0"},
{"Beta", "0"},
{"Alpha", "-0.765"},
{"Beta", "0.207"},
{"Annual Standard Deviation", "0.398"},
{"Annual Variance", "0.158"},
{"Information Ratio", "-1.894"},
{"Tracking Error", "0.398"},
{"Treynor Ratio", "0"},
{"Information Ratio", "-1.952"},
{"Tracking Error", "0.415"},
{"Treynor Ratio", "-3.636"},
{"Total Fees", "$0.00"},
{"Estimated Strategy Capacity", "$0"},
{"Fitness Score", "0.005"},

View File

@@ -183,13 +183,13 @@ namespace QuantConnect.Algorithm.CSharp
{"Loss Rate", "100%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0"},
{"Beta", "0"},
{"Alpha", "-0.046"},
{"Beta", "0.007"},
{"Annual Standard Deviation", "0.013"},
{"Annual Variance", "0"},
{"Information Ratio", "-3.622"},
{"Tracking Error", "0.013"},
{"Treynor Ratio", "0"},
{"Information Ratio", "-0.662"},
{"Tracking Error", "0.154"},
{"Treynor Ratio", "-6.383"},
{"Total Fees", "$0.00"},
{"Estimated Strategy Capacity", "$0"},
{"Fitness Score", "0"},

View File

@@ -185,13 +185,13 @@ namespace QuantConnect.Algorithm.CSharp
{"Loss Rate", "0%"},
{"Win Rate", "100%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0"},
{"Beta", "0"},
{"Alpha", "-0.753"},
{"Beta", "0.2"},
{"Annual Standard Deviation", "0.385"},
{"Annual Variance", "0.148"},
{"Information Ratio", "-1.928"},
{"Tracking Error", "0.385"},
{"Treynor Ratio", "0"},
{"Information Ratio", "-1.981"},
{"Tracking Error", "0.403"},
{"Treynor Ratio", "-3.708"},
{"Total Fees", "$0.00"},
{"Estimated Strategy Capacity", "$0"},
{"Fitness Score", "0.005"},

View File

@@ -177,13 +177,13 @@ namespace QuantConnect.Algorithm.CSharp
{"Loss Rate", "0%"},
{"Win Rate", "100%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0"},
{"Alpha", "0.001"},
{"Beta", "0"},
{"Annual Standard Deviation", "0"},
{"Annual Variance", "0"},
{"Information Ratio", "5.161"},
{"Tracking Error", "0"},
{"Treynor Ratio", "0"},
{"Information Ratio", "-0.358"},
{"Tracking Error", "0.155"},
{"Treynor Ratio", "-4.064"},
{"Total Fees", "$0.00"},
{"Estimated Strategy Capacity", "$23000.00"},
{"Fitness Score", "0"},

View File

@@ -189,13 +189,13 @@ namespace QuantConnect.Algorithm.CSharp
{"Loss Rate", "0%"},
{"Win Rate", "100%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0"},
{"Beta", "0"},
{"Alpha", "2.84"},
{"Beta", "-0.227"},
{"Annual Standard Deviation", "0.398"},
{"Annual Variance", "0.159"},
{"Information Ratio", "7.1"},
{"Tracking Error", "0.398"},
{"Treynor Ratio", "0"},
{"Information Ratio", "6.298"},
{"Tracking Error", "0.44"},
{"Treynor Ratio", "-12.457"},
{"Total Fees", "$0.00"},
{"Estimated Strategy Capacity", "$0"},
{"Fitness Score", "0.025"},

View File

@@ -176,13 +176,13 @@ namespace QuantConnect.Algorithm.CSharp
{"Loss Rate", "0%"},
{"Win Rate", "100%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0"},
{"Beta", "0"},
{"Alpha", "0.046"},
{"Beta", "-0.008"},
{"Annual Standard Deviation", "0.013"},
{"Annual Variance", "0"},
{"Information Ratio", "3.573"},
{"Tracking Error", "0.013"},
{"Treynor Ratio", "0"},
{"Information Ratio", "-0.074"},
{"Tracking Error", "0.157"},
{"Treynor Ratio", "-5.727"},
{"Total Fees", "$0.00"},
{"Estimated Strategy Capacity", "$0"},
{"Fitness Score", "0"},

View File

@@ -246,29 +246,29 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "1"},
{"Average Win", "0%"},
{"Average Loss", "0%"},
{"Compounding Annual Return", "19.104%"},
{"Compounding Annual Return", "19.058%"},
{"Drawdown", "7.300%"},
{"Expectancy", "0"},
{"Net Profit", "41.858%"},
{"Sharpe Ratio", "1.607"},
{"Probabilistic Sharpe Ratio", "77.376%"},
{"Net Profit", "41.748%"},
{"Sharpe Ratio", "1.596"},
{"Probabilistic Sharpe Ratio", "76.886%"},
{"Loss Rate", "0%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "0.171"},
{"Beta", "-0.06"},
{"Annual Standard Deviation", "0.099"},
{"Beta", "-0.064"},
{"Annual Standard Deviation", "0.1"},
{"Annual Variance", "0.01"},
{"Information Ratio", "-0.187"},
{"Tracking Error", "0.146"},
{"Treynor Ratio", "-2.677"},
{"Information Ratio", "-0.186"},
{"Tracking Error", "0.147"},
{"Treynor Ratio", "-2.51"},
{"Total Fees", "$1.00"},
{"Estimated Strategy Capacity", "$530000000.00"},
{"Estimated Strategy Capacity", "$500000000.00"},
{"Fitness Score", "0.001"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "2.305"},
{"Return Over Maximum Drawdown", "2.632"},
{"Sortino Ratio", "2.283"},
{"Return Over Maximum Drawdown", "2.627"},
{"Portfolio Turnover", "0.001"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
@@ -283,7 +283,7 @@ namespace QuantConnect.Algorithm.CSharp
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "a5bc3b72fcfb77669eaeccc088bf9807"}
{"OrderListHash", "ee33b931de5b59dfa930cbcacdaa2c9b"}
};
}
}

View File

@@ -75,31 +75,31 @@ namespace QuantConnect.Algorithm.CSharp
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
{
{"Total Trades", "6"},
{"Average Win", "0.00%"},
{"Average Win", "0%"},
{"Average Loss", "0.00%"},
{"Compounding Annual Return", "38.059%"},
{"Compounding Annual Return", "38.832%"},
{"Drawdown", "0.600%"},
{"Expectancy", "-0.502"},
{"Net Profit", "0.413%"},
{"Sharpe Ratio", "5.518"},
{"Probabilistic Sharpe Ratio", "66.933%"},
{"Loss Rate", "67%"},
{"Win Rate", "33%"},
{"Profit-Loss Ratio", "0.50"},
{"Alpha", "-0.178"},
{"Beta", "0.249"},
{"Expectancy", "-1"},
{"Net Profit", "0.420%"},
{"Sharpe Ratio", "5.579"},
{"Probabilistic Sharpe Ratio", "67.318%"},
{"Loss Rate", "100%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "-0.184"},
{"Beta", "0.248"},
{"Annual Standard Deviation", "0.055"},
{"Annual Variance", "0.003"},
{"Information Ratio", "-9.844"},
{"Tracking Error", "0.165"},
{"Treynor Ratio", "1.212"},
{"Information Ratio", "-10.012"},
{"Tracking Error", "0.167"},
{"Treynor Ratio", "1.241"},
{"Total Fees", "$6.00"},
{"Estimated Strategy Capacity", "$42000000.00"},
{"Estimated Strategy Capacity", "$33000000.00"},
{"Fitness Score", "0.063"},
{"Kelly Criterion Estimate", "38.64"},
{"Kelly Criterion Probability Value", "0.229"},
{"Kelly Criterion Estimate", "38.796"},
{"Kelly Criterion Probability Value", "0.228"},
{"Sortino Ratio", "79228162514264337593543950335"},
{"Return Over Maximum Drawdown", "70.188"},
{"Return Over Maximum Drawdown", "70.89"},
{"Portfolio Turnover", "0.063"},
{"Total Insights Generated", "100"},
{"Total Insights Closed", "99"},
@@ -107,14 +107,14 @@ namespace QuantConnect.Algorithm.CSharp
{"Long Insight Count", "100"},
{"Short Insight Count", "0"},
{"Long/Short Ratio", "100%"},
{"Estimated Monthly Alpha Value", "$126657.6305"},
{"Total Accumulated Estimated Alpha Value", "$20405.9516"},
{"Mean Population Estimated Insight Value", "$206.1207"},
{"Mean Population Direction", "54.5455%"},
{"Mean Population Magnitude", "54.5455%"},
{"Rolling Averaged Population Direction", "59.8056%"},
{"Rolling Averaged Population Magnitude", "59.8056%"},
{"OrderListHash", "07eb3e2c199575b547459a534057eb5e"}
{"Estimated Monthly Alpha Value", "$117277.2200"},
{"Total Accumulated Estimated Alpha Value", "$18894.6632"},
{"Mean Population Estimated Insight Value", "$190.8552"},
{"Mean Population Direction", "53.5354%"},
{"Mean Population Magnitude", "53.5354%"},
{"Rolling Averaged Population Direction", "58.2788%"},
{"Rolling Averaged Population Magnitude", "58.2788%"},
{"OrderListHash", "21e4704a124ba562d042e1e9962f4316"}
};
}
}

View File

@@ -84,30 +84,30 @@ namespace QuantConnect.Algorithm.CSharp
{
{"Total Trades", "2"},
{"Average Win", "0%"},
{"Average Loss", "-0.11%"},
{"Compounding Annual Return", "235.287%"},
{"Average Loss", "-0.12%"},
{"Compounding Annual Return", "240.487%"},
{"Drawdown", "2.200%"},
{"Expectancy", "-1"},
{"Net Profit", "1.559%"},
{"Sharpe Ratio", "8.763"},
{"Probabilistic Sharpe Ratio", "67.311%"},
{"Net Profit", "1.579%"},
{"Sharpe Ratio", "8.903"},
{"Probabilistic Sharpe Ratio", "67.609%"},
{"Loss Rate", "100%"},
{"Win Rate", "0%"},
{"Profit-Loss Ratio", "0"},
{"Alpha", "-0.001"},
{"Alpha", "-0.002"},
{"Beta", "0.999"},
{"Annual Standard Deviation", "0.219"},
{"Annual Variance", "0.048"},
{"Information Ratio", "-13.944"},
{"Annual Standard Deviation", "0.222"},
{"Annual Variance", "0.049"},
{"Information Ratio", "-14.44"},
{"Tracking Error", "0"},
{"Treynor Ratio", "1.925"},
{"Total Fees", "$61.90"},
{"Estimated Strategy Capacity", "$5800000.00"},
{"Treynor Ratio", "1.981"},
{"Total Fees", "$65.43"},
{"Estimated Strategy Capacity", "$4800000.00"},
{"Fitness Score", "0.979"},
{"Kelly Criterion Estimate", "38.64"},
{"Kelly Criterion Probability Value", "0.229"},
{"Sortino Ratio", "7.47"},
{"Return Over Maximum Drawdown", "71.186"},
{"Kelly Criterion Estimate", "38.796"},
{"Kelly Criterion Probability Value", "0.228"},
{"Sortino Ratio", "7.448"},
{"Return Over Maximum Drawdown", "70.494"},
{"Portfolio Turnover", "4.74"},
{"Total Insights Generated", "100"},
{"Total Insights Closed", "99"},
@@ -115,14 +115,14 @@ namespace QuantConnect.Algorithm.CSharp
{"Long Insight Count", "100"},
{"Short Insight Count", "0"},
{"Long/Short Ratio", "100%"},
{"Estimated Monthly Alpha Value", "$126657.6305"},
{"Total Accumulated Estimated Alpha Value", "$20405.9516"},
{"Mean Population Estimated Insight Value", "$206.1207"},
{"Mean Population Direction", "54.5455%"},
{"Mean Population Magnitude", "54.5455%"},
{"Rolling Averaged Population Direction", "59.8056%"},
{"Rolling Averaged Population Magnitude", "59.8056%"},
{"OrderListHash", "f3e7f74b397880a3fd4a494409a77012"}
{"Estimated Monthly Alpha Value", "$117277.2200"},
{"Total Accumulated Estimated Alpha Value", "$18894.6632"},
{"Mean Population Estimated Insight Value", "$190.8552"},
{"Mean Population Direction", "53.5354%"},
{"Mean Population Magnitude", "53.5354%"},
{"Rolling Averaged Population Direction", "58.2788%"},
{"Rolling Averaged Population Magnitude", "58.2788%"},
{"OrderListHash", "5d45f854274d541d6f32c4aa7ed6e11d"}
};
private class TestBrokerageModel : DefaultBrokerageModel

View File

@@ -82,31 +82,31 @@ namespace QuantConnect.Algorithm.CSharp
{
{"Total Trades", "34"},
{"Average Win", "0.01%"},
{"Average Loss", "-0.02%"},
{"Compounding Annual Return", "-5.405%"},
{"Average Loss", "-0.01%"},
{"Compounding Annual Return", "-5.340%"},
{"Drawdown", "0.300%"},
{"Expectancy", "-0.202"},
{"Net Profit", "-0.071%"},
{"Sharpe Ratio", "-0.745"},
{"Probabilistic Sharpe Ratio", "42.475%"},
{"Expectancy", "-0.203"},
{"Net Profit", "-0.070%"},
{"Sharpe Ratio", "-0.8"},
{"Probabilistic Sharpe Ratio", "42.250%"},
{"Loss Rate", "50%"},
{"Win Rate", "50%"},
{"Profit-Loss Ratio", "0.60"},
{"Alpha", "-0.223"},
{"Beta", "0.107"},
{"Annual Standard Deviation", "0.024"},
{"Profit-Loss Ratio", "0.59"},
{"Alpha", "-0.217"},
{"Beta", "0.1"},
{"Annual Standard Deviation", "0.023"},
{"Annual Variance", "0.001"},
{"Information Ratio", "-9.903"},
{"Tracking Error", "0.196"},
{"Treynor Ratio", "-0.169"},
{"Information Ratio", "-9.988"},
{"Tracking Error", "0.2"},
{"Treynor Ratio", "-0.184"},
{"Total Fees", "$34.00"},
{"Estimated Strategy Capacity", "$180000000.00"},
{"Fitness Score", "0.008"},
{"Estimated Strategy Capacity", "$150000000.00"},
{"Fitness Score", "0.007"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "-2.961"},
{"Return Over Maximum Drawdown", "-18.615"},
{"Portfolio Turnover", "0.103"},
{"Sortino Ratio", "-3.069"},
{"Return Over Maximum Drawdown", "-19.139"},
{"Portfolio Turnover", "0.097"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
{"Total Insights Analysis Completed", "0"},
@@ -120,7 +120,7 @@ namespace QuantConnect.Algorithm.CSharp
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "82e1f37f4ff947bc54f0bc56c3e3ab1f"}
{"OrderListHash", "d4eaa05433f0ead598911863e61bb230"}
};
}
}

View File

@@ -35,10 +35,9 @@ namespace QuantConnect.Algorithm.CSharp
// We assert the following occur in FIFO order in OnOrderEvent
private readonly Queue<string> _expectedEvents = new Queue<string>(new[]
{
"Time: 10/10/2013 13:31:00 OrderID: 72 EventID: 11 Symbol: SPY Status: Filled Quantity: -1 FillQuantity: -1 FillPrice: 152.8807 USD LimitPrice: 152.519 TriggerPrice: 151.769 OrderFee: 1 USD",
"Time: 10/10/2013 15:55:00 OrderID: 73 EventID: 11 Symbol: SPY Status: Filled Quantity: -1 FillQuantity: -1 FillPrice: 153.9225 USD LimitPrice: 153.8898 TriggerPrice: 153.1398 OrderFee: 1 USD",
"Time: 10/11/2013 14:02:00 OrderID: 74 EventID: 11 Symbol: SPY Status: Filled Quantity: -1 FillQuantity: -1 FillPrice: 154.9643 USD LimitPrice: 154.9317 TriggerPrice: 154.1817 OrderFee: 1 USD",
});
"Time: 10/10/2013 13:31:00 OrderID: 72 EventID: 11 Symbol: SPY Status: Filled Quantity: -1 FillQuantity: -1 FillPrice: 144.6434 USD LimitPrice: 144.3551 TriggerPrice: 143.6051 OrderFee: 1 USD",
"Time: 10/10/2013 15:57:00 OrderID: 73 EventID: 11 Symbol: SPY Status: Filled Quantity: -1 FillQuantity: -1 FillPrice: 145.6636 USD LimitPrice: 145.6434 TriggerPrice: 144.8934 OrderFee: 1 USD",
"Time: 10/11/2013 15:37:00 OrderID: 74 EventID: 11 Symbol: SPY Status: Filled Quantity: -1 FillQuantity: -1 FillPrice: 146.7185 USD LimitPrice: 146.6723 TriggerPrice: 145.9223 OrderFee: 1 USD" });
/// <summary>
/// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.
@@ -128,11 +127,11 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "3"},
{"Average Win", "0%"},
{"Average Loss", "0%"},
{"Compounding Annual Return", "-0.625%"},
{"Compounding Annual Return", "-0.601%"},
{"Drawdown", "0.000%"},
{"Expectancy", "0"},
{"Net Profit", "-0.008%"},
{"Sharpe Ratio", "-13.588"},
{"Sharpe Ratio", "-13.493"},
{"Probabilistic Sharpe Ratio", "0%"},
{"Loss Rate", "0%"},
{"Win Rate", "0%"},
@@ -141,16 +140,16 @@ namespace QuantConnect.Algorithm.CSharp
{"Beta", "-0.001"},
{"Annual Standard Deviation", "0"},
{"Annual Variance", "0"},
{"Information Ratio", "-8.779"},
{"Tracking Error", "0.22"},
{"Treynor Ratio", "3.431"},
{"Information Ratio", "-8.919"},
{"Tracking Error", "0.223"},
{"Treynor Ratio", "3.402"},
{"Total Fees", "$3.00"},
{"Estimated Strategy Capacity", "$1900000000.00"},
{"Estimated Strategy Capacity", "$3800000000.00"},
{"Fitness Score", "0"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "-15.79"},
{"Return Over Maximum Drawdown", "-82.891"},
{"Sortino Ratio", "-16.281"},
{"Return Over Maximum Drawdown", "-82.895"},
{"Portfolio Turnover", "0"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
@@ -165,7 +164,7 @@ namespace QuantConnect.Algorithm.CSharp
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "05ae058d8e98b92dcb6fa0612f9a598e"}
{"OrderListHash", "359ac5b8cd73a8e42b7897a883f5f73d"}
};
}
}

View File

@@ -101,29 +101,29 @@ namespace QuantConnect.Algorithm.CSharp
{"Total Trades", "9"},
{"Average Win", "0.99%"},
{"Average Loss", "-0.60%"},
{"Compounding Annual Return", "211.299%"},
{"Compounding Annual Return", "216.678%"},
{"Drawdown", "2.300%"},
{"Expectancy", "0.319"},
{"Net Profit", "1.462%"},
{"Sharpe Ratio", "7.178"},
{"Probabilistic Sharpe Ratio", "64.689%"},
{"Expectancy", "0.318"},
{"Net Profit", "1.485%"},
{"Sharpe Ratio", "7.299"},
{"Probabilistic Sharpe Ratio", "64.957%"},
{"Loss Rate", "50%"},
{"Win Rate", "50%"},
{"Profit-Loss Ratio", "1.64"},
{"Alpha", "-0.35"},
{"Alpha", "-0.36"},
{"Beta", "1.003"},
{"Annual Standard Deviation", "0.22"},
{"Annual Variance", "0.049"},
{"Information Ratio", "-97.49"},
{"Annual Standard Deviation", "0.223"},
{"Annual Variance", "0.05"},
{"Information Ratio", "-100.088"},
{"Tracking Error", "0.004"},
{"Treynor Ratio", "1.577"},
{"Total Fees", "$293.06"},
{"Estimated Strategy Capacity", "$14000000.00"},
{"Treynor Ratio", "1.624"},
{"Total Fees", "$309.75"},
{"Estimated Strategy Capacity", "$13000000.00"},
{"Fitness Score", "0.999"},
{"Kelly Criterion Estimate", "-6.994"},
{"Kelly Criterion Estimate", "-6.933"},
{"Kelly Criterion Probability Value", "0.593"},
{"Sortino Ratio", "79228162514264337593543950335"},
{"Return Over Maximum Drawdown", "68.908"},
{"Return Over Maximum Drawdown", "68.722"},
{"Portfolio Turnover", "1.741"},
{"Total Insights Generated", "10"},
{"Total Insights Closed", "8"},
@@ -131,14 +131,14 @@ namespace QuantConnect.Algorithm.CSharp
{"Long Insight Count", "5"},
{"Short Insight Count", "5"},
{"Long/Short Ratio", "100%"},
{"Estimated Monthly Alpha Value", "$76052.4902"},
{"Total Accumulated Estimated Alpha Value", "$12252.9012"},
{"Mean Population Estimated Insight Value", "$1531.6126"},
{"Estimated Monthly Alpha Value", "$71700.1986"},
{"Total Accumulated Estimated Alpha Value", "$11551.6987"},
{"Mean Population Estimated Insight Value", "$1443.9623"},
{"Mean Population Direction", "62.5%"},
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "73.0394%"},
{"Rolling Averaged Population Direction", "73.1163%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "76b18fa742b9947621467280d3c9d4f5"}
{"OrderListHash", "79a973155c0106b60249931daa89c54b"}
};
}
}

View File

@@ -99,31 +99,31 @@ namespace QuantConnect.Algorithm.CSharp
public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
{
{"Total Trades", "84"},
{"Average Win", "4.79%"},
{"Average Win", "4.78%"},
{"Average Loss", "-4.16%"},
{"Compounding Annual Return", "2.963%"},
{"Drawdown", "34.700%"},
{"Compounding Annual Return", "2.951%"},
{"Drawdown", "34.900%"},
{"Expectancy", "0.228"},
{"Net Profit", "37.907%"},
{"Net Profit", "37.728%"},
{"Sharpe Ratio", "0.274"},
{"Probabilistic Sharpe Ratio", "0.399%"},
{"Probabilistic Sharpe Ratio", "0.400%"},
{"Loss Rate", "43%"},
{"Win Rate", "57%"},
{"Profit-Loss Ratio", "1.15"},
{"Alpha", "0.034"},
{"Beta", "-0.04"},
{"Annual Standard Deviation", "0.113"},
{"Beta", "-0.037"},
{"Annual Standard Deviation", "0.112"},
{"Annual Variance", "0.013"},
{"Information Ratio", "-0.234"},
{"Tracking Error", "0.214"},
{"Treynor Ratio", "-0.774"},
{"Total Fees", "$443.74"},
{"Estimated Strategy Capacity", "$750000000.00"},
{"Information Ratio", "-0.236"},
{"Tracking Error", "0.213"},
{"Treynor Ratio", "-0.838"},
{"Total Fees", "$468.55"},
{"Estimated Strategy Capacity", "$730000000.00"},
{"Fitness Score", "0.013"},
{"Kelly Criterion Estimate", "0"},
{"Kelly Criterion Probability Value", "0"},
{"Sortino Ratio", "0.216"},
{"Return Over Maximum Drawdown", "0.085"},
{"Sortino Ratio", "0.217"},
{"Return Over Maximum Drawdown", "0.084"},
{"Portfolio Turnover", "0.024"},
{"Total Insights Generated", "0"},
{"Total Insights Closed", "0"},
@@ -138,7 +138,7 @@ namespace QuantConnect.Algorithm.CSharp
{"Mean Population Magnitude", "0%"},
{"Rolling Averaged Population Direction", "0%"},
{"Rolling Averaged Population Magnitude", "0%"},
{"OrderListHash", "fb94c58a401ed10706ecc3f34883d138"}
{"OrderListHash", "6523943a76fb687bef770593d4651ec7"}
};
}
}

Some files were not shown because too many files have changed in this diff Show More