Back

[Update] Python Library Support

We're happy to share that python libraries are now fully supported in QuantConnect. We've completely re-engineered the python stack to use PythonNet which acts as a bridge between Python and .NET enabling use of all your favorite libraries!

The vast majority of the API remains identical but there will be some gotcha's. If you find your python algorithm aren't working anymore you will need to do a little conversion work to get them into the new system. There are 30 examples of the new python net framework in github you can use as a reference.

We've been testing for about 6 months but there will likely be issues in the integration. If you find an issue please let us know through support: support@quantconnect.com 

Thanks Alex and Stefano for all their work!

 

Update Backtest






The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.



0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Thanks for all of your hard work guys, much appreciated!

1

Is there an option of using sklearn now? I failed importing it for some reason.

1

Yes it should be available next week. We're taking a poll of all the

libraries people want -- are there any others you might need?



Best,

Jared
0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Awesome, thank you for the reply and your work! 

Well, there are also keras, theano and tensorflow might be needed in the future:) 

1

That is super. 

Nice work!

1

Would love keras, tensorflow, pandas, and numpy
0

Really appreciate the work and the python implementation
0

At the moment, numpy, pandas and scipy are supported.
We have tested sklearn, blaze, cvxopt, cvxpy, pykalman and statsmodels and they will be available as soon as possible.
 

3

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


+1 for keras, theano and tensorflow 

6

Add a vote for xgboost.

2

I haven't researched PythonNet yet; could a C# algorithm reference the whitelisted Python libraries?

The use case I'm thinking of would involve using C# for all of the trade execution logic, but pass data to one of Python's superior predictive modeling packages for scoring?

3

With Python.NET, a C# algorithm can import the whitelisted Python libraries.
We will work on this idea/suggestion. Thank you.

2

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Update.
Here is the whilelist as of today (20170602): pycparser, pandas, scipy, numpy, sklearn, blaze, cvxopt, cvxpy, pykalman, statistics, statsmodels, arch, copulalib, xgboost, theano, keras and tensorflow.

4

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Would love pyhsmm and pymc3 as well

0

Will you please add Chainer?

0

hi great. thanks
0

I will add to Alexandre Catarino wish list tpot, gplearn and deap

1

i was waiting for python support to go prime.
1

Hey, 

just started playing around with 

https://github.com/QuantConnect/Lean/blob/master/Algorithm.Python/MACDTrendAlgorithm.py

and lines 42/43, which are self.PlotIndicator(..) lead to this error:

"Backtest Error: Array type can not be an open generic type".

1

Like Nate Betz says, I would love an option to use Python libs from my C# code or otherwise my own Python code (using said libs) from my C# code to build alpha signal part of my algos. Mainly because Python has better ML tooling (also since Accord.net remains broken on QC cloud). Usually I find C# more productive though and I would certainly prefer to not port my codebase to Python.

0

Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed