Commit Graph

15 Commits

Author SHA1 Message Date
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 0202df35f4 Replaces Enum CalendarType for Static Class with the Same Name
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.
2019-04-08 22:10:04 +01:00
AlexCatarino 5314e7426d Implements Calendar (Weekly/Monthly) Consolidator
Implements consolidators that group bars by a calendar unit (week or month).
2019-04-08 22:10:04 +01:00
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 06fa8b065a Showcases Consolidate method feature in DataConsolidationAlgorithm 2018-06-12 13:17:50 -04:00
Michael Handschuh bb21171943 Implements python Consolidate API
Collapse QuoteBar to TradeBar if trade bar handler specified
2018-06-12 13:17:49 -04:00
Michael Handschuh 18a559943e Upgrade LEAN Python to 3.6 from 2.7
- Adds log to display the python version the algorithm is using.
- Fixes python algorithms that were failing because of small subtleties
like leading zeroes.
- Updates pythonnet with a version compiled with python 3.6 flags

- Changes in DockerfileFoundation: we now use miniconda to manage the python
environment.
- Took the opportunity to add NTLK (#1349), Tensorforce (#1369) and
PyTorch/Pyro (#1385).
- Changes readme in Algorithm.Python to show steps to install miniconda
2018-02-23 15:09:06 -05:00
Stefano Raggi a39e6a8e28 Revert "Merge pull request #1526 from AlexCatarino/python3"
This reverts commit 2e523992d0, reversing
changes made to fa48fc23ea.
2018-02-14 16:03:12 +01:00
AlexCatarino 84282503d0 Fixes python algorithm to be python 3 compliant 2018-02-13 13:00:50 +00:00
Jared Broad dc27c4e3d6 Added tags to python algorithms 2017-09-21 08:27:41 -04:00
AlexCatarino 6242706342 Modifies python example algorithms to show implicit convertion benefits 2017-06-15 18:40:34 +01:00
AlexCatarino 18d83fb8ec Updates python framework to support python datetime
Updates nuget package to support conversion from C# DateTime to python datetime.
Updates algorithms to reflect this change.
2017-05-23 13:40:26 +01:00
Alexandre Catarino 58f0caf647 Updates example algorithms written in Python (#889)
Some python algorithms suffered corrections to run under the new python framework (pythonnet).
Others were deleted because some features will be supported in futures implementations.

Adds a method in AlgorithmPythonUtil to transform C# DateTime into Python datetime
2017-05-04 13:02:25 -04:00
AlexCatarino 7e2d6c80bf Adds DataConsolidationAlgorithm.py
Adds Python version of DataConsolidationAlgorithm
2016-03-29 15:13:39 -03:00