Hi all,
I was trying to understand how the holdings (the SecurityHolding objects) get updated in the code by debugging the engine's c# code using the following template algorithm. Specifically, I was curious about at which line of code fields such as SecurityHolding.Quantity (as in the sample code attached) get updated. I tried to debug the source code line by line, however I just couldn't find the right breakpoint for it. The closest thing I found was the following method, after which the holdings seem to get updated. But I wasn't able to zoom in any longer. I also tried placing the breakpoint in the setter of the fields like Quantity, AveragePrice, etc, but the code didn't stop there.
Could someone please offer some help to find the line of code for me to place the breakpoint? Thank you!
public OrderTicket AddOrder(SubmitOrderRequest request)
{
return ProcessRequest(request);
}
Louis Szeto
Hi Fishstoryyy
A lot of things were happening in the backend of the LEAN engine! We abstracted the cleanest developing environment for you, so your break point will not catch that easily. We do not recommend tempering the core engine as well. To access the very first moment of your QCAlgorithm instance receiving the updated fields will be through the OnOrderEvent handler.
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.
Fishstoryyy
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!