Commit Graph

413 Commits

Author SHA1 Message Date
Michael Handschuh fdc866fda0 Reverting 'Merge pull request #2483 python-history-provider'
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.
2018-09-18 18:37:23 -04:00
AlexCatarino 3e4a71cd50 Creates QCAlgorithm.py: a bridge between C# QCAlgorithm and python algorithms 2018-09-17 19:05:48 +01:00
AlexCatarino 720e0400fc Implements custom seed function to CustomSecurityInitializerAlgorithm 2018-09-17 18:28:59 +01:00
AlexCatarino 62d4cb837a Updates PythonPackageTestAlgorithm to use QCAlgorithm.Log instead of print 2018-08-28 15:06:34 +01:00
AlexCatarino 93a88eda95 Updates FractionalQuantityRegressionAlgorithm to use SetBuyingPowerModel 2018-08-21 16:49:07 +01:00
Michael b30d429be6 Merge pull request #2427 from QuantConnect/bug-2064-add-option-contract-throw-if-underlying-not-raw
AddOptionContract - throw if existing underlying equity not in Raw mode
2018-08-21 11:44:16 -04:00
Stefano Raggi b4a2536b86 AddOptionContract - throw if existing underlying equity not in Raw mode
Also added OptionChainProviderAlgorithm to regression test suite
2018-08-21 14:51:43 +02:00
AlexCatarino 76cc75006c Refactors BlackLittermanOptimizationPortfolioConstructionModel
1. Apply the pattern used in `EqualWeightingPortfolioConstructionModel`
2. Change the logic to compute the views from the insights.
3. Change the logis to compute the posterior mean and covariance

Use `UnconstrainedMeanVariancePortfolioOptimizer` in `BlackLittermanPortfolioOptimizationFrameworkAlgorithm` to bypass the difference in regression tests with `IPortfolioOptimizer` that rely on different algorithms in C# and python.

