Commit Graph

191 Commits

Author SHA1 Message Date
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
Michael Handschuh b4b3aae112 Rename Signal -> Alpha
Whoa... I think I got everything :)
2017-12-15 18:24:58 -05:00
Michael Handschuh d8ef289c9b Add IAlgorithm.IsFrameworkAlgorithm and BacktestingResut.IsFrameworkAlgorithm
Flag indicates whether or not the algorithm is a framework algorithm.
2017-12-14 19:43:26 -05:00
Michael Handschuh c879f4ee83 Chart average signal scores daily 2017-12-12 15:57:00 -05:00
Michael Handschuh 39f5080a40 Rename framework events to OnFramework<Event>
This more closely follows existing conventions.
2017-12-08 12:04:53 -05:00
Michael Handschuh c093b45319 Add IAlgorithm.SignalsGenerated event
This event will fire each time step that generates signals and will
include all signals generated by the algorithm at that time step.
2017-12-08 10:07:54 -05:00
Michael Handschuh 14a2a09581 Add explicit methods for updating framework models
IAlgorithm.FrameworkOnData is used to pulse models with new data each time step
IAlgorithm.FrameworkOnSecuritiesChanged is used to pulse models with security changes

These two functions need to be separate to ensure that if we add an indicator during
the securities changed event that it will get the data from the current time step.
This forces us to call the securities changed event before we invoke the consolidators
for the current time step.
2017-12-08 10:07:54 -05:00
AlexCatarino 70d67e3fb3 Fixes OnEndOfDay exceptions in python algorithms
The engine creates schedule events that call OnEndOfDay() and OnEndOdDay(Symbol) for every security. If just one of these method overloads is defined in the python script, the call of the other will throw a exception due different parameter count.
In this case, we will disregard this exception and throw those that may happen in the method implementation body.
2017-12-06 18:43:23 +00:00
AlexCatarino fb12e79a1c Changes PandasConverter accessibility levels
Private field PandasConverter _converter is now public property PandasConverter.
With this change, we will be able to use it in QuantBook.
2017-12-04 21:38:39 +00:00
AlexCatarino dfffbd6953 Adds IFutureChainProvider interface with base implementations
- Move BacktestingFutureChainProvider provider to Lean.Engine.DataFeeds along with its options equivalent.

