- Add `BaseData.Reader` implementation which consumes the `StreamReader`
directly, avoiding in between substrings and parsing improving
performance and reducing resource consumption
- Adding unit tests, including performance unit test showing a >50%
improvement
- For backtests download RemoteFile just once
- Live subscriptions and history requests will continue to download the
`RemoteFile` on each request.
- Adding unit tests
- Adding `IStreamReader.RateLimit { get; }` specifying if a stream
reader `ReadLine()` calls should be rate limited by the source readers.
- Adding two failling unit tests in `master`
It is not uncommon that a web service would require some form of
authentication headers to be provided. This change aims to enable
this by adding the header information to the source. This design
allows a user's custom data type to return the source properly
hydrated with the required header values before being sent back
through the rest of the LEAN infrastructure.
The streamReader expects a stream to be provided by the DataCacheProvider. When the file is not available, most dataCacheProviders will look for the file on disc. This works for most Lean data types, but not for remote data. After downloading a remote file, this PR sends the data to the DataCacheProvider via the Store() method. This way, when the streamReader asks for the data from the DataCacheProvider - the remote file will already have been cached.
Fixed bug where DataCacheProvider was returning a stream without closing
the stream. Also, ZipFiles returned from ZipFileCacheProvider are
effectively disposed.
Removed date field from IDataCacheProvider interface
This interface was built around the existing implementation of the
DataCacheProvider. It's purpose is to define a method for caching data
files. Currently, most data files are either read from disc or retrieved
remotely. The IDataChceProvider returns returns a Stream and can handle
many types of data. The IDataFileCacheProvider is needed because keeping data in memory will improve performance and overcome certain File read/write limitations (such as sharing violations) currently experienced by Lean.
There are two implementations of this interface. The first is the
SingleZipEntryDataCache. This is the default implementation. It does not
cache and returns the first entry found within a ZipFile. The second is
the ZipEntryCacheProvider. This is a rework of the existing
DataCachePrivider. It caches ZipFiles for up to 10 seconds. It can
return specific entries for option and future ZipFiles. Otherwise, it
returns the first entry in a ZipFile.
Added IDataFileCacheProvider as parameter to IHistoryProvider.Initialize()
The IDataFileCacheProvider is very useful for the IHistoryProvider in that it can eliminate the need for history request to touch disc. This can greatly improve peerformance and eliminate disc bugs associated with disc read/writes. To minimize changes throughtout Lean, the default value for the IDataFileCacheProvider is null in the IHistoryProvider.Initialize method.
IDataCacheProviders are passed down the Lean stack. Each instance of a Subscription Enumerator factory decides what cache it
will use. In other words, the IDataCacheProvider is not configurable from
config.json. The IDataCacheProvider is passwed down the stack form the
Enumerator factory to the IStreamReader where it is used to retrieve data.
Added useful helper method to Unizp files into a Stream.
- Added IQFeed options support to toolbox: option chain universe, option symbol list, subscriptions, live prices
- Added LiveTradingDataFeed to support options live screaming
- Added IB live options trading support: trading orders, holdings, live option exercising
- Modified ISymbolMapper interface to support derivatives (options, futures)
- Fixed minor bugs with (introduced ealier) symbol changes for options
Tested with IQFeed version 5.2.4.2. IB TWS offline version 957.
Includes default impl of BaseDataSubscriptionFactory
This change is to prepare for binary data sources and defines a factory to
handle the reading of a SubscriptionDataSource and the conversion of that data
into BaseData instances
Updates SubscriptionDataReader to use IStreamReader
Adds FactorFile and MapFile helpers
Adds support for Raw, Adjusted, and TotalReturn data normalization and portfolio application