I download the project from github. I compile it with VS2019, and updated the config file. I then try to run a simple algorithm. An error comes up.
ERROR:: WorkerThread.<.ctor>b__7_0(): WorkerThread(): exception thrown when running task Python.Runtime.PythonException: NameError : name 'Resolution' is not defined
I would like to ask which library should I import? Thank you.
Attached the code I am testing. I have already added to the head of the file but don't know how to continue:
from QuantConnect.Algorithm import *
Thank you very much.
Aaron Janeiro Stone
I am unsure of exactly what your code looks like as the linked backtest does not show the imports. Try again with clr/quantconnect imports before any non-Lean libraries or ensure that your import arguments are made *FIRST* in the .py file. I just debugged a similar problem in my environment and noticed that algos without third party imports and make such import args immediately had no issues with Resolution (e.g., WarmupAlgorithm.py should work).
Sulfred
Aaron Janeiro StoneÂ
Thank you. I would like to ask if there is a way to find the correct package to import for local lean ? For example, if I am using MorningstartSectorCode.xxx, how can I know which quantconnect package should I import ?
Â
Shile Wen
Hi Sulfred,
One method of finding the correct imports would be to run the algorithm, get the error, look for the class in LEAN using the IDE search, then add that import, and repeat this step until all of the necessary imports have been added.
Best,
Shile Wen
Sulfred
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!