Hi,
I'm still fairly new to the platform, and I'm currently developping my backtests using C#. I've had a few attempts at Python but I haven't decided which languange I want to "settle in" with. To help me and other curious users out, I thought I would ask everyone. Which language are you using for QuantConnect, and why do you prefer it? What do you feel the advantages/disadvantages of one language over the other is?
To answer my own question, I like lots of structure and feel comfortable with C# with it's declarations and classes. I like LINQ for Universe Selection. I'm not super familiar with Python and I chose to go with C# to learn the platform. However, I wonder if I'm missing out by not using Python's libraries like numpy or pandas.
Erik Bengtson
I also started with python due to rich math libraries like you meantioned, but then decided to switch to C# since its easier to Debug when using Lean - local setup.
Another advantage for python is that, there are plenty of strategies implemented in python shared by the community.
Python also has neural networks libraries, which is another advantage for me, excepted that I just learned that we should take care of memory consumption by algos. For that reason, I will implement the NN integration through a remote call, and not embedded in the algo itself.
For C#, MAth.Net library which seems quite complete to me.
Jared Broad
Like the profile pic Automated!
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.
Warren Harding
C# fan here. Microsoft's C# and Visual Studio combination is the best development product I've ever used. So when it comes time to develop something besides web based algos in Quantconnect you'll be in a good position with C#.
Warren Harding
To be clear, I'm not against Quantconnect. If you just want to concentrate on getting an algo running without worrying about data, live trading support, and other infrastructure requirements then Quantconnect may well be the best option on the net. Working with the web IDE when one is used to intellisense, step through debugging, and all of the other toys in Visual Studio is a bit painful though. Jared should consider making Visual Studio a first class development choice for Quantconnect users in the long term IMHO.
Pradtf
i go with python because i have known it the best (use mostly emacs and elpy). i also like the jupyter notebooks and other python tools like pandas, matplotlib etc.
haven't tried c# though i've done a fair bit of mql4 which i understand is similar in syntax.
Quant Trader
I like C# and Visual studio more as you can add unit tests (test driven design) and the syntax is easier to understand. However, most universities and Google use Python. Also lots of statistics and math functions are in Python. See also Quantopian. I try to use Python but most likely will go for C# where possible. Currently only using the GUI for programming and hence miss the intellisense of Visual Studio.
Other benefit of C# is that the compiler will warn you for wrong or empty objects where with Python you will discover during runtime.
Debugging would be easier in QuantConnect if the data would run through Visual Studio and you could use the debugger.
Arthur Asenheimer
Where QuantConnect was first developed for C# are there any disadvantages or stumbling blocks when I use python instead? Are there any features missing or any errors due to the use of python in QuantConnect?Â
Link Liang
Hi Epsilon,
Although QuantConnect was first developed in C#, we tried to make user experience the same between C# and Python. There is no missing features or errors in Python version of Quantconnect, and indeed now there is actually more documentation for Python. The general advantages and disacvantages of two languages are well described above. You could choose freely between them based on your interest and familarity.
Charles Naccio
We initially started out using Python as we were drawn to the idea of using Python through and through for research and strategy development, but given we trade thousands (2,000-3,000 daily) of symbols within our universe, we found C# backtests to run MUCH faster. While we'd probably prefer to stick with Python, we simply couldn't overlook the performance benefit of C#; at least for our specific algos. Hope this helps!
Martin Schmitz
Perhaps someone from quantconnect could answer, why both languages are supported? Is it just for a broader acceptance. If I understand the sourcecode correctly, under the hood will always run c# !?
Jared Broad
We'll always support both languages as they are often different mindsets and goals. Python has many popular machine-learning libraries and is a good choice for beginners who aren't familiar with braces and semi-colon line terminations. C# doesn't have the same ecosystem of libraries, but runs 10x faster as it's a compiled language, and saves you many bugs at compile time since it's pre-built. Other platforms globally tend to fall into the C or Python camps; with LEAN we could support multiple languages so it was a good way to increase adoption.Â
Under the hood it's running .NET core yes; with a bridge to python and many other languages. We looked into making LEAN pure Cython but found it was much faster in its current form.Â
Â
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.
AutomatedMachine
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.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!