- `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`
- `FactorFile` will keep an ordered reversed list with the dates.
Calling `Reverse()` on the `SortedList` is expensive.
- `MapFiles` will keep first and last date, so we don't need to call
`First()` and `Last()` multiple times.
- `Liquidate` will go through all the algorithms securities only if
necessary
- `TradeBar` parsing will not call `new T` for pure `TradeBar` which is
expensive
- Removing `Lazy` hash code and security type for the
`SecurityIdentifier`, replacing for direct initialization. Accessing the
`Lazy` value adds an overhead.
- Replacing `Enum` to string for hardcoded switch statement. `Enum.ToString` is expensive.
- `DataManager` will be lazy for counting the subscriptions for
determining if its above the limit
- Adding `AlgorithmSecurityValuesProvider.GetAllValues()`, removes the
need to fetch all the security keys twice.
- During universe selection, will not try to re add already added symbol
- Using `Aggregate(lambda)` vs `Sum(lambda)` since the later is slower
due to performing an extra `Select`
- For `QCAlgorithm.Framework.OnFrameworkData()` will avoid calling
`ToArray()` on empty `Enumerables` due to its cost * the number of
calls. If the `Enumerable` is the empty instance, which is static,
will create a new empty array and return it instead.
- Replacing `SecurityIdentifier` `SecurityType` and `GetHashCode`
implementations for `Lazy` versions, that are performed just once, since
these values do not change and are used multiple times.
- For the different `DataDictionary<T>` implementations adding `this[
Symbol] get; set` since existing overload `this [string]` produces an
extra round operations `Symbol->string->Symbol` with a significant
impact.
- Adding `PortfolioTargetCollection.AddRange()` overload using an array
to avoid unnecessary convertions.
- Adding new `PriceScaleFactorEnumerator` that will scale raw prices
based on a provided `SubscriptionDataConfig` and update the
`SubscriptionDataConfig.PriceScaleFactor`. Adding unit tests.
- `BaseData` factories (`TradeBar.cs`, `QuoteBar.cs`, `Tick.cs`) will
no longer scale factor prices, they will generate data points in raw
mode.
- `SubscriptionDataReader` will no longer update the
`SuscriptionDataConfig.PriceScaleFactor`
- Fix `BrokerageTransactionHandlerTests` unit test that was having a
race condition.
Explictly implements the indexert `this[string]` to all classed that inherit from `DataDictionary` since pythonnet was not able to access the indexer from the parent class.
- Changes DividentAlgorithm.py to test the fix.
`DataDictionary.GetValue` is meant to be used as an alternative to `DataDictionary.TryGetValue`. It was created due to limitations to the python implementation.
It's important we see the before/after and the data used to make the change.
This will aid in debugging potential misapplications of split/dividend events.
Adds reference price to dividend/split
Adds GetSplitsAndDividends to FactorFile
Adds Apply methods to FactorFile/FactorFileRow
Updates factor files to include reference prices
This follows the pattern used by delisting events, where we send a warning event
before the start of trading on the trading day before the split will happen. This
change also adds a SplitType enum having a Warning and SplitOccurred values.
This project can take trade as well as orderbook information from Kaiko
and convert the data into Lean compatible data at all resolutions in
modeled as both trades and quotes.
The Crypto security can be modeled with both trades and quotes easily, therefore it is necessary to make sure that the LeanData, LeanDataWriter and associated BaseData.Reader() methods can read/write both Trades and Quotes.
- Open interest should use yyyyMMdd HH:mm in csv file when frequency is daily or hourly
- Filename should be [baseticker]_[quote|openinterest|trade]_yyyyMM.csv
* Fixes 5 warnings with code CD1572
* Adds the Xml Comment parameter and implements the missing selector parameter
* Fixes rest of the 13 warnings with code CS1572
* Swallow bug in QuoteBar.Reader() if an error is thrown during parsing
Following the pattern in TradeBar.Reader(), the QuoteBar.Reader() method will now swallow a parsing error, log the error message and line number and then proced to return a default instance of Quotebar. The current implementation of QuoteBar.Reader() will stop the executation of the program if a parsing error is found. Given the amount of data Lean may parse during the execuation of an algorithm, it is better to be resiliant to small errors in the data than to stop the execuation of the program because of a malformated line of csv.
* Added QuoteBar.Reader tests
* Minor changes to config.json; back to proper defaults
Remove QLLib.NET reference
Added date to QuoteBar.Reader() error message
* Incorrect timezone specified on consolidator filter