Commit Graph

60 Commits

Author SHA1 Message Date
Gerardo Salazar 7c3caec07f Use external NuGet package for Arrow
* Updates CI for Arrow
  * Updates DockerfileLeanFoundation
  * Adds Arrow to Python packages tests
2020-12-06 19:13:54 -08:00
Gerardo Salazar 2c7bde422a Reuses MemoryStream to avoid having to reallocate consistently
* Cleans up .csproj and packages.config
  * Adds IDisposable to PandasConverter, PandasArrowMemoryAllocator
2020-12-06 19:13:54 -08:00
Gerardo Salazar 0a70611d81 MVP of Apache Arrow in-memory pandas DataFrame construction 2020-12-06 19:13:16 -08:00
Martin-Molinero 61fda8b62c Protobuf will use recyclable memory stream (#4921)
* Protobuf will use recyclable memory stream

- Serialization will reuse recyclable memory streams
- Remove serialization of exchange and sale condition for ticks.
  Updating unit tests.
- There is no need to serialize BaseData.EndTime, covered by unit tests.

* Tick will keep a parsed sale condition property

* Readd tick exchange. Json ignore ParsedSaleCondition
2020-11-06 20:59:25 -03:00
Martin-Molinero 9cdb4a91c5 Refactor live data feed (#4636)
* Live Coarse universe refactor

- Live trading will source Coarse and Fine fundamental data directly
  from disk. Updating unit tests.

* Adds ILiveDataProvider interface

  * Adds wrapper for IDataQueueHandler implementations

  * Replaces IDataQueueHandler with ILiveDataProvider in
    LiveTradingDataFeed

  * Edits IDataQueueHandler documentation

* Maintains aggregation for current IDQH impls and skips for ILDF impls

  * Note: No unit test was created for this method, go back and TODO

* Protobuf Market data

- Adding protobuf support for Ticks, TradeBars and QuoteBars. Adding
  unit tests.

* Adds unit tests for LiveDataAggregator changes

  * Fixes bug where custom data was not handled as it was before
  * Fixes race condition bug because of variable reuse in class

* Add protobuf extension serialization

* Fixes for protobuf serialization

* Refactor

* Fix OptionChainUniverse

* replace BaseDataExchange pumping ticks with consolidators

* AlpacaBrokerage

* BitfinexBrokerage

* GDAXBrokerage

* OandaBrokerage

* InteractiveBrokers

* TradierBrokerage

* FxcmBrokerage

* PaperBrokerage

* etc

* WIP fixes for existing LTDF unit tests

* Fixes more LTDF unit tests

* make IDataAggregator.Update recieving Generic BaseData rather than Tick

* Change IDataQueueHandler.Subscribe method

* Some fixes after adding new commits

* Adds protobuf (de)serialization support for Dividend and Split

* Serialize protobuf with length prefix

* Fix missing LTDF unit tests

* Adds TiingoNews protobuf definitions

* fix comments

* more fixes on IQFeedDataQueueHandler

* disallow putting ticks into enumerator directly

* ScannableEnumerator tests

* fix OandaBrokerage

* AggregationManager unit tests

* fix AlpacaBrokerage tests

* fix InteractiveBrokers

* fix FxcmBrokerage tests

* call AggregationManager.Remove method on unsubscribe

* fix GDAX existing tests

* Fixes, refactor adding more tests for AggregatorManager

* Adds BenzingaNews protobuf definitions and round trip unit test

* Adds missing TiingoNews unit test to Protobuf round trip tests

* Improve sleep sequence of LiveSynchronizer

* need start aggregating first, and then can subscribe

* More test fixes and refactor

- Refactoring AggregationManager and ScannableEnumerator so the last is
  the one that owns the consolidator
- Adding pulse on the main LiveSynchronizer

* Improve performance of LEquityDataSynchronizingEnu

* Add missing Set job packet method

* Minor performance improvements

* Improvements add test timeout

- Improvements adding test timeout to find blocking test in travis

* Improve aggregationManager performance

* Testing improvements for travis

* Remove test timeouts

* More test fixes

- Adding more missing dispose calls and improving determinism

* fix IEXDataQueueHandler and tests

* Final tweaks to LTDF tests

* more AggregationManager tests

* consume and log ticks

* fix test: couldn't subscribe to Forex tickers

* change Resolution for all bar configs

* Improve RealTimeScheduleEventServiceAccuracy

* refactoring: move common code to base class

* fixed bug; unsubscribe SubscriptionDataConfig

* Small performance improvement

* Minor fixes

* Avoid Symbol serialization

* Fixes coarse selection in live mode

* Fix for live coarse

* Adds protobuf (de)serialization support for Robintrack

  * Adds round-trip unit test

* Minor performance improvements

* More minor performance improvements

* pass LiveNodePacket through to OandaBrokerage

* Fixes empty list becoming null value when deserializing with protobuf

* Reverts BZ live trading exception removal and fixes tests

* Refactor WorkQueue making it abstract

* Add try catch for composer

* Adds optional data batching period to LiveFillForwardEnumerator

* Override data-queue-handler with config

* Improve PeriodCountConsolidator.Scan performance

* Move batching delay to main Synchornizer thread

* Reverts addition of Robintrack protobuf definitions

* Give priority to config history provider if set

* Add Estimize protobuffing

- Add Estimize protobuffing support. Adding unit tests

* Always dispose of data queue handler

Co-authored-by: Gerardo Salazar <gsalaz9800@gmail.com>
Co-authored-by: Adalyat Nazirov <aenazirov@gmail.com>
2020-08-18 20:21:10 -03:00
Stefano Raggi 0a046699fc Consolidate SharpZipLib library usage 2020-05-28 11:18:44 +02:00
Martin Molinero 891cf4d69b Update to .Net 4.6.2 2020-05-15 17:32:46 -03:00
Martin Molinero c1b1d828f6 Update QLNet to 1.11.3 release 2020-05-14 18:55:50 -03:00
AlexCatarino 72f0f44f60 Updates Pythonnet Version
From 1.0.5.29 to 1.0.5.30
Ref.: https://github.com/QuantConnect/pythonnet/pull/42
2020-04-01 16:15:05 +01: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
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
Martin Molinero b35bc31f51 Version bump 1.0.5.26 2019-10-15 18:43:33 -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 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
Gerardo Salazar 340cc3a330 Upgrade dependency DotNetZip to version 1.13.3 to fix security issue 2019-06-11 11:03:37 -07:00
AlexCatarino c3de660551 Updates pythonnet to 1.0.5.20 2019-04-23 23:15:14 +01:00
AlexCatarino da6519b9f4 Updates pythonnet to 1.0.5.19
Updates PythonNet to 1.0.5.19
 - Related  https://github.com/QuantConnect/pythonnet/pull/28/
2019-04-02 17:17:40 +01:00
AlexCatarino 6d2460d8ed Updates pythonnet to 1.0.5.18
- Updates PythonNet to 1.0.5.18
  - Cherry picks the memory leak fix from upstream/pythonnet
2019-03-28 00:47:38 +00:00
AlexCatarino d91cad3123 Updates pythonnet to 1.0.5.17
- Updates PythonNet to 1.0.5.17
  -  Improve performance by adding new `interop` `type` cache holding a `bool`, true if its an `exception`. And adding a `setter` and `getter` cache for the `propertyobject`. Closes #2925.
  - Decimal parsing allows numeric string in exponential notation. Closes #2918 #2919.

Closes #2929
2019-02-22 17:46:59 +00:00
Martin Molinero d53a922cf0 PythonNet installation does not require copy pasting
- Requires a new PythonNet 1.0.5.15 package where the different `.dll` are in a
specific folder: `\win` `\linux` and `\osx`
- Removed not present `decimal.py` from `Algorithm.Python` project. It
was moved into `Common`.
- Replace `xbuild` for `msbuild` required for using the `System.Runtime.InteropServices`.
Also note the `xbuild` on travis prints:
> >>>> xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<<
2019-01-22 19:48:11 -03:00
AlexCatarino ef59fa7ba2 Updates pythonnet package.
In the new package:
- C# decimal conversion will use C# double and python float due to the big performance impact of converting C# decimal to python decimal;
2019-01-18 23:18:35 +00:00
AlexCatarino 823bb01438 Updates pythonnet
Includes memory leak fix (https://github.com/QuantConnect/pythonnet/commit/c6db86653e7fa4fa89e1f8404d72e346b67ed857 and https://github.com/QuantConnect/pythonnet/commit/bec9563d2958acc5adf3e8972b23609fe3914402)

- Fix python version to 3.6.6 (avoid updating to 3.7)
- Fix numpy version to 1.14.5 (tensorflow requirement)

- Adds py-earth python package (closes #2399).
2018-12-07 09:36:48 +00: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 a4db921b87 Updates pythonnet
Rebase with pythonnet/master
2018-04-09 18:59:59 +01: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 34a271adac Updates pythonnet
In this update, we had compiled pythonnet with python 3.6 instead of 2.7 flags
2018-02-13 13:00:50 +00:00
AlexCatarino 9459f47cba Updates pythonnet
In this update, methods overloads with decimal parameters accept python float.

- Fixes FractionalQuantityRegressionAlgorithm:
With the pythonnet update we can pass a python float where a decimal is required.
2017-12-29 17:25:48 +00:00
AlexCatarino c912c0d190 Updates pythonnet
In this update, we fixed type correspondence from C# Decimal to python decimal that caused wrong method overload binding.
2017-12-18 10:57:26 +00:00
AlexCatarino 9536123160 Updates pythonnet
In this update, we have changed our version of pythonnet to give precedence to methods that include a PyObject parameter.
2017-10-12 16:41:50 +01:00
AlexCatarino 099e871afd Updates pythonnet nuget version
In this new nuget package, we have included two versions Python.Runtime.dll for macOS
We also add the instructions to compile pythonnet for different operational systems
2017-09-29 17:59:38 +01:00
AlexCatarino d7f2411fcd Upgrades pythonnet version
In this version, we have fixed a bug that led to System.AccessViolationException when we add timezone information in the datetime.datetime object.
2017-09-12 17:33:52 +01:00
Jared Broad 8281911bd0 Revert "Upgrades pythonnet version"
This reverts commit 310e5c4211.
2017-08-22 16:11:54 -04:00
AlexCatarino 310e5c4211 Upgrades pythonnet version
In this version, we have fixed a bug that led to System.AccessViolationException when we add timezone information in the datetime.datetime object.
2017-08-21 21:59:59 +01:00
Stefano Raggi f704747696 Downgrade NodaTime to version 1.3.4 due to breaking changes in 2.x 2017-07-08 03:09:35 +02:00
Stefano Raggi e4005fa78c Upgrade NodaTime to version 2.0.3 2017-07-08 01:12:43 +02:00
Stefano Raggi 4f483abcd9 Upgrade libraries Accord.NET, CloneExtensions, MathNet, QLNet 2017-07-08 00:31:40 +02:00
Stefano Raggi 6d160533c3 Upgrade DotNetZip to version 1.10.1 2017-07-07 23:37:09 +02:00
Stefano Raggi d88d82af12 Upgrade Json.NET to version 10.0.3 2017-07-07 23:21:47 +02:00
AlexCatarino 37b22d4693 Updates pythonnet nuget version
In this version, we have just included a dll for macOS
2017-06-23 13:22:24 +01:00
AlexCatarino 6ca9d7cf14 Updates pythonnet package
This update implemented implicit conversion.
From now on, python algorithms will be able to use string object instead of Symbol object when a method overload requires Symbol.
2017-06-15 18:32:29 +01:00
AlexCatarino f6aa31643c Updates pythonnet package
This new pythonnet package makes available the latest version from pythonnet master branch and includes modifications to enable charting in Lean for python.

The dockerfile to create images for the cloud is updated to reflect the package update and adds keras and tensorflow
2017-06-02 10:45:45 +01:00
AlexCatarino 4eb80e78e9 Upgrades pythonnet to version 1.0.2.1
Previous version was not matching methods with nullables accordingly
2017-05-26 01:16:54 +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
AlexCatarino 40e570b2cb Updates QuantConnect.Pythonnet package
New version include instructions to copy nPython.exe to bin directories
2017-04-11 17:05:29 +01:00