Commit Graph

767 Commits

Author SHA1 Message Date
Martin-Molinero 685b231890 Merge pull request #4113 from QuantConnect/refactor-4112-accumulative-portfolio-construction-model
Refactor AccumulativeInsight PCM
2020-02-19 13:19:17 -03:00
AlexCatarino fcf2696809 Rebases With Master and Apply New API
Improves regression algorithm by adding more sanity checks.
2020-02-18 13:47:57 +00:00
AlexCatarino 21ce895c18 Implements SectorWeightingPortfolioConstructionModel
Provides an implementation of `IPortfolioConstructionModel` that generates percent targets based on the `CompanyReference.IndustryTemplateCode`.
2020-02-17 22:08:06 +00:00
Martin Molinero 0ff713d8f9 Refactor AccumulativeInsight PCM
- Refactor AccumulativeInsightPortfolioConstructionModel to inherit from
the EWPCM, reducing code duplication and adding support for rebalancing
period
- Fixing bug where only 1 new insight per symbol was processed per loop
- Adding unit tests
2020-02-17 16:09:16 -03:00
Martin Molinero b5ac6bffd9 Adding unit tests
- Adding Yearly and Quarterly unit tests
2020-02-17 11:28:34 -03:00
Aytaç Aşan 75717f2e15 Added Examples in DataConsolidationAlgorithm (Python)
Added Examples in DataConsolidationAlgorithm (Python) for Quarterly & Yearly Data Consolidation
2020-02-14 21:08:30 -03:00
AlexCatarino ceabf93e94 Renames CalendarType to Calendar
Keeps `CalendarType` for backward compatibility.
2020-02-14 19:47:48 -03:00
Martin Molinero 3679ad591f Address reviews
- Improve custom rebalance function logic
- Add new PyObject C# PCM constructor overloads for performance
2020-02-14 16:38:16 -03:00
Martin Molinero e12788375b Adding IDateRule rebalacing PCM
- Adding IDateRule to be used by the PortfolioConstructionModel as
rebalancing function.
- Adding unit tests and C#/Py regression algorithms
2020-02-13 18:23:15 -03:00
Martin Molinero 26c731f895 Add python regression algorithm implementation 2020-02-13 16:11:23 -03:00
AlexCatarino 3a0640614c Updates Dropbox Algorithms
- Updates `DropboxUniverseSelectionAlgorithm` and `DropboxBaseDataUniverseSelectionAlgorithm` with new links to Dropbox files and date range to match the dates in the files.
- Adds copy of files in `TestData` folder.
2020-02-12 23:58:03 +00:00
AlexCatarino f6d7e5fcd7 Addresses Peer-Review
- Standarizes basic template algorithms for options and futures
- Fix typo
2020-02-12 22:28:45 +00:00
Jared 382e27bde4 Typo 2020-02-12 14:23:52 -08:00
AlexCatarino 9690acfd25 Changes Basic Template Algorithms With Options and Futures to Show The New Overloads
Keeps the original overloads in the comments.
2020-02-12 16:49:44 +00:00
Martin-Molinero 7ea2e6853b Merge pull request #4054 from gsalaz98/feature-refactor-tradingeconomics-calendar-downloader
Refactors Trading Economics Calendar Events Storage
2020-02-05 21:30:21 -03:00
Gerardo Salazar 050089a3ae Address review and add TradingEconomics.Event definitions
* Updates TradingEconomics algorithms to use new event definition
* Separated Calendar and Indicator definitions into partial class
* Refactors portions of TradingEconomicsCalendar
* Makes TradingEconomicsCalendar.GetSource return RemoteFile for live
* Fixes bugs in TradingEconomicsEventFilter
* Fixes bugs in StreamReaderExtensions (thanks Martin :))
* Adds new unit tests to cover changes
2020-02-04 13:48:04 -08:00
Martin Molinero fe78801fca Add future 'EnableIntradayMargins'
- Add `FutureMarginModel.EnableIntradayMargins` false by default to
avoid margin calls with SetHoldings usage
- Updating regression tests
2020-02-04 18:41:15 -03:00
Martin Molinero 936af7df7b Refactor BuyingPowerModel
- Remove unrequired `GetBuyingPower`
- Making `BuyingPowerModel.GetMaintenanceMarginRequirement` protected
instead of public
- Adding `GetMaximumOrderQuantityForDeltaBuyingPower` to replace
public `GetMaintenanceMarginRequirement` and improve API experience for
consumers like the `DefaultMarginCallModel`
- Adding new unit tests
2020-02-04 18:41:15 -03:00
Jared 04a8c6af7e Merge pull request #4034 from QuantConnect/bug-4024-option-chain-universe-selection-data
Validate option universe selection data
2020-01-29 08:07:10 -08:00
Martin Molinero 20c589f0fe Validate option universe selection data
- Remove unused `OptionChainUniverseDataCollectionAggregatorEnumerator`
- Refactor `BaseDataCollectionAggregatorEnumerator` and
`OptionChainUniverseDataCollectionEnumerator` to avoid emitting invalid
data points
- Updating regression tests statistics
- Adding unit test
2020-01-27 19:11:17 -03:00
Jared 17b1acf6d2 Merge pull request #4033 from gsalaz98/feature-normalize-tradingeconomics-calendar-events-pt1
Implement filtering and normalization of Trading Economics calendar event names
2020-01-27 13:07:11 -08:00
Gerardo Salazar e7a9d06b16 Implement filtering and normalization of Trading Economics calendar
event names

