- Fix Slice.Get OpenInterest type. Adding unit test
- Fix for SecurityCache that wasn't storing OpenInterest types
- Updateing regression tests to covere these usages
* Refactors SecurityCache to Support Access to Tick of Different Type
Adds two read-only lists of BaseData to save the last list of Tick of TickType.Trade and TickType.Quote. Changes methods accordingly to get and set these lists.
* Addresses Peer Review
The assignment of `_lastData` is moved to keep the current behavior of not beeing set with fill forward data.
`Reset` and `ShareTypeCacheInstance` implements the new class objects.
Adds unit tests for `Reset` and `ShareTypeCacheInstance`.
* Only Cache Non Fill-Forward Data
Undo changes that made AddData cache non fill-forward data.
- Update regression algorithms stats after making SecurityCache ignore
QuoteBars for equity for OHCL values and GetLastData(). They were
affected since the `BenchmarkSecurity` used `.Price` which was QB for
equities. Order list hashes changed because SubmissionLastPrice will
now be TB instead of QB
- Adding `SecurityCacheProvider` this class allows for two different
`Security` to share the same data type cache through different instance
of `SecurityCache`. This is used to directly access custom data types
through their underlying in a peformant maner
- Some small improvements
- `DynamicSecurityData` will be a view into the `SecurityCache` instance
- Custom data which has an underlying will use the underlying
`SecurityCache` data type cache instance
- Refactors for `Security` and `SecurityCache` to avoid storing twice
the same data points in the data type cache
- `PortfolioTargetCollection` avoid calling `Count` on
ConcurrentDictionary directly -> has to take all locks
- `SecurityChanges` change Union for Concat since constructor will call
HashSet
- Make `DynamicSecurityData` hold lazy data objects
- `RegisteredSecurityDataTypesProvider` avoid looping over all
registered types, adding `TryGetType`
- `Security.Update()` will no call group by on data since this data is
already grouped by type. Adding `ContainsFillForwardData` will allows to
be lazy and not re loop through the data unless necessary
- `DefaultAlphaHandler` will use the `static`
`Enumerable.Empty<Insight>` instance when possible
- `SubscriptionSynchronizer` will be lazy to construct the
`universeData` dictionary which is not used in most of the times. Will
use `Count` vs `Any` -> `Count` is known by the dictionary
- For python algorithms `JobQueue` will respect `AlgorithmLocation`, was
using unexisting `"algorithm-path-python"`
- Only define `DEBUG` is `SelectedOptimization` is not defined
- `DynamicSecurityData` will Keep a cache of the generic types
- Avoid using so much linq at `Security.Update()`
- `Slice` will also keep a cache of the generic types
Provides dynamic access to cached security data keyed by the type's name.
For example, `security.Data.GetAll<Tick>()` would yield a list of ticks.
Likewise, using the dynamic accessors, `((dynamic)security.Data).Tick`
would return the same list. In C# you'll need to cast security.Data to
a dynamic. In python, all C# objects are viewed as dynamic, so python can
simply access `security.Data.Tick` directly.
See #3620
Custom derivative data is now being saved into the underlying security's
cache. This makes the custom derivative data available via the underlying's
security object via underlying.Cache.Get<T> where T is the custom data type.
We never want universe data to impact a security's price or other cache
properties. To that end, this change adds another way of adding data to
the cache that simply stores the data for retrieval and does NOT update
any of the security cache properties. The check for aux data was left in
to prevent aux data from setting security prices as well.
Universe data is piped through the TimeSlice and saved in the
security cache in the algorithm manager for consumption by the
algorithm.
This change includes an update to SecurityCache.AddData to preclude
us from setting the security price using auxiliary data. Tests were
updated accordingly.
This change aims to keep the quote bar preference for values in the cache
while also ensuring that the volume data is properly being updated. Tests
were added to provide coverage around expected property changes from different
starting configurations (last data type) and a data update.