10849 Commits

Author SHA1 Message Date
Martin-Molinero d94a1d09a4 Remove unrequired references 11342 11345 11346 11347 11348 11349 11350 11353 11354 11355 11360 11361 11363 11367 11368 11369 2021-04-12 16:05:01 -03:00
Martin-Molinero 2c843cae9e Fix rebase
- Fix ambiguous Index
- Remove StrategyCapacity.cs
- Update System.Threading.Tasks.Extensionsy
2021-04-12 15:09:34 -03:00
Stefano Raggi 039fdf7e4a Upgrade IBAutomater to v1.0.51
ignored, and an empty message aborts the commit.
2021-04-12 15:09:33 -03:00
Martin Molinero 2c63546c37 Remove FXCM 2021-04-12 15:09:33 -03:00
Martin Molinero 58682e1bbd Fix ambiguous errors. Add IBAutomator net5 2021-04-12 15:09:33 -03:00
Gerardo Salazar d11a375fdb Update projects to use .NET 5.0, the successor to .NET Core 2021-04-12 15:09:33 -03:00
Martin-Molinero 6ab91a13e1 Add note for TimeZoneOffsetProvider StartTime (#5469) 11305 2021-04-08 18:00:17 -03:00
Colton Sellers beaa705646 Loader Support Full Algorithm Name (#5467)
* Apply fix

* Address possible mismatching subset of name
11304
2021-04-08 17:59:08 -03:00
Colton Sellers 4c830c8235 Fix Breaking Unit Test (#5466)
* Adjust Timeout; Reduce time advance

* Move logging of EndTime above asserts
11287 11289 11295 11298 11299 11303 11294
2021-04-07 21:09:56 -03:00
Colton Sellers 395c1123da Remove Obsolete QCAlgorithm.OnEndOfDay() (#5441)
* Remove and replace OnEndOfDay() ref

* Restore functionality of obsolete EOD, waiting for deprecation in August 2021

* Cleanup

* Adjustments to only post message when using obsolete EOD

* nit, extra space

* Address review

* Adjust test to reflect new behaviour

* Move GetPythonArgCount to an extension method

* Add unit test

* nit accidental import

* Refactor broken test

* Use Py.GIL() state for extension
11263 11265 11268 11271 11273 11279 11280 11283 11285 11260 11261
2021-04-07 13:39:49 -03:00
Martin-Molinero 8e50645640 Update System.Threading.Tasks.Extensions (#5340) 11259 2021-04-07 12:36:22 -03:00
Colton Sellers 68ca504d3a Apply fixes (#5464) 11256 11258 2021-04-07 11:46:31 -03:00
Jasper van Merle 12df1c9a31 Fix drawdown plotting failing on single equity point (#5461) 11253 11254 2021-04-06 16:30:23 -07:00
Aaron Janeiro Stone 4de25b6cd4 _lastLow and _lastHigh are given resets under DeM's Reset method (#5449) 11229 11247 2021-04-06 10:15:16 -03:00
dependabot[bot] cdef9e709a Bump System.Net.Security from 4.3.0 to 4.3.1 in /Tests (#5453)
Bumps System.Net.Security from 4.3.0 to 4.3.1.

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
11228
2021-04-06 10:11:43 -03:00
Colton Sellers 3579fecc58 Live Consolidator Bug Fix (#5429)
* Set _lastEmit before emitting, otherwise _workingBar is always null

* Aggregate bars if the data endTime is past lastEmit

* Add unit test

* Address Review

* Clean up unit tests

* Refactor solution to set consistent _lastEmit behaviour

* Add another unit test

* Make fixture non-parallelizable

* Undo last change, and adjust breaking test directly
11227
2021-04-05 17:05:53 -07:00
Stefano Raggi 3a390cfa9f Add IB brokerage message event filtering (#5452) 11223 2021-04-05 17:17:14 -03:00
Stefano Raggi 58dae061e7 Add REST API exception logging in Tradier brokerage (#5454) 11222 2021-04-05 17:14:52 -03:00
Martin-Molinero 3f2479393f Update clr-loader and remove workaround (#5451) 11220 2021-04-05 14:25:19 -03:00
Jasper van Merle 4849588c3b Fix flipped operator in random data generator (#5446) 11216 2021-04-05 11:07:51 -03:00
Martin-Molinero 3d84c76abb Add missing timedelta import in python custom data regression algorithms. Relate to https://github.com/QuantConnect/Lean/pull/5426/files (#5450) 11214 2021-04-05 10:26:51 -03:00
Colton Sellers 1c3d849ad5 Fix Warnings V2 (#5436)
* Reconcile duplicated code

* Add License header

* CS0219 Fixes: Value assigned, but never used

* CA1507: Use nameof in place of string literals

* CS0108 : Hides Inherited Member; Use new keyword to overwrite formally

* CS0114: Hides inherited member; use override keyword

* CS0168: Variable is declared but never used

* Tests CS1062; using obsolete implicit Symbol -> String; fix via .ToString()

* CS0472: Non Nullable Obj getting Null Checked

* CS0067 Member not used; ignore all cases for future use

* CS00162 : Unreachable code; either removed or ignored for debugging and test cases

* CS0169 Remove non-used fields; ignore those that may be used in future

* CS0414; Field is assigned but never used.

* CS0618; Obsolete properties and members; Only fixes simple ones, rest will have to broken up

* CS0649; Field never assigned too

* CS0659 & CS0661 ; Overwrite operators and equals but not hashcode; I don't really override it but just call base

* Small comment fix

* Cleanup pragma statement
11209
2021-04-02 11:20:01 -07:00
Jasper van Merle 271220083b Fix various map file generation issues (#5443) 11208 2021-04-02 11:08:02 -07:00
Stefano Raggi b29d0cbfaf Tradier Brokerage Updates (#5445)
* Tradier brokerage updates

- Add missing status check after REST API calls
- Initialize DataQueueHandler on-demand (on first subscribe call)

* Trigger build
11207
2021-04-02 10:58:27 -07:00
Tomas Rampas 27a25cd663 The null value parameter removed from call of OandaBrokerage c'tor from OandaDownloader class (#5430)
Co-authored-by: rampasto <tomas.rampas@outlook.com>
11186 11198
2021-03-30 15:25:54 -07:00
Derek Melchin 5ed61db2bb Fix timestamps in custom data algorithms (#5426)
* Correct custom data timestamp and match performance across languages

* Add EndTime property

* Add comment for crypto SetHoldings
11185
2021-03-30 14:48:59 -07:00
Colton Sellers 4a1485a291 QB Fundamental Test Fix (#5437)
* Use only 1 QB instance for fundamental tests, (want to see github workflow result)

* Fix small bug in test
11183
2021-03-30 06:42:39 -07:00
Alexandre Catarino d6072c88a5 Fixes LiveOptionChainProvider.FindOptionContracts (#5434)
`LiveOptionChainProvider.FindOptionContracts` handles the following data format:
`SPY  2021 03 26 190 000 C P  0 612 360000000`
where both existing `OptionRight.Call` and `OptionRight.Put` are declared in the same line.
11178
2021-03-29 13:39:41 -07:00
Colton Sellers 20910ca2dc Broken Regressions Fixes (#5421)
* Remove regression references to non-existant Python versions

* Adjust regressions estimated capacity not adjusted by #5389

* Adjusts regression algorithms so that they pass (Index/Index Options)

  * Changes start/end date on BasicTemplateIndexAlgorithm
  * Changes option pricing model to BlackScholes in
    IndexOptionCallITMGreeksExpiryRegressionAlgorithm

    - The root cause of why there are no greeks at times for these
      options was identified. It is most likely due to the underlying's
      VolatilityModel not having had enough data to be "warmed up",
      which means it will return a standard deviation of zero to the
      option pricing model, rendering most metrics as NaN.

* Adds missing index/index options regression algorithms

  - Regression algorithms are now 1-1 between C# and Python for
    Indexes/Index options. All regression tests are now passing

* Fixes broken BasicTemplateIndex regression algorithm

  * Previously traded SPY, but because we have no SPY data in Lean
    master, I instead opted for index options, since data for those
    dates is already included

* Deal with weekend for breaking test case

* Adjust DefaultEndDate test to always pass

* Check todays date for open

Co-authored-by: Gerardo Salazar <gsalaz9800@gmail.com>
11177
2021-03-29 13:35:03 -07:00
Jasper van Merle c333ccdc4a Check whether storage directory exists before enumerating it (#5432) 11176 2021-03-29 13:32:28 -07:00
Christian Korn 88c4a332bc Update PearsonCorrelationPairsTradingAlphaModel.cs (#5428)
Fix index of out bounds (#5427)
11171
2021-03-26 10:55:19 -07:00
Colton Sellers 5d762d16b2 GetFundamental Default End Date (#5401)
* Change default end date for GetFundamental

* Add DefaultEndDate test
11157 11167
2021-03-23 14:18:07 -07:00
Colton Sellers e2a0873b7c Fix Lean Warnings V1 (#5408)
Cleanup all non-breaking warnings
11155
2021-03-22 11:08:48 -07:00
Gerardo Salazar 31ebaaeaa9 Fixes live BTC futures contract crashing in IB brokerage (#5409) 11154 2021-03-22 08:48:58 -07:00
Jared 7625e232f4 Update readme.md 11151 2021-03-19 14:53:46 -07:00
Alexandre Catarino 63f3af7afe Remove decimal.py (#5406)
* Removes decimal.py

* Removes References to Decimal in Examples
11150
2021-03-19 14:17:05 -07:00
Colton Sellers 87b42f6fb5 Named Args Unit Tests (#5381)
Add regression and unit test
11145 11146 11147
2021-03-16 16:53:02 -07:00
Gerardo Salazar f9dc38efab Use trades per period instead of days for capacity calculation (#5389)
Use trades per period instead of days for capacity calculation
Updates regression algorithms
11144
2021-03-16 16:30:49 -07:00
Colton Sellers 5587efaadd Update Python Runtime dll location (#5398) 11142 2021-03-16 15:56:56 -07:00
Colton Sellers a642d53bf9 Specify clr-loader version (#5400) 11140 2021-03-16 14:50:47 -07:00
Colton Sellers 002151eab2 PythonNet 2.0.1 (#5390)
* Trigger rebuild

* Add Package QC PythonNet 2.0.1

* Update project files

* Push latest package

* Remove test package for shipping
11132 11135 11138 11139
2021-03-12 22:26:28 -03:00
Gerardo Salazar 4c085ff853 Adds Indexes and Index Options asset types (Backtesting/Live, IB only) (#5379)
* Add support for Index SecurityType  🚀 (#5364)

* Add Index SecurityType  🚀

* Extend SecurityIdentifier & Lean Data classes with Index support

* Add Index SecurityType  🚀

* Extend SecurityIdentifier & Lean Data classes with Index support

* Fixes

* Added index cross basic template demonstration

* WIP: Prototype index security type for LEAN as non tradable asset

* Re-adds Index entries to MHDB after rebase

* First steps to getting Index Options running

  * Looks at any instance where we pattern match for an option type
    and replaces it with a generic call to `.IsOption()` for easier
    extensibility in the future for additional option security types

  * Adds IndexOption security and misc. classes

  * Misc. changes, mainly related to any sort of special casing of
    equity options and made index options take the same path

* Enables index options data for backtesting

  * Adds new index options market hours to MHDB
  * Misc. bug fixes for index options
  * WIP: add live support for index options and indexes
  * Use OptionMarginModel for Index Options because they both use the
    same calculation for margin requirements

* Fixes contract not found errors on SPX index options and SPX index in IB

  * Turns out index options' last trading day is the day before expiry,
    which IB was expecting the last trading day.

* Add index option test cases (temp)

* LiveOptionChainProvider fix, use Symbol vs. ticker

  * Description updates to regression algorithms

* Fixes bug in live trading for indexes and index options

  * Adds overridable minimum price variation symbol property
  * Adds variable sized minimum price variation for index options
  * Adjusts symbol properties for index options
  * Misc. bug fixes

* Fixes option assignment simulation for European options

  * Updates index options regression algorithms (WIP)

* Fixes bug where index option exercise would trade index underlying

  * Fixes bugs where SecurityType.Index was getting flagged as tradable

* Regression algorithms updates and addresses review

  * Misc. style fixes and refactoring + a few bug fixes
  * Updates regression algorithms to run without runtime errors
  * Adds data for regression algos

* Sets DefaultOptionStyle on Canonical and support index options

* Update regression algos statistics

* Removes bad line in regression algorithm causing build to fail

* Minor tweaks

* Address review add comment about quoteBar parse scale

Co-authored-by: Balamurali Pandranki <balamurali@live.com>
Co-authored-by: Jared Broad <jaredbroad@gmail.com>
Co-authored-by: Martin-Molinero <martin@quantconnect.com>
11129
2021-03-12 20:46:23 -03:00
Jasper van Merle 3aa76d4289 Add report creator to Docker image (#5386) 11114 11119 11120 11121 11122 11124 11125 11127 11128 2021-03-11 14:42:26 -08:00
Martin-Molinero 5236fc202d Adding Symbol.Canonical (#5383)
- Adding Symbol.Canonical property which will be cached. Adding unit and
  regression tests
11112
2021-03-11 18:38:20 -03:00
quantify-cflynn 1ca4389ed2 Adds SharpeRatio indicator (#5348)
* RollingSharpeRatio Submission

Creation of RollingSharpeRatio indicator, utilizing LEAN engine. Tests were created and successfully passed by the indicator, using spy_rsr.txt as outside data file which was created during a prior running of the program.

* Fixed Test Case Loading and Added Indicator Function

Added the RSR() function to auto load the indicator in Algorithm\QCAlgorithm.Indicators.cs. Also added a reference for the test file ("spy_rsr.txt") in Tests\QuantConnect.Tests.csproj.

* Fixed SharpeRatio Indicator

Updated the base formula, indicator structure/call, and the testing data for the SharpeRatio indicator.

* Minor Fixes

- Removed dividend yield from calculation
- Fixed typos in code/documentation

* Minor Style Fix and Error Confirmation

- Changed style to match style guide better.
- Checking for confirmation that QuantConnect.Tests.Engine.DataFeeds.LinveTradingDataFeedTests.DelistedEventEmmited_Equity() is server side, as it runs locally and should not have been affected by prior changes

* Simplification and fixing of SR calculation

- Updates calculation to proper SR formula
- Utilizes IndicatorExtensions for SR calculation rather than manual calculation
- Defines counter for 1 extra period offset on warmup (otherwise first datapoint is inaccurate if warmup period is SharpePeriod length)

* Minor Fixes

- Removal of SharpePeriod and RiskFreeRate variables
- Substitution of (SharpePeriod + 1) for WarmUpPeriod
- Outdated comment fixes

* Resubmission for Mono Confirmation Error

Error detected on Git for this version of the program. An error should not occur as only comments and minor variables were edited. Resubmitting to see if it is a false positive mono error.

* Notation Fixes

Fixed notation regarding spacing and outdated comments.

* Removal of Counter Logic

- Replaces counter for warmup with improved IsReady logic

* Fixed Syntax

- Removed unused imports
- Fixed variable readability
- Fixed comments
- Replaced Tabs with spacing

Co-authored-by: quantify-cflynn <quantify-cflynn>
11111
2021-03-11 13:35:08 -08:00
Jared b8397db0b7 Usability buffer on allocation (#5385) 11110 2021-03-11 11:44:54 -08:00
Martin-Molinero d4ea5f7b04 Simplify cash limit allocation (#5382) 11106 2021-03-10 14:47:39 -08:00
Martin-Molinero 458272b2ea Fix mono running in research (#5380) 11100 2021-03-10 17:34:59 -03:00
Colton Sellers 6c7353d09a Trigger rebuild (#5377) 11084 11085 2021-03-09 18:44:18 -03:00
Colton Sellers 834d4a4d58 QC PythonNet 2.0 (#5376)
* Update to new QC PythonNet

* Update readme

* Remove Python.Runtime config, replaced by env var

* Allow local packages testing in repo

* Address Review

* Add the LocalPackages readme

* Update Jupyter Image

* Update Research ReadMe
2021-03-09 18:25:31 -03:00