Commit Graph

26 Commits

Author SHA1 Message Date
Jhonathan Abreu 84b991b577 Some fixes for new C# enums handling in Pythonnet (#8898)
API Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Some fixes for new C# enums handling in Pythonnet

* Minor changes and cleanup

* Update Pythonnet version to 2.0.45

* Minor changes

* Minor fix

* Minor fix

* Minor change

* Minor change

* Minor unit test fix
2025-07-31 16:53:24 -04:00
Martin-Molinero b81bcf086e Minor syntax fixes for python algorithms (#8705) 2025-04-21 10:06:47 -03:00
Martin-Molinero 7879795207 Enable daily precise end time by default (#8254)
API Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
* Default daily precise end times

- Enable by default daily precise end times. Updating stats
- Minor fix for algorithm manager consolidator updates, adding new regression test
  asserting behavior and updating others
- Minor fix for SubscriptionData creator avoid round down on warmup if
  not appropiate
- Adjust consolidators to emit on daily strict end times if requested
  daily resolution and setting enabled
- Updating regression algorithms

* Skip daily data on extended market hours

* Some cleanup and self review

* Revert unrequired change
2024-08-14 12:49:56 -03:00
Ashutosh 1cae47ab25 pep8 conversion of python algos (#7942)
* pep8 conversion of python algos

* adding 10 more pep8 converted algos
2024-04-18 15:14:56 -03:00
Jhonathan Abreu 906ab20bee Trailing stop orders (#7402)
* Add trailing stop orders base implementation

* Handle trailing stop order prices rounding

* Implement trailing stop orders fill logic

* Minor fill model changes

* Add ApplySplit to fill model interface for models that might need to be aware of splits.

Filling trailing stop orders require keeping track of min/max prices, which need to be split adjusted.

* Add brokerage order updated event for communicating certain order types prices changes

* Add order update event args class for brokerage side order updates

* Revert IFillModel.ApplySplit

* Add trailing stop orders regression algorithm

* Updated order ticket demo algorithm to include trailing stop orders

* Some cleanup

* Support trailing stop orders in IB brokerage model

* Some cleanup

* Fix failing tests

* Fix failing regression algorithm

* Address peer review

* Add trailing stop price calculation unit tests

* Minor changes

* Minor change
2023-07-28 17:49:58 -04:00
Martin-Molinero 03f56481d4 Refactor python algorithm import (#5657)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* Python research import improvements

- Improve start.py for research env
- Remove unrequired imports

* Centralize algorithm imports

* Add regression test GH action

* Unit test python import clean up

* Join research and main imports

* More python import clean up

* Fix failing skipped regression algorithm
2021-06-15 19:06:06 -03:00
Martin Molinero 0027ab1e66 Regression test assert order list hash
- Regression tests assert order list hash value
- Normalizing some regression test behavior that had differences between
C# and Py
2020-02-19 20:26:12 -03:00
Martin Molinero f976ffa099 Removing BacktestingTransactionHandler thread
- For backtesting the algorithm thread will sequentially process pending
order requests
   - Adding new non blocking `BusyCollection`
- Updating `UpdateOrderRegressionAlgorithm` that suffered of a race
condition: it supposed `OnOrderEvent` would be called after the call to
`Transactions.AddOrder()` was finished
2019-05-10 16:15:24 -03:00
Jack Simonson c071979350 Assorted changes to address import statements and Rolling Window code that fails to run 2019-03-04 11:37:21 -08: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
Jing Wu 084cd294b0 Remove semicolon in python algrotihms 2018-07-06 11:05:16 -04: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
Stefano Raggi 7a9fc44ccd Update Python regression tests to match C# equivalents 2018-07-02 23:50:51 +02:00
Michael Handschuh c25afbad29 Add fill/update/cancel times to order object
LastFillTime is updated on each partial/fill order event
LastUpdateTime is updated on each submitted order event w/ update count > 0
CancelTime is updated on canceled order events

Also fixes bug in regression algorithm where it used Time instead of UtcTime
for creating the SubmitOrderRequest object.
2018-05-02 14:16:33 -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
AlexCatarino 489e11741b Fixes some python algorithms
CustomCharting: did not initialize self.lastprice
QuandFuturesData: algorithm file name and class didn't match
UpdateOrderRegression: did not cast quantity (int) to decimal
UserDefinedUniverse: selector function returns C# List
2017-09-29 11:42:56 +01: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 799fbde198 Adds tests for keras and tensorflow
Updates PythonPackageTestAlgorithm to include tests for keras an tensorflow packages
Fix bugs in two algorithms due to pythonnet update.
2017-06-02 10:45:45 +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 3b2cd9a7c7 Adds UpdateOrderRegressionAlgorithm.py
Adds Python version of UpdateOrderRegressionAlgorithm
2016-03-10 17:55:13 -03:00