* Adds unit test for new filter method

NOTE: This is a breaking change for Trading Economics calendar events
property. Any previous string matching might result in a mismatch if
results were not previously being normalized.
2020-01-27 11:32:26 -08:00
AlexCatarino 9172bf0ed2 Addresses Peer-Review
The `AlphaStreamsBrokerageModel` was unnecesarily duplicating the `GetBuyingPowerModel` from the base class. Missing docs were added.
2020-01-21 15:52:54 +00:00
AlexCatarino 63bd501306 Adds InitialMarginRequirement and MaintenanceMarginRequirement Properties to FutureMarginModel
These properties expose the current margin requirements that can be used to compute the number of contracts manually.
2020-01-20 22:49:03 +00:00
Martin Molinero 8f14f1bdfa Fix failing regression tests
- After https://github.com/QuantConnect/Lean/pull/4000
CoarseFineFundamentalRegressionAlgorithm started using `MarketCap`, but
this value was always 0 in existing data, so it caused undeterministic
results. Adding new data and update expected result.
- `AccumulativeInsightFrameworkAlgorithm` expected statistic were not
correct, updating.
2020-01-17 11:14:09 -03:00
Gerardo Salazar 4102c83e88 Modify and fix select regression algorithms
* OnEndOfDayRegressionAlgorithm - Since the EndTime of the hourly benchmark is during the day,
the OnEndOfDay method gets called one less time than usual. Updates statistics

* CustomUniverseWithBenchmarkRegressionAlgorithm.cs - modified algorithm so
that it works with hourly benchmark. Previously only tested for Daily benchmark

* BasicTemplateAlgorithm.py - Modified resolution to be
Resolution.Minute, just like it is in C#

* CustomDataRegressionAlgorithm.py - Remove warmup call from Initialize

* IndicatorSuiteAlgorithm.py - Adds PythonQuandl import to fix import error
2020-01-16 14:03:55 -08:00
Martin Molinero 14be31d0e5 BacktestingResultHandler orders delta
- BacktestingResultHandler will send a maximum of 50 orders per update
packet and will check `LastFillTime` and `LastUpdateTime` too
- Fix invalid linked file
`AccumulativeInsightPortfolioRegressionAlgorithm`
2020-01-16 17:50:42 -03:00
Jared b95973cf69 Merge pull request #3940 from wardjm/feature-accumulative-model
Feature accumulative model
2020-01-14 13:57:10 -08:00
AlexCatarino 76c70f1ea2 Adds MarketCap Member to FineFundamental Class
Adds `MarketCap` member to `FineFundamental` class that represents the aggregate market value of a company represented in dollar amount.

