I have some years of seconds data for Forex. Is there any way to use the bar consolidator and save them as minute data in the Data folder? Any example code, API or Toolbox app to read existing higher resolution bar data, consolidate and store them, so we don't have to download or process consolidation on every backtest?
Thanks!
Fred Painchaud
Hi Omid,
How good is your Python?
You could easily pre-process your data in Python and consolidate seconds into minutes in that script and then save back to CSV in minute bars for processing by LEAN via custom data.
Giving you an example of that out of the blue however is both cumbersome and not very valuable, as your particular data format (for second data) can vary greatly.
There's no way right now you can take consolidated bars in LEAN and save them to the data folder…
I'm willing to help if needed, for free, and write such Python script and provide publicly here. I'd need your data however so I can 1) see the format and most importantly 2) test.
If you want my help, we could meet on Discord so you can send me your data in private if you are not willing to share it publicly. Otherwise (if you do not want help), no offense taken.
Fred
Omid Rad
Hi Fred,
Thanks for your response. I could definitely write a script to do it but didn't want to reinvent the wheel if it was already provided because other than consolidation also need to make sure that everything is correctly organized according to the spec and compressed in zip files. I will contact you on Discord to talk more. If we made something it's a good idea to contribute it back to the community.
Thanks,
Omid
Fred Painchaud
Hi Omid,
Good.
Re "the correct organization according to the spec and compressed in zip files", this it not necessary. Refer to this to read back the result of your script:
https://www.quantconnect.com/docs/algorithm-reference/importing-custom-data
Fred
Omid Rad
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!