Commit Graph

81 Commits

Author SHA1 Message Date
Stefano Raggi 2ff5650b4a Add price and split factors to CoarseFundamental class 2018-06-01 12:19:06 +02:00
Michael Handschuh 65393d4e54 Replace config security with an option chain filter function
The ConfigureOptionChainSecurity method somewhat was overshadowing the security
initializer's responsibilities. This method has been trimmed down into a contract
filter function sub classes can use to define what option contracts they want to
select.
2018-06-01 00:36:17 -04:00
Michael Handschuh 398e4d5856 Refactor IUniverseSelectionModel.NextRefreshTime into method
Methods are much easier to manage in python that implementing properties.
2018-05-31 14:58:39 -04:00
Michael Handschuh ad331118ab Add refresh to IUniverseSelectionModel to support dynamic universes
This change allows the universe selection model to select different universe
definitions as time proceeds. This enables the definition of a universe model
that, for example, could add option chains for securities selected by a different
universe model.

The BasicTemplateOptionsFrameworkAlgorithm was added to showcase and provide
regression for a universe model that selects different universes.
2018-05-31 11:48:23 -04:00
AlexCatarino 16a80ecbec Fixes CreateUniverses method modifier
`UniverseSelectionModelPythonWrapper.CreateUniverses` method modifier should be `override` instead of `virtual`, since that class inherit from `UniverseSelectionModel`.
2018-05-30 22:29:29 +01:00
Michael 8534df4e20 Merge pull request #1979 from AlexCatarino/feature-1961-python-qc500
Implements python version of QC500UniverseSelectionModel
2018-05-11 14:47:09 -04:00
Michael Handschuh afbbf9b1f4 Add UniverseSelectionModel base class
Update existing models to derive from new base class
2018-05-11 01:50:45 -04:00
AlexCatarino f723952457 Implements python version of QC500UniverseSelectionModel 2018-05-09 11:37:25 +01:00
AlexCatarino ff574b9d86 Fixes EmaCrossUniverseSelectionModel indicator update logic
Instead of using the `&&` operator, use `&` so that both EMA are updated.
2018-05-08 19:47:20 +01:00
AlexCatarino 5d6dea6473 Simplify EmaCrossUniverseSelectionModel by using list instread of dict 2018-05-08 18:54:17 +01:00
AlexCatarino 04f357f2b8 Implements python version of EmaCrossUniverseSelectionModel
Adds EmaCrossUniverseSelectionModel and EmaCrossUniverseSelectionFrameworkAlgorithm to show the new model in action
2018-05-08 18:54:17 +01:00
AlexCatarino 433feff1df Implements python version of FundamentalUniverseSelectionModel
- This version serves two purposes: example of universe selection model and base class for other universe selection models, since the pythonnet doesn't deal well with inheritance of abstract classes.

- Adds PyObject overload to `CoarseFundamentalUniverse`.
2018-05-08 18:54:17 +01:00
AlexCatarino b476e22e41 Implements EmaCrossUniverseSelectionModel
Adds EmaCrossUniverseSelectionModel and EmaCrossUniverseSelectionFrameworkAlgorithm to show the new model in action
2018-05-08 18:54:17 +01:00
Michael Handschuh 353e62c6e9 Make universe selection models overrideable 2018-05-07 16:13:07 -04:00
AlexCatarino 264da8a596 Calls python destructor to trigger exceptions
The exception in ignored because the generator isn't closed until it is being deleted (automatically in this case, when Python exits); the generator __del__ handler closes the generator, which triggers an exception of there is one.
2018-04-26 18:46:33 +01:00
Michael Handschuh 0ddc160028 Fix ManualUniverseSelectionModel w/ custom data present
We add entries for custom data w/ symbol references, so the generic look
up being performed here never resolves and throws an exception. With
custom data we add the entry manually and that same pattern has been
repeated here for consistency.
2018-04-20 17:37:39 -04:00
Michael Handschuh c1c741f55f Remove canonical symbols from manual universe model
This happens when users pass Securities.Keys into the manual model,
causing the SecurityChanges object to have references to the canonical
securities, thereby leading to indicators and other things being
done to them unknowningly.
2018-04-20 09:32:22 -04:00
AlexCatarino df698d1925 Adds constructor overloads with PyObject parameter to UniverseSelectionModel
The PyObject parameter is converted into selector function of `Func<T1,T2>` type so that the model can user universe selector methods defined in python algorithms.
2018-04-12 17:09:03 +01:00
Michael Handschuh 3db242203e Add ScheduledUniverseSelectionModel
The ScheduledUniverseSelectionModel wraps the new ScheduledUniverse.
ScheduledUniverse is similar to the UserDefinedUniverse we use to create
universes for dopbox/remote files w/ symbol listing. The new abstraction
that 'turns on' this no-data/scheduled based universe behavior is the
ITimeTriggeredUniverse, which exposes GetTriggerTimes which yields the
date/times your univese selection function will be called.

A regression algorithm was also added to cover the new feature.
2018-04-10 19:24:36 -04:00
Michael Handschuh b1ac56d63c Fix capitalization of QC acronyms 2018-03-29 15:30:05 -04:00
Michael Handschuh d87c121d4b Rename IPortfolioSelectionModel -> IUniverseSelectionModel 2018-03-29 12:18:44 -04:00
Jared 20c6db9b01 Merge pull request #1763 from QuantConnect/bug-1762-manual-selection-add-symbols-to-symbolcache
Add entries to SymbolCache for ManualPortoflioSelectionModel symbols
2018-03-23 17:53:58 -04:00
Michael Handschuh 794c71bb55 Add entries to SymbolCache for ManualPortoflioSelectionModel symbols
This ensures similar behavior to using AddSecurity directly.
2018-03-23 17:07:37 -04:00
Michael Handschuh a7128ad0db Add QC500PortfolioSelectionModel 2018-03-23 15:10:39 -04:00
AlexCatarino b8cfbd7c24 Improves error message in python wrappers 2018-03-14 12:30:50 +00:00
AlexCatarino 35d29060d0 Implements python support for custom models in framework
Adds method overload that accept a `PyObject` to `SetAlpha`, `SetExecution`, `SetPortfolioConstruction`, `SetPortfolioSelection` and `SetRiskManagement`. In these methods, a custom model written in python will be wrapped around the respective `PythonWrapper`.
2018-03-13 11:35:31 +00:00
Michael Handschuh f3596c310a Adds coarse/fine convenience portfolio selection methods/classes 2017-12-14 15:44:51 -05:00
Michael Handschuh c5da7fe5fe Add FundamentalPortfolioSelectionModel base class
This class provides a base class so the user only needs to provide the required
coarse/fine selection functions.
2017-12-08 10:07:54 -05:00
Michael Handschuh d6496ebb85 Change ManualPortfolioSelectionModel to accept params Symbol
This will make life easier for python while also keeping things easy for csharp.
2017-12-08 10:07:54 -05:00
Michael Handschuh b8f6afe4e8 Add model setter methods 2017-12-08 10:07:54 -05:00
Michael Handschuh 0591d45db2 Add QCAlgorithmFramwork w/ IPortfolioSelectionModel
Adds a default implementation of IPortfolioSelectionModel that creates a
universe using the securities explicitly defined by the user.
2017-12-08 10:07:53 -05:00