11181 Commits

Author SHA1 Message Date
Martin-Molinero 0327b2012c Add default value for Exchange security types (#6032)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
13134 13138 13139 13147 13148 13149 13150 13152 13157 13158 13151 13146
2021-11-01 12:05:15 -03:00
Martin-Molinero cd5e1d9c54 Can serialize unknown exchange. Adding test (#6031)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
13130
2021-10-29 09:13:52 -07:00
Ricardo Andrés Marino Rojas fc6ddc2120 Feature 5988 WarmUpIndicator() method for indicators written in Python (#6027)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
* Implement IIndicatorWarmUpPeriodProvider
- Implement IIndicatorWarmUpPeriodProvider in PythonIndicator.cs
- Make a unit test to check whether the WarmUpPeriod is working as expected
- Make a regression test to check the new feature at a system level

* Nit change

* Change Period parameter for WarmUpPeriod parameter
- Change regression test to check if the new parameter keep backwards compatibility with indicators that do not set WarmUpPeriod

* Documentation change

* Fix tests bugs
- In CommonIndicatorTests.cs before finish the test it checks the period.value with the number of samples but for default the period.value was set to -1

* Change names

* Change WarmUp and RegisterIndicator methods
- Lean WarmUp indicator skip custom python indicators that don't define WarmUpPeriod parameter

* Call WarmUpIndicator manually
- Add a new "bridge" method called WarmUpIndicator in QCAlgorithm.Python.cs to set up everything to call WarmUpIndicator in QCAlgorithm.Indicators.cs
- Change the regression algorithm to warm up the indicators manually

* Remove unnecessary code and add more tests

* Nit change

* Revert "Nit change"

This reverts commit da411f59c9e4295d75a11c6c581f615a938dd2c6.

* Fix bugs

* Try fix bugs

* Add C# regression test
- More nit changes
- Fix bugs

* Requested changes

* Remove unnecessary code

* Requested changes

* Nit changes
- Add new Python class to check a custom indicator, which doesn't inherits from PythonIndicator, warms up properly

* Reduce redundant code

* Fix bug and add more unit and regression tests

* - Add more unit tests

* Nit change

* Test cleanup

Co-authored-by: Martin-Molinero <martin@quantconnect.com>
13129
2021-10-28 20:29:22 -03:00
Ricardo Andrés Marino Rojas 013b9ea850 Set WarmUpPeriod value in MarketProfile constructor (#6029)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
- Remove unnecessary attribute `_period` in MarketProfile
- Set the value of WarmUpPeriod to the period in MarketProfile constructor
- Fix unit test to check VolumeProfile and TimeProfile indicators are being warmed up properly and its WarmUpPeriod parameter isn't zero
13128
2021-10-28 19:54:11 -03:00
Martin-Molinero 9f29e3bf4e Some performance improvements for IndexOptions (#6025)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
- Some performance improvements for IndexOptions specially affects
  debugging C# algorithms.
13124 13125
2021-10-27 20:26:51 -03:00
Alexandre Catarino 4ecdf14ce8 Include Security Master Url to ApiDataProvider Error Message (#6023)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
13113 13115 13116 13117 13118 13123
2021-10-27 14:58:15 -03:00
Martin-Molinero ede2d4a5e4 Lazy loading of the SecurityDefinition file (#6024)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
- Perform a lazy loading of the security definitions file. Adding unit
  tests
13112
2021-10-27 14:57:50 -03:00
Martin-Molinero 8c71dbc8ba Revert "Feature 5988 IIndicatorWarmUpPeriodProvider for custom PythonIndicator (#5992)" (#6022)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
This reverts commit 995f598999.
13110
2021-10-26 22:07:22 -03:00
Martin-Molinero d17865b2cf CoinApi read previous date file (#6019)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
- If available, CoinApi converter will read previous date files to
  rescue initial midnight ticks for the processing date. Also make sure
  to drop ticks from tomorrow
13106
2021-10-25 20:26:12 -03:00
Martin-Molinero 7b3b560dea Foundation update CVXPY 1.1.15 (#6020)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
- Update cvxpy python package version to latest 1.1.15. To avoid
  installation issue `error in cvxpy setup command: use_2to3 is invalid`
13105
2021-10-25 18:45:07 -03:00
Ricardo Andrés Marino Rojas 995f598999 Feature 5988 IIndicatorWarmUpPeriodProvider for custom PythonIndicator (#5992)
* Implement IIndicatorWarmUpPeriodProvider
- Implement IIndicatorWarmUpPeriodProvider in PythonIndicator.cs
- Make a unit test to check whether the WarmUpPeriod is working as expected
- Make a regression test to check the new feature at a system level

* Nit change

* Change Period parameter for WarmUpPeriod parameter
- Change regression test to check if the new parameter keep backwards compatibility with indicators that do not set WarmUpPeriod

* Documentation change

* Fix tests bugs
- In CommonIndicatorTests.cs before finish the test it checks the period.value with the number of samples but for default the period.value was set to -1

* Change names

* Change WarmUp and RegisterIndicator methods
- Lean WarmUp indicator skip custom python indicators that don't define WarmUpPeriod parameter

* Call WarmUpIndicator manually
- Add a new "bridge" method called WarmUpIndicator in QCAlgorithm.Python.cs to set up everything to call WarmUpIndicator in QCAlgorithm.Indicators.cs
- Change the regression algorithm to warm up the indicators manually

* Remove unnecessary code and add more tests

* Nit change

* Revert "Nit change"

This reverts commit da411f59c9e4295d75a11c6c581f615a938dd2c6.

* Fix bugs

* Try fix bugs

* Add C# regression test
- More nit changes
- Fix bugs

* Requested changes

* Remove unnecessary code

* Requested changes

* Nit changes
- Add new Python class to check a custom indicator, which doesn't inherits from PythonIndicator, warms up properly

* Reduce redundant code
2021-10-25 18:08:57 -03:00
Martin-Molinero 43c271a568 Atreyu template algorithm change traget SPY exchange (#6016)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
13101
2021-10-25 15:43:35 -03:00
IlshatGaripov 2e4252c92b LiveTradingResultHandler -> changes access modifier of SetNextStatusUpdate (#6015)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
13100
2021-10-25 11:17:35 -03:00
Adalyat Nazirov 0f189aa2b4 FTX brokerage rejects STOP order if market price missed (#6009)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* cannot submit stop orders with bad trigger price

* unit tests

* expect price data
13099
2021-10-25 11:14:41 -03:00
IlshatGaripov f55588e4c6 SecurityHolding -> impl. ToString() (#6014)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
13098
2021-10-25 11:07:34 -03:00
Martin-Molinero 58ccdee1b1 PythonNet version bump 2.0.10 (#6010)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
13095
2021-10-22 20:27:38 -03:00
Colton Sellers 6bd2859f64 Update to PythonNet 2.0.9 (#6004)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
13087 13094
2021-10-21 20:06:38 -03:00
Alexandre Catarino 3ff7882dbf Round AverageLoss to Avoid Very Small Numbers (#6003)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
13083 13085 13086
2021-10-21 17:00:31 -03:00
Martin-Molinero dace6d7ee1 Fix index live target exchange (#6000)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
13073 13080 13081 13082
2021-10-20 17:26:25 -03:00
Colton Sellers 71d9eed07e BuyingPowerModel Fixes (#5996)
* Refactor error message for reproducability

* WIP Refactor GetMaximumOrderQuantityForTargetBuyingPower

* Additional tweaks and tests

* Address shorted margin case

* Reinstate tests with new modified function

* Update regression

* Some cleanup

* Expand test set

* Refactor solution

* Address review

* Final adjustments and cleanup

* Expand error message for GetAmountToOrder for safety and reproducibility

* Address reviews
2021-10-20 16:37:20 -03:00
Stas Kotykhin c4a4550a66 Override History provider in kraken environment (#5998)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* add history-provider field to config.json

* Add comment
13071
2021-10-20 16:36:34 -03:00
bmello4688 67081a8a05 Add virtual overrides for pivotpointshighlow computations (#5987)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
* Add base class for pivotpointshighlow

* abstracts do not work well with python switch to virtuals and use pivotpointhighlow as base implementation

* added missing documentatino header

* moved reset back to original location
13062 13066 13067 13068 13069 13070
2021-10-19 21:45:18 -03:00
alexgallotta a567053404 fix build command with dotnet (#5990)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
13060
2021-10-18 16:55:56 -03:00
Martin-Molinero 56b8ccc4b4 CoinApi log error on duplicate symbol (#5989)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
13059
2021-10-15 20:31:55 -03:00
Martin-Molinero 5f65677ede Add suuport for coinApi kraken ftx exchanges (#5985)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
13056
2021-10-15 11:24:30 -03:00
Ricardo Andrés Marino Rojas def916aed1 Add IIndicatorWarmUpPeriodProvider for WindowIndicator.cs and Identity.cs indicators (#5984)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
- Implement IIndicatorWarmUpPeriodProvider interface in both indicators
- Add test to check the new functionality is working as expected. To test WindowIndicator IIndicatorWarmUpPeriodProvider there was used WindowIdentity indicator tests because that indicator only inherits from it
13055
2021-10-15 11:10:59 -03:00
Adalyat Nazirov 46ce138fa1 move methods for further usage across other brokerages (#5981)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
13054
2021-10-14 17:08:11 -03:00
Martin-Molinero b8768ae274 Add FOPs price magnifier (#5979)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
* Add FOPs price magnifier

* Improve unit tests
13050
2021-10-14 11:57:48 -03:00
Ricardo Andrés Marino Rojas db04b5e110 Feature 5930 price magnifier (#5977)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
* Update SPDB with price magnifier parameter
- Add a new column for new parameter in symbol-properties-database.csv
- Change InteractiveBrokersBrokerage.cs implementation of GetContractPriceMagnifier() method in order to get the parameter directly from the SPDB
- Add test in SymbolPropertiesDatabaseTests.cs to check if the new parameter is loading properly

* Change GetContractPriceMagnifier() method name and implementation
- Change NormalizePriceToLean() and NormalizePriceToBrokerage() methods

* Nit change in GetSymbolPriceMagnifier() method

* Remove GetSymbolPriceMagnifier() method
- Remove redundant and unnecessary parameters in NormalizePriceToLean() and NormalizePriceToBrokerage()

* Requested changes and SPDB update
- Update SPDB with minimum order size parameter for futures in cents. The minimum order size parameter was extracted from the CME group API

* Address reviews. Adding unit test for failing case

Co-authored-by: Martin-Molinero <martin@quantconnect.com>
13049
2021-10-14 11:16:23 -03:00
Colton Sellers cff3640f15 Update to PythonNet 2.0.8 (#5978)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
13048
2021-10-13 20:19:06 -03:00
Martin-Molinero b5574a7986 Do not emit zero quantity Exercise Order events (#5976)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
- BrokerateTransactionHandler will not emit zero quantity Exercise order
  events. Updating unit tests
13044 13045 13047
2021-10-12 19:38:37 -03:00
Martin-Molinero c638f82337 Adjust Bitfinex currency fee error message (#5975)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
13042
2021-10-12 17:05:27 -03:00
Adalyat Nazirov 3a591c3a72 Fix Binance ExchangeInfo downloader (#5965)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
* fix exchangeinfo downloader

* normalize data, update symbol properties

* min ordersize should be in base currency

* check min order size using quote currency price

* check order size in quote currency

* improve checks

* improve code; more unit tests

* more description

* fix failing test
13040 13041
2021-10-11 12:36:41 -03:00
Martin-Molinero fdfb1b54c0 Add Binance debugging logs (#5974)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
13039
2021-10-11 11:55:12 -03:00
Adalyat Nazirov 7cfdd1243f FTX brokerage essentials (#5963)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* FTX config boilerplate

fixup

* required

* order props

* make orger props setter public

* add market props

* brokerage model

* deny modify order directly

* update markets

* unit tests

* fix market properties

* add comments

* return security benchmark

* fix fee calculation

* dont change access modifiers

* check brokerage CanSubmitOrder using min order quantity

* fix ticker values - use lean notation

* fix fee model

* fix error message
13038
2021-10-08 19:16:38 -03:00
Stas Kotykhin 3fc042af33 Move bar aggregators to utils, add time overloads & add check of orderType for Kraken (#5969)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
* Move Aggregate Quote and Trade Bars to utils

* Add decimal and long overload to UnixTimeStampToDateTime

* Add Kraken OrderType check in CanSubmitOrder

* PR !5969 review fixes
13037
2021-10-08 17:59:32 -03:00
Martin-Molinero 1d6fed8843 Update python to 2.0.7 (#5968)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
13036
2021-10-08 12:55:14 -03:00
Colton Sellers 2109394060 Add subset test after dropping 'symbol' (#5966)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
13035 13032
2021-10-06 18:21:33 -03:00
Colton Sellers d2d99b1f10 Algorithm Sampling and Statistics Fixes (#5936)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* Implement scheduled event sampling solution

* Use UTC time, only update daily portfolio value once a day

* For daily resolutions sample chart always

* Cleanup

* Drop resample daily all together

* Force final sample

* Regression updates

* FIx LiveResultHandler to update portfolio and benchmark values outside of sampling event

* Name the daily sampling event

* Address review pt 1

* Drop force and use reference wrapper

* Adjust tests

* Fix warning for Benchmark Timezone Misalignment and also add test

* Fix for daily resolution orders and test adjustments

* Also warn on universe settings with daily resolution

* Update missed regression

* Fix reference wrapper use

* Update regression after rebase

* Add values back in for Daylight Algo

* Have statistics builder skip day 1 performance

* Regression adjustments

* Test adjustments

* Update regression unit test

* Adjust some regressions starts to show performance values

* Add hourly algorithm for beta comparison

* Address missing Python regression changes

* Remove null comment
13031
2021-10-05 19:31:25 -03:00
Martin-Molinero 659735946a Bitfinex fees cash accounts (#5957)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* Bitfinex Fee adjustment

- Fix for bitfinex fee adjustment for cash account type only happen if
  the currencies are the expected ones, else log message.

* Adjust error handling to terminate algorithm

* Add bitfinex TESTBTCTESTUSD

* Minor improvements

- Add bitfinex test symbols to the SPDB
- Make SecurityDefinitionSymbolResolver log using trace
- Minor tweak for Bitfinex DQH lock contention
13014 13015 13016 13017 13019 13020 13024 13025 13018
2021-10-04 18:15:32 -03:00
Stefano Raggi 29294cb1f4 Transaction handlers - minor updates (#5956)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
- Move debug logging of order events from Brokerage to BrokerageTransactionHandler
- Override CurrentTimeUtc in BacktestingTransactionHandler
13008 13007 13009 13010 13011
2021-10-01 19:09:08 -03:00
Ronit Jain 4546bbe9b1 Fix missing reference price when creating last entry (#5952)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* Fix code styling changes

* Cosmetic change

* Add reference price 1 for last entry

* Fix refernece price
12999 13003
2021-10-01 11:37:58 -03:00
Ricardo Andrés Marino Rojas af958f0ce4 Bug 5904 minimum order size rejected order (#5949)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* - Update symbol-properties-database.csv, SymbolPropertiesDatabase.cs and SymbolProperties.cs with a new column for MinimumOrderSize parameter for Crypto type
- Change CanSubmitOrder() method implementation in GDAXBrokerageModel.cs to get the MinimumOrderSize from the security SymbolProperties directly
- Add CanSubmitOrder() method in Binance, Bitfinex and Kraken Brokerages models
- Add tests to check if CanSubmitOrder() method is working as expected in Binance, Bitfinex, Kraken and GDAX brokerages models
- Add tests to check if MinimumOrderSize parameter is loading correctly from symbol-properties-database.csv

* Revert "- Update symbol-properties-database.csv, SymbolPropertiesDatabase.cs and SymbolProperties.cs with a new column for MinimumOrderSize parameter for Crypto type"

This reverts commit e0fd66a5fa5215a6fccb98b64d4e3bf709007fdf.

* Revert "Revert "- Update symbol-properties-database.csv, SymbolPropertiesDatabase.cs and SymbolProperties.cs with a new column for MinimumOrderSize parameter for Crypto type""

This reverts commit b0f37935fc334ba8ff3b8ab09b7d979e4e731526.

* Requested changes in Crypto brokerage models
- Remove unnecessary commas in symbols-properties-database.csv
- Add TestHelpers class to reuse GetSecurity() method
- Add IsValidOrderSize() method in DefaultBrokerageModel class
- Remove unnecessary classes for brokerage models test helpers

* Nit change
- Remove unnecessary attribute from DefaultBrokerageModel.cs

* Nit change

* Nit changes and Regression test
- Add Bitfinex BTCUSD hourly data for 2 days
- Add regression test BuyBTCWithLessThanOneDollarAlgorithm.cs to test that the order size is taking into account when placing or updating an order
- Nit changes

* Change CanUpdateOrder() implementation
- CanUpdateOrder() now checks if the requested quantity value is valid

* Requested Changes
- Change regression algorithm BuyBTCWithLessThanOneDollar.cs name and implementation

* Nit changes
12997 12998
2021-09-30 18:30:04 -03:00
Stefano Raggi 6c42a266be IB brokerage - Update option positions at contract expiration (#5880)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* IB brokerage - Update option positions at contract expiration

* Add handling of live option expiration events

* Address review

- Nits

* Refactor option notification events [WIP]

* Add early exercise+assignment unit tests

* Fix sign bug in IB ExerciseOrder

* Address review

- log unexpected position
- add unit test cases for partial exercise/assignment
12995 12996
2021-09-30 13:48:41 -03:00
José Emiliano Cabrera Blancas 8b7da686ea Fix MovingAverageType in KeltnerChannels Indicator (#5954)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
The Simple Moving Average was always used instead of the one passed to
the KeltnerChannels constructor.
12990
2021-09-29 20:48:07 -03:00
Martin-Molinero d3280c5e60 Move VX margin files (#5948)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
12987
2021-09-28 14:21:07 -03:00
Stas Kotykhin fe1f22543f Add NonUpdateableLimitIfTouchedOrderTestParameters class (#5947)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
12986
2021-09-28 13:16:04 -03:00
Stefano Raggi 57ddbbbf05 IBAutomater updates (#5946)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
12984
2021-09-28 11:45:05 -03:00
Martin-Molinero 9579c4263b Fix history requests so they ignore internal subscriptions (#5945)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
- Fix for history requests so that they ignore internal subscriptions
  accordengly. Adding regression test reproducing issue
12982
2021-09-27 20:31:05 -03:00
Martin-Molinero f082a40f34 Add missing comments (#5944)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
12978
2021-09-27 18:48:53 -03:00