Commit Graph

396 Commits

Author SHA1 Message Date
Martin Molinero ec7a8fa906 Bump PythonNet to 1.0.5.29 2019-11-13 17:33:32 -03:00
Martin Molinero c6ab54f6d2 Bump PythonNet to 1.0.5.28 2019-11-12 16:06:55 -03:00
AlexCatarino 7ae63af388 Fixes LiquidETFUniverse Misplaced ETFs
`SHV`, `TBT` and `TBF` are `Inverse` ETF and were listed as `Long`.
`UGAZ` and `DGAZ` were in the opposite list.
`TVIX` was marked as `Inverse`.
2019-11-08 21:36:27 +00:00
Jared 63076f4a18 Merge branch 'master' into bug-3740-scheduled-universe-selection-model-time-zone 2019-11-08 07:56:41 -08:00
AlexCatarino fb76003048 Adds New Static Members to LiquidETFUniverse
New members represent the different ETF categories. Each one has a `List<Symbol>` for Long and Inverse ETFs.
2019-11-07 17:01:15 +00:00
Martin Molinero 98ae5cdd4e Fix TimeRules time zone issues
- `ITimeRules` are expected to yield time date in UTC, fixing `Noon`,
`Midnight` and `Every`
- `ScheduledUniverseSelectionModel` will use UTC time zone by default
since that is the default expected time zone `ITimeRule` provides
- Adding regression test
2019-11-04 15:34:57 -03:00
Jared e0f0a04f0f Update LiquidETFUniverse.cs 2019-11-01 20:48:55 -07:00
Jared 9a3ab283aa Update LiquidETFUniverse.cs 2019-11-01 20:41:21 -07:00
AlexCatarino 74d1f7b79c Adds Liquid ETF Universe Selection Model 2019-11-02 03:36:21 +00:00
AlexCatarino f02b39940b Addresses Peer-Reviews
See #3758
2019-10-23 22:14:22 +01:00
AlexCatarino 98a25910f1 Extends EWPCM Rebalancing Options
Adds constructor overloads to `EqualWeightingPortfolioConstructionModel` (`EWPCM`) to allow different rebalancing definitions.

