- `SecurityIdentifier` will calculate `StrikePrice` just once. Replacing
`!=` for a direct call to `Equals()` preventing unnecessary checks.
- Slightly improving Linq queries at `OptionFilterUniverse`
- Replace `OpenReader().CopyTo` for `Extract(stream)` avoids copying the
data twice.
- Replace `DateTime.Now` for `DateTime.UtcNow`
This bug was causing all zip files to remain open, even when removing them from the cache and calling Dispose on ZipFile objects.
The issue is that ZipFile.Dispose closes the underlying FileStream only if created by the ZipFile instance, which is not the case here because we fetch a Stream object containing the zip file from the data provider. In fact calling ZipFile.Read(stream) returns a ZipFile instance which does not "own" the stream, it is the caller's responsibility to dispose of it.
When reading multi-entry zip files (such as futures and options), ZipDataCacheProvider was unnecessarily calling DataProvider.Fetch for files already cached.
Instead of leaving zip exceptions to the data feed enumerator stack, we now log file names of corrupt zip files, return null and continue.
The file system data feed should now handle corrupt files like missing files.
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