26 Commits

Author SHA1 Message Date
Martin-Molinero 6916636e8e Remove Future expiry date from data & use Bank Holidays For Expirations (#8580)
Regression Tests / build (push) Has been cancelled
API Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Use Futures Bank Holidays For Expirations

* Minor improvements

- Futures will be stored by their contract month, not expiry

* Delete dairy future products

* Minor test fixes
2025-10-24 17:18:20 -03:00
Jhonathan Abreu 81723ddf46 Get ZipDataCacheProvider timer from config (#7563)
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
2023-11-10 14:07:00 -03:00
Martin-Molinero cb2062debd Expand GetSecondUnevenWait usages (#6340)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
* Reduce Live CPU usage

* Address selfreview
2022-05-16 20:12:22 -03:00
Martin-Molinero b3c2303111 Zip data cache provider improvements (#6296)
Regression Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
- Throw on failure to store. Add unit test
- Fix handle leak
2022-04-22 13:52:30 -03:00
Martin-Molinero 4b94f50754 Option selection improvements (#6144)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
- Zip entries will be sourced from cache provider
- Option underlying will use SubscriptionDataSource to fetch it's data.
  Fixing bug where it would let through an old data point, or miss
  sending data through.
2022-01-10 11:18:28 -03:00
Martin-Molinero 4fdd60d146 Use 64 when saving zips update dotnetZip (#6114)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
2021-12-20 16:39:06 -03:00
Martin-Molinero abbb50e209 Minor improvements for data reading and caching (#6113)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
* Minor improvements for data reading and caching

* Address reviews

* Adjust zip cache error check
2021-12-16 19:58:37 -03:00
Colton Sellers dd4da7ba95 Feature Daily/Hourly Options Support (#6017)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
* Create generic writing for LeanDataWriter, + notes on todos

* Make Options Daily/Hourly data store by year

* Refactor Generic Write

* Permit hour and daily resolutions for options

* Refactor writer to merge when needed with other files

* Cleanup redundancies, run write tasks in parallel

* Make needed classes/vars available

* Update tests to reflect new naming convention for daily hourly options data

* Add Byte[] overloads for ZipData functions in compression

* Implemented Store() for ZipDataCacheProvider

* Have LeanDataWriter use a DataCacheProvider

* ZipDataCacheProvider cleanup

* ZipDataCacheProvider tweaks, doesn't support storing non-zips

* Test adjustments

* Update LeanDataWriter to use Write instead of SaveDailyHourly/SaveMinuteSecond

* Implement tests to verify DownloadAndSave behavior

* Nit cleanup on DownloadAndSave tests

* Fix for options daily/hourly underlying equity subscription read

* Add daily/hourly options data and regressions

* Add missing open interest for hourly

* Fix writing of OpenInterest Daily/Hourly data

* Update data

* Fix Date typo in regression

* Use daily algorithm to test delisting

* Revisions part 1

* Expand test for DataCacheProviders; refactor DiskDataCacheProvider

* nit - test adjustments

* ZipDataCacheProvider test setup refactor

* Adjust multithreaded read/write test; fixes for ZipDataCacheProvider

* Move DiskDataCacheProvider to its own file and add write test

* Remove _appendToZips; always overwrite entry or create zip

* Add mapping regression for daily options

* nit - add license to regression

* Fix Tick write case where more than one data point for a DateTime

* Fix data issue

* Address review

* Tweaks for tests

* Stop Store() early if no entry name is given
2021-11-11 20:05:31 -03:00
Stefano Raggi ad9949d460 Fix unhandled exception in ZipDataCacheProvider 2020-05-08 17:11:53 +02:00
Martin Molinero c226914322 Value types thread safety changes
- Refactor ZipDataCacheProvider to avoid value types thread issues, it
  will now use a timer. Add missing dispose calls.
- Synchronizer won't share the `SubscriptionFrontierTimeProvider`
  instance since it's not thread safe and shouldn't be called
- Fix BacktestingResultHandler `_daysProcessed` thread safety
- Fixing `RealTimeScheduleEventService` thread safety
2020-05-01 16:58:29 -03:00
Martin Molinero 82da3b5521 Fix dispose race condition at ZipDataCacheProvider 2019-07-04 13:30:42 -03:00
Martin Molinero 1581801f9b Address reviews 2019-06-11 12:01:57 -03:00
Martin Molinero ec1d410907 Performance improvements
- `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`
2019-06-10 22:40:19 -03:00
Martin Molinero d360ec36ac Address reviews 2019-05-31 18:26:18 -03:00
Martin-Molinero 2a69b3279a Add IDataCacheProvider.IsDataEphemeral (#3160)
* Add IDataCacheProvider.IsDataEphemeral
2019-05-01 19:33:35 -07:00
Martin Molinero 2ca715f582 Improve performance of fecthing zipped data 2018-06-25 12:26:14 -03:00
Stefano Raggi a32e298d21 Fix stream dispose in ZipDataCacheProvider
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.
2018-02-13 20:40:20 +01:00
Ben Sauerwine 0d6ba9e0ae Fixes issue whereby ZipDataCacheProvider is not able to load data files larger than Int32.MaxValue bytes. 2018-01-26 15:23:58 -06:00
Stefano Raggi d509ff61c5 Add synchronization to ZipFile instances in ZipDataCacheProvider 2017-05-10 00:40:14 +02:00
Stefano Raggi 38bfc96e59 Remove Lazy<T> usage from ZipDataCacheProvider 2017-05-09 23:24:11 +02:00
Stefano Raggi 7a6f8a7278 Remove unnecessary file openings in ZipDataCacheProvider
When reading multi-entry zip files (such as futures and options), ZipDataCacheProvider was unnecessarily calling DataProvider.Fetch for files already cached.
2017-05-09 21:26:06 +02:00
Stefano Raggi f9706b5a8b Improve ZipDataCacheProvider exception handling and logging 2017-05-06 09:44:37 +02:00
Stefano Raggi 46bf66705c Handle corrupt zip files in data cache providers
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.
2017-04-26 01:27:30 +02:00
Andrew b62bc6ba22 Options and Futures are not seeded with a price when the security is created 2017-02-17 14:32:47 -05: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