Back

Does Quantconnect supports Python ?

Hi everyone,

I'm new here, I'm a discretionary day-trader looking for place to make his strategies automated.

I would like to know if Quantconnect supports Python ?

Is it possible to scan thousands of stocks in real-time, ( like the the market scanner available in TWS if you have an account with Interactive Brokers) to set a universe according to some criteria like the volume, capitalization... ?

Thank you in advance.
Update Backtest








Welcome @Youness! Python is in beta for now, but there isn't any formal documentation.

It is possible to scan thousands of symbols with the Universe selection feature. See this example on github for how to use it.
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.


I've been trying to get the demo python "hello world" script running, but it gives the following error:

Algorithm.Initialize() Error: `IronPython.NewTypes.QuantConnect.Algorithm.QCAlgorithm_1$1' does not contain a definition for `HistoryProvider'

I'm trying to compare it to the C# algo " QCU How do I Retrieve Historical Data?", but that won't run either, saying:

Algorithm.Initialize() Error: Execution Security Error: Operation timed out - 0.166666666666667 minutes max. Check for recursive loops.
0

This is the demo python:

Sorry, I thought I could attach the code.
0

Hey Duncan, there's currently a bug in python that has already been addressed and will be fixed in our next deploy.

As for the history algorithm, we place limits on how long an algorithm can take to initialize. We can make this a little larger, but that sample was designed to show all the various ways you can use the history API. I've attached a version that will run for you.

EDIT: Also, to attached a project you must also include a backtest result.
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, looks like I will probably wait for the next deploy. Will it support numpy? I read something about IronPython and Numpy not working well.

Of course, I can't post a project with a backtest if the backtest won't run!
0

My understanding is that the IronPython guys figured this out some years ago. I'll try to make sure that those libraries are available and tested for the next deploy
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.


I have been using Quantopian and Python/Pandas/Numpy extensively now for quite a few months. I have no real desire to dump that experience and start from scratch with C#. In particular there are some outstanding example systems on Quantopian and I am working in particular at the moment on portfolio optimisation a la Markowitz, looking at both an optimizer route and Markowitz's original Critical Line algortithm. All in Python.

There are numerous problems with Quantopian's open source engine Zipline. One is that it is highly unstable on Windows. Other problems are more fundamental: it does not support multi currency portfolios for instance.

Quantconnect and Lean is therefore beginning to interest me, especially since I have a client looking to deploy a particular system urgently.

When are we likely to be able to use Python etc within Quantconnect / Lean etc?
thanks
AG
1

@Anthony, you can use C#, F#, Visual Basic, Java and Python in QuantConnect today. We're also 3x faster than our closest competitor at their own primary languages.
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 Jared. Also for your help on the other thread.
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