Hi Everyone,
Here is my current QuantConnect workflow as a previous QuantConnect support staff.
Warning: while this isn't too technical, this is not beginner-friendly.
Software:
- If you aren't on a Linux system, but you are familiar with the basics of Linux, I suggest getting WSL (Ubuntu). This is especially necessary if you want to use the Command Line Interface for QC (I don't, but I think it's a good tool)
- VSCode (not optional with WSL) + relevant extensions
Steps:
- open your WSL terminal, create/cd the folder relevant to your project
- run “code .” to open a VSCode instance on the Linux Subsystem
- open a WSL terminal in VSCode (my WSL terminal is called Ubuntu, as that's the distribution I'm using)
- pip3 install --upgrade quantconnect-stub
- (optional) install nodejs and and CLI
- Note: the above 5 steps can be replaced with the Windows equivalent, but it will be more painful
- optional, but highly recommended steps:
- go to settings → account settings → disable the first 3 options
In VSCode, now create a .py file and add the following:
false_bool = False
if false_bool:
from AlgorithmImports import *
copy-paste your algorithm below here. Every time you want to test, execute using CLI (highly recommended) or paste the code into your project on quantconnect.com
Hope this helps.
Jel Neo
what is the purpose of ```false_bool```?
Ashutosh
This was a common approach used to ensure compatibility across python versions or some would address this as guarding imports. Conditionally import modules are used for checking and not during runtime which means that the module is skipped when the code is executed.
Refer to similar items:
https://github.com/asottile/flake8-typing-imports#rationale
https://stackoverflow.com/questions/57939977/what-is-the-meaning-of-if-false-from-typing-import-type
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.
Shile Wen
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!