Hello,
I need to pull history with fillForward=True and extendedMarket=True,
but nothing I tried seems to work.
All but 3 and 4 raise TypeError, 3 and 4 return some object (instead
of DataFrame) that I can only iterate, but it is empty.
Am I doing something wrong? Is there a way to do this?
Yuri Lopukhov
Here are logs for clarity:
Alexandre Catarino
Hi Yuri Lopukhov ,
QCAlgorithm has only one method overload for History that includes the option to select a different fill forward and extended market hours and it returns an IEnumerable<Slice>, not a pandas DataFrame.
I have created an issue to add this feature:
No History Method Overload For Python that Accepts Fill Forward and Extended Market Hours Arguments #6211
Most of the overloads, both in C# and Python, don't accept these parameters, so we need to use:
Please note that the start date must be earlier than the end date unlike we can see in your algorithm.
The workaround to issue #6211 is using the PandasConverter:
Note that if we make a historical data request of Hour or Daily resolution, it will not include extended market hours. In this case, the history request reads files that don't include data from these periods.
One possible solution is to use consolidators to update a RollingWindow or a list of TradeBar and convert them into a pandas DataFrame using the same method.
Best regards,
Alex
Yuri Lopukhov
Thank you, that's very helpful.
Yuri Lopukhov
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!