Hi;
Where is OnData() documented? I want to get the specifics on when it is called because all the videos & documentation say it's called when data is updated, which doesn't tell me specifically when it happens.
thanks - dave
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.
User seeks documentation on when OnData() is called in QuantConnect.
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
|
|
|||||||
|
|
||||||||
|
OnData() documentation
David Thielen | November 2021
Hi;
Where is OnData() documented? I want to get the specifics on when it is called because all the videos & documentation say it's called when data is updated, which doesn't tell me specifically when it happens.
thanks - dave
https://lean-api-docs.netlify.app/index.html
Generally if this is worrying you it would be better to run the OnData() on a smaller resolution and have the symbols you're trading on a different resolution. I haven't run into any such issues yet so far however.
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.
QuantConnectâ„¢ 2025. All Rights Reserved
Mak K INVESTOR
Hi David. OnData() is triggered every time when new data comes into your algorithm. Usually that interval is going to be your universe resolution. If you add assets to trade using minute resolution then your OnData() is going to run every 1 minute. Hope that clears it up, if not feel free to ask follow up questions!
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.
David Thielen
Hi Mak;
Is OnData() documented anywhere? Part of this is my specific concern for the case where it tests if requested data is fully loaded yet - what if it is not, I return, and the next call is not for a day. So I want to know what the worst case is for this situation.
But more important, I want to know where this is documented so for additional questions on the API, I can find the info so I don't need to keep asking. Same as for my question on the EMA - I want to know where to find this so I can teach myself and not have to ask for each API.
thanks - dave
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.
David Thielen
Mak;
Thank you, that API doc is what I was looking for. Unfortunately it doesn't say much about the method so it will require questions like this ongoing. But at least I can look there first, so thank you.
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!