11164 Commits

Author SHA1 Message Date
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
13032 13035
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
12998 12997
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
Martin-Molinero d739873daa Add aggregator reader (#5942)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* Add BaseDataCollectionAggregatorReader

- Add enumerable for BaseDataCollection
- Add BaseDataCollectionAggregatorReader
- Clean up CollectionSubscriptionDataSourceReader

* Address reviews

- Add new FileFormat that will be handled by the new Reader
- Adding unit tests for the new BaseDataCollectionAggregatorReader
- Some DataSourceReader duplication cleaning up

* Minor adjustment after some live trading tests
12975 12976 12977
2021-09-27 17:25:23 -03:00
Martin-Molinero 0f7dfe8ec8 Fix live ETF universe selection (#5938)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
- ETF live universe selection will behave the same as Coarse selection.
  Adding unit test
12961 12962 12963 12966 12972
2021-09-23 15:11:35 -03:00
Alexandre Catarino 58968bf05f Adds Warnings to MOO and MOO using Tick Data (#5937)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Adds Warnings to MOO and MOO using Tick Data
These warnings are meant to let the user know that it was not possible to find ticks marked with the `OfficialOpen`, `OfficialClose`, `OpeningPrints` or `ClosingPrints` flags.
12954 12955
2021-09-22 19:17:18 -03:00
Stefano Raggi 627f280100 IB brokerage updates (#5933)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* Disconnect from IB API before waiting for restart

* Update IBAutomater to v2.0.62

* Update IBAutomater to v2.0.63
12953
2021-09-22 18:52:00 -03:00
Alexandre Catarino 9ca57c2de9 Fixes Market On Close Fill of Equity Fill Model (#5913)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* Fixes Market On Close Fill of Equity Fill Model

Only use trade data (`Tick` with `TickTrade` type or `TradeBar`) to get the closing price, since MOC is filled with the closing price.

- Fix unit tests to show that the new implementation only fills with trade data from the current open market.
- Change regression tests to reflect the bug fix. All other changes are the consequence of using `TradeBar` instead of `QuoteBar`.

* Address Peer-Review

Fixes the logic with tick data: looking for the OfficalClose or ClosingPrints only apply if data from the extended market hours is included.
Adds additional logic to handle missing trade data.

* Refactors Timeout Logic and Adds It to MarketOnOpenFIll

-Refactors timeout logic to address peer-review and adds it to MOO fill too.
- Adds unit tests
12946 12949
2021-09-21 17:51:35 -03:00
Martin-Molinero 35c2951abb Tradier add retry logic. Clean up rate gate (#5935)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
- Add Tradier retry logic in case of an unexpected execution failure
- Clean up rate gate logic to use RateGate class
12945
2021-09-21 17:40:54 -03:00
Simon Judd 2c237b7f84 IB Brokerage - fix for futures contracts priced in cents (#5930)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
* Fix IB futures prices where PriceMagnifier != 1

* Fix deadlock in GetOpenOrdersInternal by moving ConvertOrder call out of event handler;
Minor refactor to combine NormalizePrice and ConvertPrice methods

* IB future and future options price magnifier

* Address review. IB API clean up

Co-authored-by: Martin-Molinero <martin@quantconnect.com>
12939 12943
2021-09-20 16:17:25 -03:00
Martin-Molinero 4e6e0c85c6 Lean exchange improvements (#5932)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* Lean exchanges improvements

- Adding new Exchange class to avoid exchange code clash.
  Adding and updating unit test

* Add Market for MapFile API

* Self review
12938
2021-09-20 13:50:15 -03:00
Colton Sellers a2ac956d53 Move WickedRenkoConsolidator to RenkoConsolidator as Default (#5931)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
* Rename Renko to ClassicRenko

* Rename WickedRenko to Renko

* Adjust tests and usages

* Backwards support WickedRenkoConsolidator

* Renames for consistency
12933 12935
2021-09-17 16:32:01 -03:00
Colton Sellers 5fecb77c8a Composite Indicator Fixes (#5929)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* Refactor for two types in composite indicator

* Fixes for unit tests

* Non generic indicator base

* Further seperate non-generic indicator base and generic input base

* Adjustments

* Remove generic CompositeIndicator

* Add test suite

* Make each method an individual case

* Address review

* Testing cleanup

Co-authored-by: Martin-Molinero <martin@quantconnect.com>
12926
2021-09-16 17:58:10 -03:00
Stefano Raggi 3e8f15a62f Fix IB restarts during weekends (#5926)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* Fix IB restarts during weekends

* Address review

- Task.Delay usage
- update default delay from 10s to 5m
12923 12925
2021-09-15 19:16:34 -03:00
Martin-Molinero 0931ae868a Fix multiple coarse selection algorithms (#5927)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
- Fix for live trading multiple coarse selections. Adding unit test
  reproducing issue.
12919 12921
2021-09-14 20:27:09 -03:00
Martin-Molinero e13df5c901 Fix null reference loading existing holdings and cash balance (#5925)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
12915
2021-09-14 11:20:03 -03:00
Martin-Molinero 7be1b7db1a Algorithm Language can be case insensitive (#5924)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
12910 12911 12912 12913 12914
2021-09-13 10:31:31 -03:00
Gerardo Salazar 024d416ddd Adds support for getting a Lean symbol based on FIGI, CUSIP, ISIN, SEDOL (#5922)
* Adds support for getting a Lean symbol based on FIGI, CUSIP, ISIN, SEDOL

* Address review: bug fixes for mapping, improve docs, cleanup & refactor

  * Make LocalZipMapFileProvider and LocalZipFactorFileProvider only
    initialize if they haven't been initialized yet.

* Address review: makes ISIN, SEDOL, CUSIP case-insensitive

  * Cleans up map file provider in SecurityDefinitionSymbolResolver
  * Modifies some test cases to test for case-insensitivity

* Add null check for SecurityDefinitions

* Fix unit tests

Co-authored-by: Martin-Molinero <martin@quantconnect.com>
2021-09-10 19:16:18 -07:00
Martin-Molinero eb2dbe2af7 Fix FuncSecuritySeeder for python (#5923)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
- Fix funcSecuritySeeder for python. Adding regression algorithm
12900
2021-09-10 19:28:49 -03:00
Colton Sellers 8358c394e1 Support all security types for benchmarks (#5919)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* Adjust benchmark subscription to dynamically determine best resolution

* Get types from SM

* Add red/green test set for security types
12894 12896
2021-09-10 16:58:31 -03:00