Hello. I'm trying to preload an ichimoku indicator with past history using the History function, but I get this runtime error.
Runtime Error: NotSupportedException : IchimokuKinkoHyo does not support Update(DateTime, decimal) method overload. Use Update(IBaseDataBar) instead.
I can't work out how to turn the history output into a IBaseDataBar in Python. I'm using forex data.
self.security = security
self.ichimoku = IchimokuKinkoHyo(security.Symbol, tenkan_period,
kijun_period, senkouA_period, senkouB_period,
chikou_period, chikou_period)
# Populate the Ichimoku with past history
history = algorithm.History(security.Symbol, self.ichimoku.WarmUpPeriod, resolution)
for index, row in history.loc[security.Symbol].iterrows():
algorithm.Debug(f'Populating history {index} {row["close"]}')
self.ichimoku.Update(index, row["close"]) # RUNTIME ERROR
I read in a previous reply to the forum that I just needed to change the last line to self.ichimoku.Update(row), however I then get the following error
Runtime Error: Trying to dynamically access a method that does not exist throws a TypeError exception. To prevent the exception, ensure each parameter type matches those required by the Update method. Please checkout the API documentation. TypeError : No method matches given arguments for Update (Open Stacktrace)
Can anyone help?
James Arthur
Thanks, this works (with QuoteBars).
The docs don't explain that the History function is different in Python and C# (in Python it returns a dataframe but in C# it returns the bar). I think that would be useful to explain that as usually they both very similar. Also in one place the Python docs erroneously suggest that History returns the bar, so for a long time I thought that I could pass the df in as a bar and there would be an automagic conversion.
Thanks for your help
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!