Hi guys :)
What is the best function to call in LEAN to check if specific data exists in the data folder (for example 1 minute bars of AAPL in specific date) before actually downloading and writing data?
QUANTCONNECT COMMUNITY
Hi guys :)
What is the best function to call in LEAN to check if specific data exists in the data folder (for example 1 minute bars of AAPL in specific date) before actually downloading and writing data?
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 Super Richman
If the data already exists, the CLI will not download and charge for that file even if your “lean download” command script plan to do so.
On the other hand, if you need to update and overwrite the existing files, you can add an --overwrite option at the end of the bash code. That way, the file is subjected for charging fee.
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.
Super Richman
Thanks Louis!
My meaning was inside of lean .net project, what is the method to call before calling LeanDataWriter and write. For example function like bool CheckIfDataExist(ticker,resolution,date)
Louis Szeto
Hi Super Richman
The CLI is just a consumer of LEAN, so it won't have such a function. A workaround could be setting up a scheduled event and checking the previous data bar/tick's EndTime by security.GetLastData() cache.
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.
Super Richman
Thanks again Louis!
I have implemented my own function to do it, I hope I am correct with my solution 🌬️
Super Richman
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!