Commit Graph

24 Commits

Author SHA1 Message Date
Stefano Raggi e98b31fc4c Update CoinApi symbol mapping + symbol properties database (#4888)
* Update crypto entries in SPBD

- Update values for GDAX and Bitfinex, with latest values from exchanges
- Update symbols with >3 letters
- [Fix] Remove  same base-quote entries

* Update unit tests

Increment in precision given smaller lot sizes in SPDB crypto entries.

* Add GDAX symbol properties downloader (unit test)

* Update GDAX symbol properties database

* Add BrokerageSymbol to symbol properties database

* Update GDAX symbol properties

* Address review

- Rename BrokerageSymbol to MarketTicker

* Add GDAX symbol mapper

* Update GDAXBrokerage to use symbol mapper

* Fix GDAX brokerage unit tests

* Replace GDAXSymbolMapper with SymbolPropertiesDatabaseSymbolMapper

* Address review

- use Symbol key in dictionaries

* Rename BrokerageSymbol to MarketTicker

* Update unit test

* Add Bitfinex symbol properties downloader (unit test)

* Add Bitfinex symbol market ticker to downloader

* Update Bitfinex symbol properties database

* Update BitfinexBrokerage to use SymbolPropertiesDatabaseSymbolMapper

* Remove Bitfinex test symbols from db

* Update Binance symbol properties database

* Update BinanceBrokerage to use SymbolPropertiesDatabaseSymbolMapper

* Add missing Binance test case

* Update symbol properties database

- gdax, bitfinex, binance

* Update CoinApi symbol mapper for new SPDB

* Exclude Bitfinex BCH pre-2018-fork in CoinApiSymbolMapper

* Remove unused properties

* Add CoinApi mappings

Co-authored-by: JJD <jjdambrosio@gmail.com>
2020-11-23 19:15:31 -03:00
Adalyat Nazirov 75eac27795 Bug 4600 brokerage unsubscribe symbol granular (#4640)
* bitfinex unsubscribe impl

* IB implementation

* Alpaca Brokerage

* Fxcm Brokerage

* Bitfinex remake

* GDAX Brokerage

* move & rename DataQueueHandler subscription manager to better place for using in ToolBox

* performance tuning

use unified Channel class everywhere
BaseWebsocketBrokerage.GetSubscribed method relies on DQHSubscriptionManager

* TradierBrokerage implementation

* OandaBrokerage implementation

* FakeDataQueue subcription manager

* Fake SubscriptionManager for testing

* CoinApi implementation

* IEXDataQueueHandler implementation

* IQFeed Implementation

* unit tests

* fix SubscribeSymbols params

* thread safe subscribed symbols

* don't need to lock Keys prop, because it's thread safe

* accurate PolygonDataQueueHandler subscribe/unsubscribe methods

* Alpaca isnt DataQueueHAndler anymore

* remove unused variable

* remove redundant hashset

* fix coin api subscribe method

* disclaimer

* prettify code

* race condition?

* fix symbol conversion

* log if unsubscribed; change Channel Id type

* requested changes

* pass GetChannelName func as required parameter

* centralized logs

* use single name for all idqh with no difference in tick type

* change Oanda resubscribe method

* CanSubscribe doesn't change instance state - can be marked as static.

* change Oanda Subscription tracking

* style changes

* bitfinex fix

* fix spelling
2020-09-14 20:11:44 -03:00
Adalyat Nazirov ae11e9ce43 allow Composer to create IDataQueueHandler instances (#4677) 2020-09-01 11:23:08 -03:00
Martin-Molinero 9cdb4a91c5 Refactor live data feed (#4636)
* Live Coarse universe refactor

- Live trading will source Coarse and Fine fundamental data directly
  from disk. Updating unit tests.

* Adds ILiveDataProvider interface

  * Adds wrapper for IDataQueueHandler implementations

  * Replaces IDataQueueHandler with ILiveDataProvider in
    LiveTradingDataFeed

  * Edits IDataQueueHandler documentation

* Maintains aggregation for current IDQH impls and skips for ILDF impls

  * Note: No unit test was created for this method, go back and TODO

* Protobuf Market data

- Adding protobuf support for Ticks, TradeBars and QuoteBars. Adding
  unit tests.

* Adds unit tests for LiveDataAggregator changes

  * Fixes bug where custom data was not handled as it was before
  * Fixes race condition bug because of variable reuse in class

* Add protobuf extension serialization

* Fixes for protobuf serialization

* Refactor

* Fix OptionChainUniverse

* replace BaseDataExchange pumping ticks with consolidators

* AlpacaBrokerage

* BitfinexBrokerage

* GDAXBrokerage

* OandaBrokerage

* InteractiveBrokers

* TradierBrokerage

* FxcmBrokerage

* PaperBrokerage

* etc

* WIP fixes for existing LTDF unit tests

* Fixes more LTDF unit tests

* make IDataAggregator.Update recieving Generic BaseData rather than Tick

* Change IDataQueueHandler.Subscribe method

* Some fixes after adding new commits

* Adds protobuf (de)serialization support for Dividend and Split

* Serialize protobuf with length prefix

* Fix missing LTDF unit tests

* Adds TiingoNews protobuf definitions

* fix comments

* more fixes on IQFeedDataQueueHandler

* disallow putting ticks into enumerator directly

* ScannableEnumerator tests

* fix OandaBrokerage

* AggregationManager unit tests

* fix AlpacaBrokerage tests

* fix InteractiveBrokers

* fix FxcmBrokerage tests

* call AggregationManager.Remove method on unsubscribe

* fix GDAX existing tests

* Fixes, refactor adding more tests for AggregatorManager

* Adds BenzingaNews protobuf definitions and round trip unit test

* Adds missing TiingoNews unit test to Protobuf round trip tests

* Improve sleep sequence of LiveSynchronizer

* need start aggregating first, and then can subscribe

* More test fixes and refactor

- Refactoring AggregationManager and ScannableEnumerator so the last is
  the one that owns the consolidator
- Adding pulse on the main LiveSynchronizer

* Improve performance of LEquityDataSynchronizingEnu

* Add missing Set job packet method

* Minor performance improvements

* Improvements add test timeout

- Improvements adding test timeout to find blocking test in travis

* Improve aggregationManager performance

* Testing improvements for travis

* Remove test timeouts

* More test fixes

- Adding more missing dispose calls and improving determinism

* fix IEXDataQueueHandler and tests

* Final tweaks to LTDF tests

* more AggregationManager tests

* consume and log ticks

* fix test: couldn't subscribe to Forex tickers

* change Resolution for all bar configs

* Improve RealTimeScheduleEventServiceAccuracy

* refactoring: move common code to base class

* fixed bug; unsubscribe SubscriptionDataConfig

* Small performance improvement

* Minor fixes

* Avoid Symbol serialization

* Fixes coarse selection in live mode

* Fix for live coarse

* Adds protobuf (de)serialization support for Robintrack

  * Adds round-trip unit test

* Minor performance improvements

* More minor performance improvements

* pass LiveNodePacket through to OandaBrokerage

* Fixes empty list becoming null value when deserializing with protobuf

* Reverts BZ live trading exception removal and fixes tests

* Refactor WorkQueue making it abstract

* Add try catch for composer

* Adds optional data batching period to LiveFillForwardEnumerator

* Override data-queue-handler with config

* Improve PeriodCountConsolidator.Scan performance

* Move batching delay to main Synchornizer thread

* Reverts addition of Robintrack protobuf definitions

* Give priority to config history provider if set

* Add Estimize protobuffing

- Add Estimize protobuffing support. Adding unit tests

* Always dispose of data queue handler

Co-authored-by: Gerardo Salazar <gsalaz9800@gmail.com>
Co-authored-by: Adalyat Nazirov <aenazirov@gmail.com>
2020-08-18 20:21:10 -03:00
Stefano Raggi 7554babad8 Add Dispose and IsConnected to IDataQueueHandler 2020-04-28 17:39:13 +02:00
Stefano Raggi 961157ed59 Update CoinApiDataQueueHandler to use CoinApi's NuGet package (#3645) 2019-10-10 17:05:01 -07:00
Juan José D'Ambrosio 75b360411e Add new crypto pairs for both exchanges
Changes in this PR were made based in data from CoinApi, and data from exchanges API.
2019-10-01 21:39:34 +00:00
Juan José D'Ambrosio df053a4ca1 Address reviews 2019-09-12 15:12:35 +00:00
Juan José D'Ambrosio d0a46d4d15 Put back the throws in SymbolMapper 2019-09-11 20:07:07 +00:00
Juan José D'Ambrosio db0d0e641f Fix error when CoinApi symbol list has duplicates
We assumed CoinAPi symbol list has no duplicates, but they those cases are expected, as we can read in their docs https://docs.coinapi.io/#list-all-symbols

>  In the unlikely event when the "symbol_id" for more than one market is the same. We will append the additional term (prefixed with the "_") at the end of the duplicated identifiers to differentiate them.
Ignore files if they have the extra suffix

After asking CoinApi support,  they inform us that symbols with the extra suffix are for edge cases.
> There could be corner-cases for other data types like FUTURES or OPTIONS, e.g., exchange lists same option but one with American and other with European execution-style
2019-09-11 18:25:10 +00:00
Stefano Raggi 062b27e0b0 Bitfinex DataQueueHandler June 2019 Update
- Moved IConnectionHandler and DefaultConnectionHandler from ToolBox project to Brokerages project
- Added connectionId to IConnectionHandler.Initialize to support multiple connections
- Added new BitfinexSubscriptionManager to BitfinexBrokerage to handle max 30 channels per websocket
2019-07-02 15:17:06 +02:00
Artur Pietrzyk 88e0461a2e separation of the json parsing using the real thread - newtonsoft is slooow 2019-06-21 20:29:57 +02:00
Artur Pietrzyk 306b142309 reduction of the locking surface 2019-06-21 20:15:17 +02:00
Stefano Raggi ed3d65dce1 Add extra logging for reconnect 2019-06-20 13:36:25 +02:00
Stefano Raggi 518cda982a Fix CoinApiDataQueueHandler keep-alive time 2019-06-20 13:36:24 +02:00
Jared b16859200b Merge pull request #3262 from QuantConnect/coin-api-duplicated-symbols-fix
Coin api duplicated symbols fix
2019-06-05 13:15:48 -07:00
Juan José D'Ambrosio 582b8d4b9d Implement simpler system for using local list of symbols 2019-06-05 14:13:57 +00:00
Stefano Raggi cb3713a078 Only emit quote ticks if bid price or ask price changed 2019-06-04 15:00:35 +02:00
Stefano Raggi df38fca7d9 Address reviews
- Added lastDataReceivedTime argument to IConnectionHandler.KeepAlive
- Fixed logic bug in EnableMonitoring
- Removed DateTime.UtcNow call from KeepAlive
- Handled empty symbol list in SubscribeSymbols
- Fixed logic in subscription batching task and handled 5-second minimum requirement between Hello messages
- Added future-proof "heartbeat" case in OnMessage
2019-06-04 14:01:34 +02:00
Juan José D'Ambrosio 700f24551e CoinApi mapper tries to read a local file before making API request. 2019-06-03 22:00:00 +00:00
Stefano Raggi d3f50edc5a Connection handling bug fixes 2019-06-03 15:24:13 +02:00
Stefano Raggi fa2bc58564 Add IDataQueueHandler implementation for CoinAPI 2019-06-03 15:24:12 +02:00
Stefano Raggi d002e329d9 Remove unused dictionary and private method 2019-05-30 15:38:15 +02:00
Stefano Raggi 5d6bf2ad66 Address reviews 2019-05-30 15:34:02 +02:00