Commit Graph

20 Commits

Author SHA1 Message Date
Martin Molinero 3aa745ee42 Add StreamReader BaseData.Reader
- 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
2019-11-18 17:03:27 -03:00
Martin Molinero d360ec36ac Address reviews 2019-05-31 18:26:18 -03:00
Martin Molinero 57fbf588fe Download RemoteFile once for backtests
- For backtests download RemoteFile just once
- Live subscriptions and history requests will continue to download the
`RemoteFile` on each request.
- Adding unit tests
2019-05-29 18:38:07 -03:00
Martin Molinero bb6671b811 Fix tests after RemoteFileSubscriptionStreamReader changes 2019-05-28 13:24:52 -03:00
Jared Broad 9062357b30 Remote file provider powered by download provider 2019-05-24 17:01:52 -07:00
Martin Molinero d4a4a992a5 Address reviews 2019-05-22 16:31:17 -03:00
Martin Molinero 7becc869af Fix infinite live custom data polling
- 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`
2019-05-21 16:15:38 -03:00
Michael Handschuh b595005df8 Support headers in SubscriptionDataSource
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.
2017-11-13 16:53:02 -05:00
Andrew 88e6c1c251 Send remote files to the DataCacheProvider after downloading
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.
2017-11-06 12:01:15 -05:00
Stefano Raggi 1ef0d0cfe0 Fix DirectoryNotFoundException when using custom data with FileFormat.Collection 2017-07-26 17:18:33 +02:00
Andrew 672e134939 Removed ApiDataProvider
Refactored IHistoryProvider interface order of parameters
2017-02-16 15:47:06 -05:00
Andrew ed2107132e IHistoryProvider.Initialize() requires a DataCacheProvider
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
2017-02-15 12:16:49 -05:00
Andrew 952e1d19e3 Added interface IDataCacheProvider that defines a mechanism for caching data
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.
2017-02-15 12:16:49 -05:00
quant1729 48721125dc Revert "Fixed bug with static zip archive caching. Added new caching data file provider. Refactored IDataFileProvider interface."
This reverts commit c59743dc42.
2017-01-11 11:27:28 +08:00
quant1729 c59743dc42 Fixed bug with static zip archive caching. Added new caching data file provider. Refactored IDataFileProvider interface. 2017-01-08 09:25:26 +08:00
quant1729 d2aad44272 Updated code as per PR discussion 2017-01-06 22:46:42 +08:00
quant1729 0396841d82 - Added support for sourcing and caching the full symbol list from IQFeed website.
- 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.
2016-09-14 21:56:12 +01:00
snugs a17bf88ea7 Make downloaded file names unique 2015-09-15 15:40:06 -04:00
snugs 324c7073f7 Adds ISubscriptionFactory
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
2015-07-02 21:59:01 -04:00
snugs 6fd357b710 Adds support for dividends and splits
Updates SubscriptionDataReader to use IStreamReader
Adds FactorFile and MapFile helpers
Adds support for Raw, Adjusted, and TotalReturn data normalization and portfolio application
2015-04-23 20:39:59 -04:00