Is it possible to call for logs outside the main.cs? Particularly interested in calling these in the modules, which I have as seperate .cs files. For now I'm just pulling it all into main, which sort of stinks.
Don't have an account? Join QuantConnect Today
QuantConnect Community Discussions
QUANTCONNECT COMMUNITY
LEAN is the open-source algorithmic trading engine powering QuantConnect. Founded in 2012 LEAN has been built by a global community of 180+ engineers and powers more than 300+ hedge funds today.
Join QuantConnect's Discord server for real-time support, where a vibrant community of traders and developers awaits to help you with any of your QuantConnect needs.
The Open-Quant League is a quarterly competition between universities and investment clubs for the best-performing strategy. The previous quarter's code is open-sourced, and competitors must adapt to survive.
Asking if logs can be called outside of main.cs in QuantConnect to avoid pulling all into main.
Continue ReadingRefer to our Research Guidelines for high quality research posts.
Create an account on QuantConnect for the latest community delivered to your inbox.
Sign Up Today
|
|
|||||||
|
|
||||||||
|
Logs outside main
Stephen | May 2019
Is it possible to call for logs outside the main.cs? Particularly interested in calling these in the modules, which I have as seperate .cs files. For now I'm just pulling it all into main, which sort of stinks.
QuantConnectâ„¢ 2025. All Rights Reserved
Douglas Stridsberg
Depending on what you refer to as a "module", you may be able to add a QCAlgorithm myAlgo to the list of their constructor parameters, for example, and then store that reference in the module itself. You can then invoke myAlgo.Log( "log here" );.
Another way is to simply pass a reference to the algorithm into whatever method you want to use logs in. An example of where this is done are the Framework algos where most functions have a reference to QCAlgorithm in their parameters (see here and here).
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.
Michael Manus
thats the very very first framework of the Alpha Framework right now from days when it was posted in the Algorithm Lab under University (tab) as example how to split up things in C#.
This should answer your question
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.
Link Liang
Hi Stephen,
Yes you can definitely do that. I would recommand pass the object in main.cs to your modules, for the purpose call for logs. I have simplified @Michael's example to bare minimum to show how it works. Hope it helps!
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!