Adds unit tests for BLOPCV to test the implementation against Black and Litterman 1999 paper.
2018-08-20 21:01:14 +01:00
Martin Molinero ed33286842 Updating regression statistics 2018-08-15 21:10:49 -03:00
Jared Broad db0f85122c Increase the universe of assets to increase insights 2018-08-15 18:41:46 -04:00
Martin Molinero c1272874fb Adding regression statistics 2018-08-15 11:58:46 -03:00
Jared Broad ff172add77 Added missing examples to py proj 2018-08-14 21:28:35 -04:00
Jared Broad c4d0baab49 Added 2 example benchmark alphas 2018-08-14 18:43:45 -04:00
AlexCatarino 68dfe0648a Adds more requirements checks and updates readme 2018-08-13 11:56:51 +01:00
Stefano Raggi 3a93f3e4db Update download paths to cdn.quantconnect.com 2018-08-06 17:41:54 +02:00
Michael cfb05d190f Merge pull request #2328 from AlexCatarino/feature-2326-implements-futures-template-framework
Implements BasicTemplateFuturesFrameworkAlgorithm
2018-08-02 10:44:09 -04:00
Michael 65d3e43ef6 Merge pull request #2332 from QuantConnect/bug-2313-coarse-fundamental-regression-update
Update CoarseFundamentalTop5Algorithm to run as cloud regression test
2018-08-01 11:10:30 -04:00
Stefano Raggi dc4b961ec8 Update CoarseFundamentalTop5Algorithm to run as cloud regression test
- The algorithm has been renamed to CoarseFundamentalTop3Algorithm and updated to select the Top 3 instead of Top 5.
- The only new data required is daily, map and factor file for FB and has been added (map and factor files are dated 6/4/2018, as required by all regression tests).
- The coarse fundamental open source data has been updated.
- The expected regression statistics for the algorithm have been updated.
2018-07-31 21:20:06 +02:00
AlexCatarino 0bc157a8e7 Removes logging from framework models and algorithms
Shipped modules should be silent unless error case.
2018-07-31 19:16:17 +01:00
AlexCatarino b741ed82a4 Minor fix in BasicTemplateFrameworkAlgorithm.py
Use python version of `EqualWeightingPortfolioConstructionModel` in python version of `BasicTemplateFrameworkAlgorithm`
2018-07-31 12:12:06 +01:00
AlexCatarino e5ed09924b Implements BasicTemplateFuturesFrameworkAlgorithm
This algorithm shows how to implement a futures strategy in a framework algorithm.
`FutureUniverseSelectionModel` portfolio selection model was implemented to provide a base class to help create other futures universe selection models.
2018-07-30 22:21:47 +01:00
Stefano Raggi 5382a0c72c Add Quandl API key to URL in CustomDataRegressionAlgorithm 2018-07-25 15:21:59 +02:00
Stefano Raggi 16f856031c Update start date for OptionSplitRegressionAlgorithm 2018-07-24 18:59:53 +02:00
Stefano Raggi 3d48efcbea Add Tiingo Daily Prices example algorithm 2018-07-24 13:24:52 +02:00
AlexCatarino d75794ede2 Adds indicator with custom data in BasicTemplateIntrinioEconomicData.
This addition aims to show that the fix of the preivious commit solves the bug.
2018-07-23 17:26:43 +01:00
AlexCatarino b0d1606118 Refactors portfolio construction models with portfolio optimization
- Creates `MinimumVariancePortfolioOptimizer` and `MaximumSharpeRatioPortfolioOptimizer` portfolio optimizer. They implement `Optimize` method that returns a array of float representing the portfolio weights.
- Refactors `BlackLittermanOptimizationPortfolioConstructionModel` and `MeanVarianceOptimizationPortfolioConstructionModel` to use the portfolio optimizers. Part of the logic in BLOPC was changed to match the MVOPC one.
- Adds `BlackLittermanPortfolioOptimizationFrameworkAlgorithm` similar to `MeanVarianceOptimizationFrameworkAlgorithm` that uses BLOPC.
2018-07-20 23:09:48 +01:00
Michael 0515893ba7 Merge pull request #2278 from QuantConnect/bug-2268-timeinforce-regression-fix
Fix TimeInForceAlgorithm regression tests
2018-07-19 10:17:41 -04:00
Stefano Raggi 1138b0c1e2 Fix TimeInForceAlgorithm regression tests 2018-07-19 11:52:40 +02:00
Stefano Raggi 7bd2a2049c Fix BasicTemplateFuturesAlgorithm C#/Python difference 2018-07-19 00:57:34 +02:00
Michael 975c2845c3 Merge pull request #2246 from QuantConnect/feature-2245-updates-pythonnet
Update pythonnet version to v1.0.5.8
* Includes fix for date time UTC bug
2018-07-18 11:26:19 -04:00
Michael 3bf8cd228b Merge pull request #2259 from AlexCatarino/master
Fixes typo in PearsonCorrelationPairsTradingAlphaModelFrameworkAlgorithm.py
2018-07-18 10:55:17 -04:00
AlexCatarino 6fcb381c46 Fixes typo in PearsonCorrelationPairsTradingAlphaModelFrameworkAlgorithm.py
The lookback period for one year should be 252, since one year has 252 trading days.
2018-07-17 22:18:17 +01:00
Juan José D'Ambrosio ae99f7b9a1 Add Python version
Add comments to `IRegressionAlgorithmDefinition` members.
2018-07-17 18:01:53 -03:00
AlexCatarino 8e3b7153b2 Rebase with pythonnet/master and fix datetime UTC bug
Updates pythonnet with pythonnet/master and fix datetime issue ([65ac279](https://github.com/QuantConnect/pythonnet/commit/65ac279a03dbded39fe3e28bb79c233f0c970f6f)).
2018-07-16 11:52:54 +01:00
AlexCatarino 12dda21727 Adds setup.py script that handles pythonnet installation in Lean 2018-07-12 17:14:03 +01:00
AlexCatarino 0a6488ba5b Removes PairsTradingAlphaModelFrameworkAlgorithm
This algorithm uses the `BasePairsTradingAlphaModel` that should only be used as a base class, since it doesn't have a method to select the pairs.
2018-07-11 23:40:30 +01:00
AlexCatarino c59ff47ed7 Refactors PearsonCorrelationPairsTradingAlphaModelFrameworkAlgorithm
- Moves `PearsonCorrelationPairsTradingAlphaModel` class to its own file in order to make it available as a framework model.
- Follows existing pattern design that alpha models receive a lookback and a `Resolution` object.
- Algorithm implements `IRegressionAlgorithmDefinition`.
2018-07-11 23:40:30 +01:00
AlexCatarino 6121236f20 Implements PearsonCorrelationPairsTradingAlphaModelFrameworkAlgorithm
This algorithm is an example on how to extend the `BasePairsTradingAlphaModel` to select a pair to trade based on pearson correlation.
2018-07-11 23:40:29 +01:00
AlexCatarino 6dbe83d0be Renames PairsTradingAlphaModel
- Since it will be used as a base class for other pairs trading models, it was ranamed as BasePairsTradingAlphaModel

- Use a tuple of symbols are key of BasePairsTradingAlphaModel._pairs dictionary.
2018-07-11 23:40:29 +01:00
AlexCatarino e815fe8cba Refactors PairsTradingAlphaModel
Instead of using a single, pre-defined, pair set in the class constructor, the pair is defined when securities are changed, therefore depending on the universe selection model.
2018-07-11 23:40:29 +01:00
Stefano Raggi 3e3b6eea20 Fix Python version of FractionalQuantityRegressionAlgorithm 2018-07-11 17:18:13 +02:00
Michael e4fbed8816 Merge pull request #2218 from jingwu74/master
Remove semicolons in python algorithms
2018-07-06 12:42:43 -04:00
Jing Wu 084cd294b0 Remove semicolon in python algrotihms 2018-07-06 11:05:16 -04:00
Michael Handschuh b783e98d91 Dont chain algorithm indicator helper methods
Chaining these is a bad pattern and should not be used in any of our
sample code.
2018-07-06 05:28:17 -04:00
AlexCatarino 6676098c9c Implements python version of BasicTemplateOptionsFrameworkAlgorithm 2018-07-05 20:59:08 +01:00
Stefano Raggi 18b8b7c971 Fixed Python imports causing failures when running all regressions at once 2018-07-03 21:03:35 +02:00
Stefano Raggi 56399d8edb Fix bug in CustomDataRegressionAlgorithm (Python) 2018-07-03 20:52:41 +02:00
Stefano Raggi 96fd5b7167 Simplify date comparison in CoarseFineFundamentalRegressionAlgorithm 2018-07-03 15:00:25 +02:00
Stefano Raggi 53800c102e Remove semicolons from Python statements 2018-07-03 00:59:50 +02:00
Stefano Raggi e95863a919 Update Python comparisons to None to use "is None" instead of equality 2018-07-03 00:55:35 +02:00