I would like to know if using C# andÂ
await task.delay(mseconds)
will work if I put it inside OnData.
I want to introduce a small delay (around 1 second) to wait the consolidation of a bar consolidator (if I proceed without delay, data could not be ready)
Mia Alissi
To properly use the QuantConnect API in C#, you need to ensure that you have the correct namespaces and references included. Here's the corrected version of the example:
Make sure you have the necessary using directives at the top of your file to include the QuantConnect namespaces. This will resolve the issues related to missing types and methods.
Sources: Getting Started - QuantConnect.com, Data Consolidation Algorithm, Time Period Consolidators - QuantConnect.com, Futures Fast Trend Following, with Trend Strength, Multiple Symbol Consolidation Algorithm
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.
AleNoc
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!