It is possible to define rebalancing period with `Resolution`, `TimeSpan` (`timedelta` for Python) or a `Func<DateTime, DateTime>` (`lambda x: x+timedelta(y)`). The last option lets the model use `Expiry` helper class with the members such as `EndOfWeek` and `EndOfMonth`.
2019-10-22 21:07:54 +01:00
AlexCatarino 1e2cec3da6 Removes Unused Imports 2019-10-18 20:47:06 +01:00
AlexCatarino a18bd953ac Implements ConfidenceWeightedPortfolioConstructionModel
- Adding new `ConfidenceWeightedPortfolioConstructionModel` (C# / Py) that will
generate percent `Targets` based on the latest active `Insight` `Confidence` per
`Symbol`.
   - Will ignore `Insights` that have no `Confidence`.(unit tested)
   - If the sum of all the last active `Insight` per `Symbol` is bigger than 1, it
will factor down each target percent holdings proportionally so the sum is 1. (unit tested)
   - Adding unit tests
   - Adding a new regression test framework algorithm (C#/Py)
   -**Note**: `ConfidenceWeightedPortfolioConstructionModel` inherits from the `InsightWeightingPortfolioConstructionModel`. Protect method `GetValue` was implemented in `IWPCM` to enable the choice of `Insight` member.
2019-10-18 20:47:06 +01:00
Martin Molinero b35bc31f51 Version bump 1.0.5.26 2019-10-15 18:43:33 -03:00
AlexCatarino ee7e71e63c Improves ETF Basket Universe Selection Models
- Creates `CustomUniverseSelectionModel` that mimics `QCAlgorithm.AddUniverse(String, Func<DateTime, IEnumerable<string>>)`
- Replaces `BaseETFUniverse` for `InceptionDateUniverseSelectionModel` that inherits from `CustomUniverseSelectionModel`
- ETF Basket USMs inherits from `InceptionDateUniverseSelectionModel`
2019-10-03 23:26:43 +01:00
Jack Simonson fc52d9e730 Update VolatilityETFUniverse.cs
Removes DUST, which is an ETF tracking gold mining activity.
2019-10-03 11:04:09 -07:00
Jared 638af4186f Fix incorrect ticker 2019-10-02 17:52:31 -07:00
Jack Simonson 3cf8a3c95f Update USTreasuriesETFUniverse.cs
Remove duplicate ticker from the universe.
2019-10-02 09:46:32 -07:00
AlexCatarino 163fddcf75 Adds ETF Basket Universe Selection Models
Adds `BaseETFUniverseSelectionModel` that handles the common universe selection logic for all ETF Basket.
Adds the following ETF Baskets:
- Energy
- Precious Metals
- S&P500 Sectors
- Technology
- US Treasuries
- Volatility
2019-10-02 14:53:58 +01:00
Stefano Raggi d3f5e115e0 Add missing Invariant usages in alpha models and unit tests 2019-10-01 11:00:04 +02:00
Gerardo Salazar 56462f0283 Address reviews from Mike and Martin
* 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
2019-09-24 10:34:35 -03:00
Martin Molinero 6fabe30317 Add backwards compatibility index.levels[0]
- Add backwards compatibility shim for the `df.index.levels[0]` use
case. Reverting broken use cases and adding unit tests.
2019-09-24 10:34:35 -03:00
Martin Molinero 8dbbbb618f Pandas and CustomData mapping fixes
- Add Pandas backwards compatibility shim
- Adding `MappingExtensions` which will remove data type from the
`Symbol.ID.Symbol` value to resolve the `MapFile`
- `SecurityIdentifier.TryParse()` will throw when given an invalid
`SecurityType`
2019-09-24 10:34:35 -03:00
Martin Molinero e7ca829a0d PythonNet bump 1.0.5.25 2019-09-23 19:45:46 -03:00
Martin Molinero f96cb2a0cf Bump PythonNet to 1.0.5.24 2019-09-10 12:11:42 -03:00
Martin Molinero e396c3ef10 Bump PythonNet to 1.0.5.23 2019-09-05 23:55:30 -03:00
Martin Molinero f00049f709 Bump PythonNet to 1.0.5.22 2019-09-03 16:05:12 -03:00
Michael Handschuh c7df4e9fb3 Add StringExtensions and Parse utilizing CultureInfo.InvariantCulture
Adds static methods of the form Parse.<TypeName>(string str) that use
CultureInfo.InvariantCulture. These are to be used when parsing strings.
It's still safe (from the CA1304/CA1305 perspective) to use the ToDecimal
extension method for decimals.

Adds string extension methods for common operations that will now require
CultureInfo.InvariantCulture. These are to be used when converting values
to strings, such as ToStringInvariant()/ToStringInvariant(format), but also
useful for searching within strings, StartsWithInvariant, EndsWithInvariant
 and IndexOfInvariant.
2019-08-16 18:08:28 -03:00
Michael Handschuh 703f915182 Configure QuantConnect.ruleset in all projects
The initial ruleset is specifically aimed at addressing #3045. When we'd like
to start addressing other issues available via the FxCopAnalyzers, we can update
the action in QuantConnect.ruleset. A nice way to do it is to first set it to
warning, then go through the solution, project-by-project, fixing each warning.
At the end you can flip it to error and ensure it still builds. Moving forward,
any changes will fail if they violate the rule.

In support of #3045, we'll be configuring the following rules:
> CA1304: https://docs.microsoft.com/en-us/visualstudio/code-quality/ca1304-specify-cultureinfo?view=vs-2017
> CA1305: https://docs.microsoft.com/en-us/visualstudio/code-quality/ca1305-specify-iformatprovider?view=vs-2017
2019-08-16 18:08:18 -03:00
Michael Handschuh c42057809d Add Microsoft.CodeAnalysis.FxCopAnalyzers to all projects
FxCop has various rulesets for enforcing things within our codebase.
For this particular issue, we'll be enforcing CA1304 and CA1305 to
ensure we're always using an IFormatProvider or a CultureInfo where
applicable.

Linked Issue: #3045
2019-08-16 18:08:05 -03:00
Rohan Talip d046befcb7 Removed a print statement from FundamentalUniverseSelectionModel.py 2019-08-01 05:23:34 -07:00
Martin Molinero 1983f36792 Allow Python selection to return unchanged
- 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
2019-07-31 15:36:07 -03:00
Jared c46bdd0f86 Merge pull request #3420 from QuantConnect/bug-3137-returns-symbol-data
Prevents ReturnsSymbolData.Add from Adding Repeated RateOfChange
2019-07-30 09:41:54 -07:00
Jared b30395ef7c Merge pull request #3432 from AlexCatarino/bug-3423-py-custom-indicator-updated
Refactors PythonIndicator
2019-07-30 07:34:02 -07:00
Martin Molinero e322381dfa ConstantAlphaModel check Security.Price 2019-07-29 22:41:14 -03:00
AlexCatarino 22723204ff Fixes VolumeWeightedAveragePriceExecutionModel.IntradayVwap
`VolumeWeightedAveragePriceExecutionModel.IntradayVwap.Update` did not return a boolean.
2019-07-29 11:28:06 +01:00
AlexCatarino 3f2f4683de Prevents ReturnsSymbolData.Add from adding repetead RateOfChange 2019-07-26 22:55:01 +01:00
Gerardo Salazar 2033c7873b Update outdated DotNetZip dependency in nuspec files 2019-07-02 18:02:23 -07:00
Jared a2a63ae058 Merge pull request #3016 from QuantConnect/feature-3015-add-weight-to-insights
Add Insight optional Weight
2019-06-04 16:52:48 -07:00
Martin Molinero c77a7b9116 Add performance note 2019-06-04 19:05:36 -03:00
Martin Molinero ee4f8fee82 Overall performance improvements
- `TimeSliceFactory` will avoid creating empty collections
- `ExecutionModels` will check target collection count before trying to
enumerate
- Reduce calls to .`TotalPortfolioValue`
- `SecurityValues` will only be created when required
- `TimeKeeper` will use TimeZone unique Id as dictionary key. The
TimeZone hash is expensive.
- `AlgorithmManager` will avoid calling `DateTime.UtcNow`,
`ConvertFromUtc()` and `RoundDownInTimeZone()`
2019-06-03 15:09:02 -03:00
Martin Molinero e294b3c3e2 Fix overflow exception
- Adding new `AlgorithmSettings` Min and Max absolute portfolio target
percentage
- Adding new `PortfolioConstructionModel.FilterInvalidInsightMagnitude()`
helper method that will be used by the `BlackLitterman` and
`MeanVariance` optiomization portfolio construction models to skip
insights with extreme magnitudes that will cause exceptions
- `PortfolioTarget.Percentage()` will now verify requested percent is
withing the settings values
2019-05-23 20:30:44 -03:00
Martin Molinero ac53e2a790 Rebase from master. Adding missing Python algo 2019-04-24 11:05:15 -03:00
Martin Molinero e21a8fec35 Address review, use inheritance
- New InsightWeightingPortfolioConstructionModel will inherit from EqualWeightingPortfolioConstructionModel
2019-04-24 11:05:15 -03:00
Martin Molinero 39ae3c6970 Addressing reviews
- Adding two new unit tests: 0 weight insight and null weight insight
- Fix bug in python `InsightWeightingPortfolioConstructionModel`
2019-04-24 11:05:14 -03:00
Martin Molinero 968adcea32 Adding InsightWeightingPortfolioConstructionModel
- Adding new `InsightWeightingPortfolioConstructionModel` that will
generate percent `Targets` based on the latest active `Insight` `Weight` per
`Symbol`.
   - Will ignore `Insights` that have no `Weight`.
   - If the sum of all the last active `Insight` per `Symbol` is bigger than 1, it
will factor down each target percent holdings proportionally so the sum is 1.
- Adding unit tests
- Adding a new regression test framework algorithm
- Note most of the code, including tests, are reused from the
`EqualWeightingPortfolioConstructionModel`
2019-04-24 11:05:14 -03:00
AlexCatarino c3de660551 Updates pythonnet to 1.0.5.20 2019-04-23 23:15:14 +01:00
AlexCatarino b9f7b8fa52 Fixes StandardDeviationExecutionModel
This model was assuming that the history request used to warm up the indicators contains the 'close' column which is only valid for Equity.

The models were also refactored to update the indicators without a consolidator since the last data point from the history request was not pushed throught the indicators.
2019-04-18 16:38:45 +01:00
HalldorAndersen 13c9f6fd02 Update UncorrelatedUniverseSelectionModel.py 2019-04-11 15:23:03 -07:00
HalldorAndersen 5b8ec0160f Update UncorrelatedUniverseSelectionModel.py 2019-04-10 17:33:59 -07:00