- EmptyFutureChainProvider: provider that returns an empty list of symbols
- CachingFutureChainProvider: implements caching by date
- BacktestingFutureChainProvider: provider that gets chain from local files
- LiveFutureChainProvider: provider that gets chain from external source (empty list of symbols for now)
2017-12-04 14:16:59 +00:00
AlexCatarino 2ff636869c Fixes summary of members in python wrapper classes
Summary of members in python wrapper classes where pointing to other methods for reference when they should have a meaningful description to be used in documentation
2017-11-16 14:00:22 +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 96fee374fb Fixes OnMarginCall runtime error in python
After we included the method name in the error message, OnMarginCall method was throwing a runtime error when that method was not defined in the script where it sould simply be directed to the method in the base class.
2017-10-09 11:35:44 +01:00
Michael Handschuh 7c0a0c4698 Set algorithm name in setup handler
When using the console setup handler, the algorithm's type name
will be used as an identifier.
2017-10-06 16:23:38 -04:00
Michael Handschuh ecd92462da Clean white space 2017-10-06 16:23:37 -04: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 6624e18f08 Fixes OnMarginCall for python algorithms
Due to pythonnet limitations, the list of SubmitOrderRequest could not be modified by OnMarginCall event handler. We now get a new list from that method and update the list in the wrapper.
2017-09-22 20:50:49 +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 9b190f2363 Fix path comparison in Loader
These two path expressions evaluate to the same physical directory, differing only by the trailing separator char:
- new FileInfo(assemblyPath).DirectoryName
- AppDomain.CurrentDomain.BaseDirectory
2017-08-17 22:08:23 +02:00
comesx4 fac89a6fae this judgment should be "!=" if the assembly not located in the base directory 2017-08-17 17:34:17 +08:00
andrewhart098 ba565e2b11 Merge pull request #1047 from QuantConnect/option-chain-provider
Option Chain Providers
2017-08-08 11:15:53 -04:00
Andrew e116709b24 Specify <LangVersion> of 6 in all csproj files 2017-08-07 15:27:26 -04:00
Stefano Raggi e379457757 Refactor option chain providers
- Moved provider implementations out of brokerages into their own classes
- Removed DefaultOptionChainProvider
- Added BacktestingOptionChainProvider and LiveOptionChainProvider
- Moved SetOptionChainProvider call from Engine to setup handlers
2017-08-02 22:43:15 +02:00
Stefano Raggi 8fdb79e578 Add OptionChainProvider to IAlgorithm/QCAlgorithm
- SetOptionChainProvider method
- OptionChainProvider property
2017-08-02 22:43:12 +02:00
AlexCatarino 46ead54f79 Implements Quandl support for Python
Implements Quandl support for Python.
It was not possible to derive from Quandl in order to select the column. If the data did not have "close", it would thrown an exception since it would look for this work in a dictionary.
It is now possible to select the column.
See example QuandFuturesDataAlgorithm.py
2017-07-27 00:18:08 +01:00
Stefano Raggi e7172a6841 Update QCAlgorithm.RuntimeStatistics to be a ConcurrentDictionary
This change enables SetRuntimeStatistics to be called from event handlers fired by other threads (for example in the OnOrderEvent with IB)
2017-07-20 20:39:51 +02: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 e463ccf088 Upgrade all projects to target .NET Framework 4.5.2
In the advanced build settings, Language version was also upgraded from C# 5.0 to C# 6.0. The minimum Visual Studio version required will now be VS2015.
2017-07-07 22:49:17 +02:00
AlexCatarino 3c23759efd Implements History Requests returning pandas.DataFrame
Algorithms written in python can access to new overloads for the QCAlgorithm.History method that returns a dictionary with pandas.DataFrame
2017-07-06 15:09:59 +01: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 6242706342 Modifies python example algorithms to show implicit convertion benefits 2017-06-15 18:40:34 +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 0c28813e43 Fixes exception at OnMarginCall in Python
When OnMarginCall is not defined at the python script, pythonnet cannot find the method in the base class.
Instead of throwing the exception and exiting, we direct the event to the method in the base class.
2017-06-13 18:27:11 +01:00
AlexCatarino 919e0225aa Removes Impromptu.ActLike call at the python wrapper
Calling Impromptu.ActLike<IAlgorithm> to make the python object acts like a IAlgorithm caused multiple AlgorithmPythonWrapper objects running in parallel to hold the same python object. That call was removed and instead we access the python object directly.

- Removes AlgorithmPythonUtil.py and add its code directly in AlgorithmPythonWrapper.cs

- Clean up: removes all references to IronPython and ImpromptuInterface
2017-06-02 17:54:54 +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
Jared 1d0644b7a4 Merge pull request #936 from AlexCatarino/py-time
Updates python framework to support python datetime
2017-05-23 19:05:01 -04: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
Stefano Raggi 6d47ab94b8 Add AlgorithmSettings class and IAlgorithm.Settings property 2017-05-22 20:50:23 +02:00
Stefano Raggi b657c0d663 Fix speed issue in AlgorithmPythonWrapper 2017-05-21 22:40:55 +02:00
Anshul e7a3a2f3bd Fixes 5 warnings with code CS1574 2017-05-18 17:05:09 +05:30
jaredbroad 469abd42cf Shuffle PyUtil to build-none, common project 2017-04-30 17:44:43 -04:00
jaredbroad 2ac57081a6 Fix static activator reuse and made PyUtils copy to bin directory 2017-04-30 17:17:09 -04:00
jaredbroad b2e8e61187 Copied python module into bin to import 2017-04-30 16:08:15 -04:00
jaredbroad fd64b05db8 Apply sed to use UC4 by default (linux), windows should use UC4
sed -i -e 's/UCS2/UCS4/' Common/QuantConnect.csproj

sed -i -e 's/UCS2/UCS4/' Algorithm/QuantConnect.Algorithm.csproj

sed -i -e 's/UCS2/UCS4/' Algorithm.CSharp/QuantConnect.Algorithm.CSharp.csproj

sed -i -e 's/UCS2/UCS4/' AlgorithmFactory/QuantConnect.AlgorithmFactory.csproj
2017-04-30 14:19:09 -04:00
jaredbroad cd56b5323d Tidy up the local loading of pyc files 2017-04-30 13:10:27 -04:00