Changes `CoarseFineFundamentalRegressionAlgorithm` (C# and Python) to select securities based in its market capitalization. Same result as selecting by P/E ratio.
2020-01-04 00:33:29 +00:00
Jeffrey Ward a296d346a4 Pull request fixes. 2019-12-20 18:01:35 -05:00
Jeffrey Ward a796f30458 Added AccumulativeInsightPortfolioConstructionModel. 2019-12-20 18:01:35 -05:00
AlexCatarino f615a14155 Fix Consolidators Python timedelta
In `PeriodCountConsolidatorBase`, differentiate the type of the `PyObject` and create an `IPeriodSpecification` accordingly. If the `PyObject` is a C# `Func<DateTime, CalendarInfo>` or a convertable Python method, we create a `FuncPeriodSpecification` with it as a parameter. If the `PyObject` is a `datetime.timedelta`, we create a `TimeSpanPeriodSpecification` with it as a parameter after a conversion to `TimeSpan`.

- Adds example in `DataConsolidationAlgorithm`
- Adds unit test for `timedelta` overload.
2019-12-04 17:59:31 +00:00
AlexCatarino 9e6e2f9b22 Use Universe.Unchanged in Alpha Example Algorithm
In the Coarse Universe Selection of the following algorithms
- ContingentClaimsAnalysisDefaultPredictionAlpha
- GreenblattMagicFormulaAlpha
- PriceGapMeanReversionAlpha
- SykesShortMicroCapAlpha
Universe.Unchanged is now used when the universe is not changed instead of saving a list of symbol and returning it.

Other minor refactoring.
2019-11-30 11:50:01 +00:00
Jared ec4f714799 Merge pull request #3862 from gsalaz98/feature-3775-add-benzinga-custom-data
Implements Benzinga Custom Data
2019-11-27 15:39:22 -08:00
Gerardo Salazar 8c16ffde8d Address review - Fixes bug where tags were not being deserialized
* Write files by `UpdatedAt` date instead of the `CreatedAt` date
* Added ability to append to compressed files if file does not exist
* Cleaned up code as per review
* misc. documentation changes
2019-11-25 14:32:45 -08:00
Jared 6e9c5495ff Update readme.md 2019-11-24 16:29:21 -08:00
Martin Molinero d34a6f4a67 Add Constituent basic template algorithm 2019-11-22 11:39:03 -03:00
Gerardo Salazar a3c96059f7 Address review - Remove RSS converter and only parse API responses
* RSS converter now lives at: https://gist.github.com/gsalaz98/b87992cd5a5a214d01c63dbbefbbf12c
* Removed BenzingaNewsFactory as it is no longer needed
* Cleaned up code as per review to make this more maintainable
* Included new documentation
* Filter articles with no Symbols from being written
* General code improvements (duplication reduction, etc.)
2019-11-20 14:47:32 -08:00
Martin Molinero 70358482d4 Add ConstituentsUniverseDataGenerator algorithm
- Fix `ToString` implementation of the `SecurityIdentifier.None`. Adding
unit test
2019-11-20 17:22:27 -03:00
Martin Molinero e2c129a311 Improved version
- Renaming `PreSelected` to `Constituents`
- Adding base `ConstituentsUniverse`
- Adding Py and C# regression algorithm
- Fixing bug in `UniverseSelection`, it wasn't removing pending to be
removed securities unless the universe selection changed
- Adding test data
2019-11-20 17:16:44 -03:00
Gerardo Salazar e4789e0b23 Implement Benzinga News Downloader
* Make Benzinga News Converter more efficient (and cleaner!)
* Implement JSON converter for serialization/deserialization process
* Fix bug where duplicate symbols would be added to news.Symbols
* Modify algorithm strategies
2019-11-19 10:28:48 -08:00
Gerardo Salazar e6a9a3a4d1 Address review Mike's review and Fix timezone issues in BenzingaNews
* Cleaned up code inside BenzingaDataConverter
* Added more documentation to potentially confusing bits around the code

Previously, we would be storing Benzinga time in local time (i.e. with
about a 7hr offset from UTC since I'm in Pacific Time). But now, we
instruct Json.NET to serialize and deserialize dates as UTC.

Additionally, because the data resolution was not set to `Second`,
EndTime would be rounded down with `Time` to the closest minute. We
fixed that by specifying that the data is in `Second` resolution.
2019-11-19 10:28:48 -08:00
Gerardo Salazar bc1f608dce Address review - Code cleanup
* Makes BenzingaNewsAlgorithm throw a hard error if the Symbol is not
found inside the BenzingaNews object in OnData
2019-11-13 13:38:37 -08:00
Gerardo Salazar 4a95c36a96 Address Jared's review: Update example algorithms and property types 2019-11-13 13:38:36 -08:00
Gerardo Salazar 629de49b10 Implement Benzinga custom data as ToolBox application and BaseData class 2019-11-13 13:38:36 -08:00
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
Jared bd0613f8cb Merge pull request #3804 from Martin-Molinero/bug-3327-invalid-initial-symbol-changed-event
Fix invalid initial SymbolChanged event
2019-11-08 08:07:34 -08:00
AlexCatarino 3fca51e314 Addresses Peer-Review 2019-11-07 22:26:46 +00: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