Hello,
I have a strategy in QC that uses a Custom Library. On the cloud, everything is fine. But when I try to run the project locally, I get {Library} could not be found error. Could someone please help in this regard?
Thanks
QUANTCONNECT COMMUNITY
Hello,
I have a strategy in QC that uses a Custom Library. On the cloud, everything is fine. But when I try to run the project locally, I get {Library} could not be found error. Could someone please help in this regard?
Thanks
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.
Louis Szeto
Hi Bala
Please make sure you have pulled the library project in your LEAN CLI, by:
Then, include these headers in your backtest algorithm. It should be able to load the library correctly afterward.
Best
Louis
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.
Bala Venkataraman
Hi Louis Szeto,
Yes, I have pulled the library project. In fact, I did a cloud pull of all my algos including the library. I was able to open the strategy csproj in VS and add the library as a reference to build the project locally.Â
Also, I included the headers as you have mentioned. The project builds fine in VS. It's only when I try to backtest the strategy locally, I get this error.
Bala
Louis Szeto
Hi Bala
In order to import the custom library in another project, we can use absolute import including the following headers in your main.py
Best
Louis
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.
Bala Venkataraman
Hi LouisÂ
I'll try this. I need to do this in C#. So for now I have moved the library under the strategy.
Thanks
Bala
Bala Venkataraman
FYI - I just learned that the Futures data availability is cloud-only. So this issue is not relevant at this time. However, someone should check C# algos for other asset types.
Bala
Louis Szeto
Hi Bala
For C# projects, we must add a reference to the folder containing the custom library. Right-click on your project panel, select Add folder to workspace... Â (Example using python, but C# is the same)
and select the folder of your library project. Now you can call your library's namespace by
Best
Louis
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.
Bala Venkataraman
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!