Commit Graph

16 Commits

Author SHA1 Message Date
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
Stefano Raggi 815a442da1 Fix initialization error handling in CollectionSubscriptionDataSourceReader.Read 2018-07-24 22:20:45 +02:00
Juan José D'Ambrosio 9eaf4cb6b0 Implementing live mode flag into RestSubscriptionStreamReader
Through `SubscriptionDataSource`.
Exceptions, cocumenting, cleaning and testing adjust


make isLiveMode mandatory in the SubscriptionDataSource constructor


Calls to SubscriptionDataSource implements new bool argument


csproj file mistake fixed 


Clean up nullable from prevoius implementation.


Revert "Exceptions, cocumenting, cleaning and testing adjust"

This reverts commit 7da7a9fca195b327a1322c0c7c4a7a088b2f1099.
SubscriptionDataSource back to default.

 Uisng LiveMode flag from  the calling contex
_delivered variabl setting.


Comments fixed


xml doc fix
2018-02-02 19:27:31 -03:00
Michael Handschuh d0e2f3d38e Filter null or uninitialized data immediately
The convention throughout the documentation and source code is to either
return null or a new, uninitialized object to indicate that the reader method
was unable to produce an instance from the previous content. It appears over
time that these filters were forgotten within the data enumerator stacks.
2017-12-04 15:45:44 +01: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
Michael Handschuh 4c2a2087ba Fixes bug using collection subscriptions in backtest
Yielding the entire collection as a single unit is only necessary in live
and as such we should unroll the collection in backtest.
2017-10-26 18:44:50 -04:00
Michael Handschuh aa6f2d1d57 Fix DailyFx in live mode
Diff newly downloaded calendar entries against the previous ones we
emited. Also, time stamp the data as utc now since it should be emitted
immediately.
2017-10-17 12:15:58 -04:00
Stefano Raggi 1ef0d0cfe0 Fix DirectoryNotFoundException when using custom data with FileFormat.Collection 2017-07-26 17:18:33 +02:00
jaredbroad 0f40b0df05 Merge remote-tracking branch 'origin/master' into pythonnet 2017-03-26 10:14:03 -04:00
Andrew 672e134939 Removed ApiDataProvider
Refactored IHistoryProvider interface order of parameters
2017-02-16 15:47:06 -05:00
Andrew b6171cc9d5 Renamed IDataFileProvider to IDataProvider using resharper
Refactored IDataProvider interface to return stream. The IDataProvider
Fetch method now only takes a key.  The IDataProvider
has been reshuffled to be at the bottom of the LeanDataStack.  It provides
data to the rest of the Lean stack. The default implementation of IDataProvider reads
data from disc.

All IDataCacheProviders now have constructors which take IDataProviders
and use them to find data on disc.

Renamed DataCacheProvider to ZipDataCacheProvider

Added comments to IDataProvider and it's implementations

Added comments to IDataCacheProvider and it's implementations
2017-02-15 12:16:50 -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
AlexCatarino 9774af9adc Custom Data for Python Support 2017-02-09 17:48:50 -02:00
Michael Handschuh 83337000dc File renames
Performing the file renames and the class renames in separate
changelists can make it easier for tools to track a single file's
history.
2016-06-04 18:17:32 -04:00