11245 Commits

Author SHA1 Message Date
Alexandre Catarino 3d3733c0fb Adds Market.HKFE to InteractiveBrokersFeeModel (#6127)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Adds `Market.HKFE` to `InteractiveBrokersFeeModel` in the Futures Options case.
13397 13398 13399 13400 13401 13403 13404 13409 13410 13411 13402
2021-12-22 19:32:07 -03:00
Martin-Molinero 1303ccf843 Update readme.md
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
13395 13396
2021-12-22 17:16:41 -03:00
Martin-Molinero 3b5f3fcf42 Update readme.md
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
13394
2021-12-22 16:18:09 -03:00
Andreas Sundebo e2de241c2b Feature 5090 add api optimization methods (#6108)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
* Move Optimizer-related DTOs and JSON converters into Common/Optimizer

* Add REST methods for Optimization

* Move OptimizationStatus into Common

* Change optimizationId parameter type to string

* Update Optimization and add lightweight optimization object

* Rename lightweight optimization to BaseOptimization and remove unneccessary properties

* Remove snapshotId from Optimization, add ParameterSet to Backtest

* Add missing IApi.cs method signatures

* Move ParameterSet into Common

* Replace Backtest with OptimizationBacktest

* Update UpdateOptimization to not include null or empty name and layout params in the request

* Change Objective targetTemplate regex pattern from ['(.+)'] to (.+) to prevent escaping target strings without whitespace

* Return Estimate object when calling EstimateOptimization

* Use DefaultNamingStrategy when serializing constraint operators

* Revert "Change Objective targetTemplate regex pattern from ['(.+)'] to (.+) to prevent escaping target strings without whitespace"

This reverts commit fbe7de0fd77dccc62e8c52c42a4ec9c18347acb2.

* Update Api method signatures

* Add unit tests

* Fix XML comment referring to the old class name

* Fix XML summary for OptimizationResponseWrapper

* Address review feedback
- Remove unused testOrganizationId
- Change NodeType from string to NodeType enum
- Clarify unit types for Estimate time and balance
- Simplify JsonConverter classes

* Add accessors to Common/Api classes

* Define performance metrics names in PerformanceMetrics class

* Remove unnecessary branching logic from GetSeriesValues method

* Add crefs and examples to XML comments in the Api class

* Revert "Change NodeType from string to NodeType enum"

* Remove layout param from UpdateOptimization method

* Backtest property ParameterSet should be of type ParameterSet

* Add asserts for deserialization in OptimizationBacktestJsonConverterTests

* Replace the three target-related properties with Criterion

* Add serialization and deserialization tests for Optimization

* Remove Optimization Serialization test

* Add EstimateDeserialization test

* Add asserts for integration tests

* Address self review

* Revert test case

* Update Nodes.cs

* Update Nodes.cs

* Set Aborted status when Optimization fails to start

* Add ParameterSetJsonConverter and ParameterSetJsonConverterTests

Co-authored-by: Martin-Molinero <martin@quantconnect.com>
13390 13393
2021-12-22 13:14:56 -03:00
Martin-Molinero 68e2a9170a Do not send internal SecurityChanges to Algorithm (#6118)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* Do not send internal SecurityChanges to Algorithm

- Will not send internal security changes to the Algorithm by default.
  Following custom security changes filter pattern. Updating regression
  algorithms to assert behavior.
- The universe member will know wether it was added with internal
  configurations or not

* Address reviews use a separate collection for internals

* Refactor solution. Adding security changes constructor class
13384
2021-12-21 20:24:32 -03:00
Adalyat Nazirov d395f704b3 Bug 6115 adjust dates (#6124)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* GH-6115: adjust dates

* fix

* use another approach

* Add lean data writter multiple days data unit test

Co-authored-by: Martin-Molinero <martin@quantconnect.com>
13382
2021-12-21 17:33:36 -03:00
Martin-Molinero 4d1fc7e05a Handle security added and removed in the same loop (#6120)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* Handle security added and removed in the same loop

- Correctly handle adding and removing a security in the same loop.
  Adding regression test

* Adding comments
13381 13377
2021-12-21 11:59:45 -03:00
Martin-Molinero e3a562d3c9 Add file and line number to documentation attribute (#6122)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
13376
2021-12-20 17:30:04 -08:00
Martin-Molinero 4fdd60d146 Use 64 when saving zips update dotnetZip (#6114)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
13369
2021-12-20 16:39:06 -03:00
Martin-Molinero abbb50e209 Minor improvements for data reading and caching (#6113)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
* Minor improvements for data reading and caching

* Address reviews

* Adjust zip cache error check
13359 13360 13361 13363 13364 13365 13368
2021-12-16 19:58:37 -03:00
Alexandre Catarino 0e1cc288a6 Change Default Market of CFD to OANDA (#6107)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Oanda is currently the only provider.
13348 13349 13350 13354
2021-12-13 17:58:57 -03:00
Martin-Molinero 3b826535c7 Fix for ConcurrentDictionary Thread Safety (#6105)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
- ConcurrentDictionary with OrderBy is not thread safe, adding thread
  safe extension method. Adding unit tests
13347
2021-12-13 10:45:58 -03:00
Martin-Molinero 59da486e30 IB will correctly create non USD currency contract (#6103)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
- IB will create contract based on SPDB entry for symbol. Adding unit
  test
13335
2021-12-10 13:56:32 -03:00
Martin-Molinero f42d7bb3a2 Align universe security and configuration TZ (#6102)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
* Align universe security and configuration TZ

- Make sure universe security and configuration tz are aligned always.
  Adding unit test reproducing issue

* Address review UserDefinedUniverse will use UTC TZ
13330
2021-12-09 15:53:56 -03:00
Martin-Molinero 87bd0d7792 CompositeDataQueueHandler handles duplicate configs (#6101)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* CompositeDataQueueHandler handles duplicate configs

- CompositeDataQueueHandler will handle duplicate subscriptions sharing
  the same config. Adding unit tests

* Refactor bug solution after review

- LiveSubscriptionEnumerator will not long perform any symbol mapping
  but will just trigger a new subscription call when remapped.
- CompositeDHQ will handling symbol mapping and keep track of these
  mapped configs to trigger unsubscribe accordengly. Adding unit tests

* Adjust solution after review

- To avoid breaking uniqueness of SubscriptionDataConfig will be adding
  a private `mapped` property that will change equality of mapped
  configs to avoid them clashing. Adding unit tests

* Rename IDQH subscription extension methods
13329
2021-12-09 14:53:04 -03:00
Louis Szeto 8ca9258e70 API Reference for docs v2 (#6098)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
API Reference for docs v2 

Co-authored-by: Alexandre Catarino <AlexCatarino@users.noreply.github.com>
13325
2021-12-08 16:25:36 -08:00
Martin-Molinero 72105539fc Minor Exchanges cleanup (#6100)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
13320
2021-12-06 19:27:27 -03:00
Anuj Patel 589e8a9293 fix Kraken fee model (#6096)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
* Update KrakenFeeModel.cs

* Update KrakenFeeModelTests.cs

Co-authored-by: Anuj Patel <91538343+anuj-mitul-patel@users.noreply.github.com>
13318
2021-12-06 11:59:20 -03:00
Martin-Molinero dd27a382f7 Composite data queue handler IUniverseProvider (#6097)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* Minor performance improvements

* CompositeDataQueueHandler is UniverseProvider

- CompositeDataQueueHandler implements the UniverseProvider interface.
  Adding unit tests
13317
2021-12-06 10:27:18 -03:00
Jovad Uribe 62a8aee38c Kaufman Efficiency Ratio Indicator (#6050)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* Indicator

* Fixed logic error

* Removed old files, added KER into KAMA

* Removed old comments

* Added requested changes

* Minor clean up

* Refactors KaufmanEfficiencyRatio and KaufmanAdaptiveMovingAverage

Co-authored-by: Martin-Molinero <martin@quantconnect.com>
Co-authored-by: Alexandre Catarino <AlexCatarino@users.noreply.github.com>
13315
2021-12-04 18:55:09 -03:00
Alexandre Catarino 7e7c27416b Updates KeltnerChannels to Update MiddleBand with EndTime (#6084)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* Updates KeltnerChannels to Update MiddleBand with EndTime

* Adds Unit Test

This unit test shows that the timestamp of the MiddleBand and the indication are aligned as expected.
13313
2021-12-03 19:43:32 -03:00
Martin-Molinero 26f2f88c67 Add documentation attribute default value (#6095)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
13311
2021-12-03 18:47:47 -03:00
Martin-Molinero c08c129860 Add documentation attribute (#6094)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
13309
2021-12-03 18:23:06 -03:00
Martin-Molinero bae10389ae Update readme.md
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
13307 13308
2021-12-03 17:15:58 -03:00
Martin-Molinero 4301d7cead Update readme.md 2021-12-03 17:08:06 -03:00
Martin-Molinero d49f1d0d6c Update readme.md 2021-12-03 16:34:47 -03:00
Ronit Jain 264c3c8374 Composite IDQH - Support multiple live data feeds (#6047)
* initial commit

* Follow IDQH implementation

* Expect a list of data handlers from LiveNodePacket

* Return null if can not subscribe

* refctor to add check for subscription

* initialze null

* Add tests

* Check subscribe retuns null/not-null

* cleanup

* Read all required IDQH credentails to job

* Use CDQH to handle all IDQH instances

* constructor abstraction to call from setjob

* use flag

* remove redundant because derived will call initialize on it

* abstract and initialize from setjob

* handle null enumerators

* get creds from data handlers

* handle single data handler value from data-queue-handler

* Fix to support a json array

* Fix missed constructor call

* change access modifier to access from Tests files

* Add test to get brokerageFactory from dataQueueHandler

* Fix init flag to handle all conditions

* Add docs

* initialize from setjob

* Check if websocket open before using

* change defination of initialzie to include tradier

* clean up

* change defination

* fix wrong api key name

* return empty enumerator

* check websocket open before sending request

* check connection before subscribing

* fix to include more cases

* check websocket open before sending request

* Minor refactoring

* reafctor and use IsConnected

* remove unused

* clean up

* Fix test cases

* reverse change

* include config changes

* connect to websocket from setjob

* check websocket connection from setjob

* clean up

* include condition for IDQH that are not brokerage

* Address review

* Add market check condition before subscribe

* Remove deprecated

* Minor fix for deserializing data queue handler

Co-authored-by: Martin-Molinero <martin@quantconnect.com>
2021-12-03 16:18:41 -03:00
Martin-Molinero 8a1f67edfc Minor fixes (#6093)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
- Update Atreyu fees
- Remove redundant check in AlphaStreamBrokerageModel
- Fix option contract removal and second addition. Adding unit test
13301
2021-12-03 12:54:49 -03:00
Martin-Molinero 5f434f2fa5 SetupHandlers will exit if errors on initialize (#6092)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
- SetupHandlers will exit right away if detect errors on initialize.
  Adding unit tests
13299 13300
2021-12-02 19:24:51 -03:00
Martin-Molinero e37f8ae878 Fix for adding continuous future and future contract at the same time (#6091)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
- Fix for adding continuous future and manually adding contract at the
  same time. Continuous future was using the user defined universe
  symbol and caused clashes. Adding regression test reproducing the issue.
13297
2021-12-02 18:13:52 -03:00
Martin-Molinero b4e95209f6 Fix for IB Option position race condition (#6090)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
- Fix for IB option position update race condition, where the BTH would
  incorrectly assume it should trigger an early option assignment. Adding unit tests
13295
2021-12-02 17:09:50 -03:00
Martin-Molinero ea65c61dc8 Minor InteractiveBrokers fix (#6089)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
- IB needs to notify the `DefaultBrokerageMessageHandler` we have re
  connected else it might kill the algorithm
13292
2021-12-01 19:26:25 -03:00
Ricardo Andrés Marino Rojas 6bf6ff1a6a Fix bug in ConsumeMultipleMinutes() test (#6083)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* Give `code()` more time per iteration

* Another proposed solution

* Revert "Another proposed solution"

This reverts commit 29bf5a7554363afb27affb28730c6be1e2a54807.

* Add an AutoResetEvent field in `TimeConsumer()`

* Avoid change TimeMonitor implementation

* Remove changes in `TimeConsumer.cs`

* Requested changes

* Avoid re-implementation
13287 13288 13289 13290 13291
2021-11-30 21:44:42 -03:00
Martin-Molinero d1a35e6281 Continuous Futures Refactor. Live Mappings (#6076)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
* Continuous Futures Refactor. Live Mappings

- Adding support for live mappings. LiveTradingDataFeed will handle any
  symbol mapping at the configuration layer and resubscribe through the
  IDQH
- Refactoring continuous futures adding ContinuousFutureUniverse that
  will select the currently mapped security

* Minor fixes

- Remove addition of configurations in UniverseSelection step, leave
  resposability for universe.
- LiveTradingDF future unit test will only assert slice data for non
  internal feeds.
- ContinuousContractUniverse will respect internal option interest
  subscription

* Address review
13286
2021-11-30 21:38:50 -03:00
Martin-Molinero fed1fa929b Fix low resolution index TradeBar parsing (#6081)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
- Fix low resolution Index TradeBar parsing. Updating unit tests. Adding
  unit tests
13279 13281 13282
2021-11-29 12:59:16 -03:00
Ricardo Andrés Marino Rojas 9e7962f5a2 Add Overload in SecurityTransactionManager Methods to Support Python Functions (#6068)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
* Add PyObject overload

* Nit changes and unit tests

* Regression tests

* Nit changes

* Requested changes

* Requested changes

* Handle null parameter cases
13276 13277
2021-11-26 16:15:54 -03:00
Andreas Sundebo 3e66733413 Properly handle pending CancelOrderRequests during backtesting (#6021)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* Properly handle pending CancelOrderRequests

To avoid unneccessary "Insufficient buying power to complete order" errors showing up as Invalid orders we need to skip further processing of pending CancelOrderRequests in the BacktestingBrokerage and instead let them be properly removed during the next transaction handler run.

* Update BacktestingBrokerage.cs
13275
2021-11-26 14:47:30 -03:00
Colton Sellers c11a09e08a Feature Index Option Low Resolution Support (#6075)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* Activate Index and IndexOptions low res

* Add Index and IndexOption low res data

* Add IndexOption regressions

* Fix bug with IndexOption QuoteBar data not being scaled

* nit - update comment for _scaleFactor

* Update data and regressions to reflect fix in data

* Tweak regressions
13274
2021-11-26 13:11:35 -03:00
Anuj Patel f06bab944d fix incorrect Kraken and Coinbase Pro fee values (#6071)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* fix Coinbase Pro fee values

fee values changed to reflect most recent fee schedule, see 
* https://blog.coinbase.com/updates-to-coinbase-pro-fee-structure-b3d9ee586108
* https://help.coinbase.com/en/pro/trading-and-funding/trading-rules-and-fees/fees
* https://pro.coinbase.com/fees

* fix Kraken fee values

all fee values multiplied by 1/100 to correct inaccuracy, see
* https://www.kraken.com/features/fee-schedule#kraken-pro

* changes time to after latest fees have been set and replaces old expected values
13269 13273
2021-11-24 16:57:20 -03:00
Ricardo Andrés Marino Rojas df63b6f5d6 Renaming requested changes (#6072)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
13263 13266
2021-11-24 09:58:37 -03:00
Colton Sellers 1358bd8115 Future and FutureOption low res support (#6069)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* Fixes for FutureOptions support in LeanData

* Add CreateCanonicalOption() utility function for Symbol.cs

* Add aggregated Futures/FuturesOptions data to Lean

* Add FutureOptions regressions for daily/hourly data

* Allow Futures to be added with low resolution

* Add Future regressions using hour/daily data

* Nit - Python Class names

* Add reviews

* Add alias into CreateCanonicalOption
13262
2021-11-24 09:53:21 -03:00
Martin-Molinero 40cc7a808a Skip subscribing to canonical symbols (#6070)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
13259 13260
2021-11-22 21:00:45 -03:00
Martin-Molinero e3a4fa1838 Update readme.md
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
13257 13258
2021-11-22 12:54:51 -03:00
bmello4688 1d8243ecac Add tick type to data downloader get (price data) call in order for a… (#6057)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* Add tick type to data downloader get (price data) call in order for api's with rate limits to handle not making an api call at all.

* Added DTO object to pass into data downloader get

* Added missing header for new file

* Address review. Minor tweaks

Co-authored-by: Martin-Molinero <martin@quantconnect.com>
13256
2021-11-22 12:00:16 -03:00
Martin-Molinero a8c81cad2a Fixes for continuous futures history requests (#6067)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* Fixes for continuous futures history requests

- Fixes for continuous future history requests and warmup. Adding
  regression test

* Address reviews
13252 13253
2021-11-19 20:52:15 -03:00
Martin-Molinero 5f95a9ba77 Bug fix python history requests enumerable data (#6066)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
* Fix for python enumerable data history request

- Fix for python enumerable type data history request. Adding unit test.

* Add methods for adding data points into a baseDataCollection
13241 13242
2021-11-19 14:58:48 -03:00
Ricardo Andrés Marino Rojas a9b914c9ef Fix: IB Subscribe Cannot Find HangSeng Futures (#6064)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
* Fix Bug

* Nit change

* Change `LookupSymbols()` method implementation

* Nit change

* Revert "Nit change"

This reverts commit 7bad6d195d9634403082e1c16558bfe9dd524db4.

* Nit change
13235
2021-11-18 20:56:22 -03:00
Martin-Molinero 5436275901 Remove comments from MHDB json file (#6065)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
13234
2021-11-18 20:41:02 -03:00
Martin-Molinero 0a315b0ae6 Update readme.md
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
13230 13232 13233
2021-11-17 19:59:03 -03:00
Colton Sellers 33599b473d Refactor Delistings Processing (#6059)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* Move processing of delistings to Brokerage

* Deal with case that exchange is not open on OptionSymbol.ID.Date

* Refactor solution to use DelistingNotification event

* Adjust some regression expected liquidation time

* Mark some todos on deprecated functions

* Update expected liqudation time for Py regressions

* Update regressions that have been validated

* Use HandlePositionAssigned for assignment orders

* Update regressions

* Update some missed unit tests; remove one that is already covered by regression

* Cleanup deprecated backend functions

* nit - small cleanup adjustment

* Post rebase fix

* Address review

* Minor tweak to py regression
13226 13227 13228 13229
2021-11-17 17:43:35 -03:00