* DataConsolidator Wrapper for Python Consolidators
* Regression Unit Test
* Refactor Regression test
* Bad test fix
* pre review
* self review
* Add RegisterIndicator for Python Consolidator
* Python base class for consolidators
* Modify regression algo to register indicator
* unit test - attach event
* Test fix
* Fix test python imports
* Add license header file and null check
Co-authored-by: Martin Molinero <martin.molinero1@gmail.com>
- Adding an example algorithm of a custom universe selection using
coarse data and adding tiingo news. If conditions are met will add the
underlying and trade it
- Adding required UniversePythonWrapper
- Fixes for C# RegisterIndicator API methods which were ignoring provided
type of T
- Fixes for Py RegisterIndicator API methods which was not using the
provided 'selector' method
- Adding C# and Py regression algorithm
- Replacing `BaseData.AdjustResolution` for `DefaultResolution` and
`SupportedResolutions`
- Making `Resolution` nullable for `Algorithm.AddData` methods
- The `ISubscriptionDataConfigService` will set the default resolution
if none was provided and assert it is supported
- Fix bug with `PythonData` `IsSparseData` and `RequiresMapping`
resolution
- Adds PyObject overload to `ScheduleManager.TrainingNow` and `ScheduleManager.Training`
- Adds `QCAlgorithm.Train` helper method
- Adds Python algorithm showing how to use the helper method.
Updates usages of GetBaseDataInstance that have a config in scope to use this
new method. This method properly assigns the symbol to the newly created base
data instance. This enables some of the new flag methods to work as expected.
Updated other poor usages where we weren't setting the symbol property.
See #3618
* Added better documentation for AddData methods
* Added new regression algorithms for adding in OnSecuritiesChanged
* Changed regression algorithms to add data that exists
* Styling and logging fixes
* Implement method precedence hack on two additional python methods
* Changed behavior of SymbolCache loading with a ticker
- Previously, we would search the cache with ticker for types that did not
require mapping.
* Added new documentation
* Code cleanup
* Change first date to be SID.DefaultDate if SecurityType isn't expected
* Modified AddData tests to meet expectations. AddData unit tests are passing
* Added new method for Symbol to allow creation with underlying
* Added new unit tests
* Alter SecurityIdentifier method signature for BaseData
* AddData changes to accept underlying Symbol
* Added AddDataImpl
This is being done in an effort to prevent symbol collisions within the
custom data (SecurityType.Base) namespace. The custom data type's name,
is used for disambiguation. As written, this change will break several
user algorithms that still rely on using the implicit string -> Symbol
lift. Providing this type information is optional an currently only being
used by AddData<T> methods. Other consumers of SecurityType.Base symbols
arn't at risk for collision, such as the UserDefinedUniverse, ScheduledUniverse
and others that are LEAN controlled. In order to maintain backwards compatibility,
the SymbolCache was updated to do a hard search when the requested ticker was
not found, looking for the prefix ('ticker.').
Fixes#3332
- Custom data types will know whether or not Lean should use map files
- Updating regression test with sample custom data using map files,
which can run locally
- Adding unit tests for the `SubscriptionDataReaderHistoryProvider`,
checking it mappes equities and options correctly
- We will now check if python selection method returned `Universe.Unchanged`
- Removing `ToList()` call on fine and coarse data before sending it to
the python algorithm
- Adding regression algorithms
In order to provide full Lean Indicator functionality to python custom indicators, they need to inherit from a C# class. `PythonIndicator` will serve for this purpose.
Algorithms can use the former version (no inheritance).
In order to add support custom python indicators for `QCAlgorithm.PlotIndicator`, we created a `PythonIndicator` class that wraps the custom python indicator. In `QCAlgorithm`, the reference of the wrapper is saved into a dictionary keyed by the python indicator handle.
- Adding _some_ of the missing PyObject.Dispose calls. In the cases
where C# is calling the Python side.
- Note that Python calls to C# code is correctly handling the
disposure of resources.
Replaces Enum `CalendarType` for static class with the same name. This class defines two properties (`Weekly` and `Monthly`) that can be used to define the previous calendar date (Monday or 1st of current month) which will correspont to the `Time` of a `IBaseData` object.
Refactor `PeriodCountConsolidatorBase` to define use `GetRoundedBarTime` based on a period specification that depends on the constructor overload: `integer`, `TimeSpan` or `Func<DateTime, CalendarInfo>`. The last one can be set with the `CalendarType` properties.
- Adding new `HistoryRequestFactory` class. Will provide some methods to
facilitate the creation of new `HistoryRequests`. Moving
`CreateHistoryRequest` and `GetStartTimeAlgoTz` into the new
`HistoryRequestFactory`. And consolidating `GetStartTimeAlgoTz` and
`GetStartTimeAlgoTzForSecurity`.
By using the python object parant class, which is either `PythonQuandl` or `PythonData`, instead of `DynamicData`, the `AlgorithmManager.Stream` method can find a matching subcription data configuration used to create a data feed packet.
Closes#2694
- Adding new ISecurityService and its implementation SecurityService.
Expose by SecurityManager.
This class will expose a method for creating new securities. The
SecurityManager is exposing this new interface, calling _securityService
internally, so Future/OptionUniverseSelectionModel.cs can use it
- Replacing all usages of SecurityManager.CreateSecurity for new
ISecurityService
- Modifying `Cash.cs` and `CashBook.cs` `EnsureCurrencyDataFeeds()` to
return newly added `SubscriptionDataConfig` instead of `Security`. This
will avoid using `Security.Subscriptions` at call site.
- Moving old SecurityManager.CreateSecurity into new
SecurityServiceTests.cs
We didn't experience the expected performance improvements. Locally under
unit test there was aboout an order of magnitude throughput increase, but
when run against the history benchmark, this new approach was 60% slower.
We're reverting this for now to perform further analysis and better
understand the performance profiling of the python history stack.
- Do not throw, but log, when a entry in the zip file does not exist. It can happen in trade bar data for options/futures since a given contract may only exist as quote bar.
- Verify whether the minimum requires arguments ("periods", "span" and "start") are present in the dictionary used to pass the variables.
- Adds doctring to History.
- Fixes type check for custom data.
Since futures and options have multiple entries in the zip file, we need to include the entry name in the request.
Futures have multiple open market periods during on trading day, therefore we need to apply a more complex mask to pandas dataframe index.