Hi QC Support:
I'm trying to use the AD indicator and am getting the error below.
# initialize
self.ADW = RollingWindow[float](self.lookback)
self.AD_indicator = self.AD(self.ticker, Resolution.Daily)
# update
self.AD_indicator.Update(data.Bars[self.ticker].EndTime, data.Bars[self.ticker].Close)
self.ADW.Add(self.AD_indicator.Current.Value)
Getting this error:
AccumulationDistribution does not support the `Update(DateTime, decimal)` method.
Use one of the following methods instead: Update(TradeBar), Update(QuoteBar)
Please advise what should be the code.
Thanks / Sheikh
Vladimir
Sheikh Pancham
I don't think
self.AD_indicator = self.AD(self.ticker, Resolution.Daily)
needs to be updated.
Try this
Sheikh Pancham
Thanks Vladimir, that works in the Algorithm Framework also. Makes things easier. Code attached.
I'm trying to add the KAMA indicator and get this error:
Can you look into when you have a moment.
Thanks / Sheikh
Louis Szeto
Hi Sheikh
Did you set warmup on KAMA? And did you set condition:
Cheers
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.
Sheikh Pancham
Hi Louis (how's it going?),
Code attached & below. I'm just checking if the rolling window is ready, not the indicator. Seems to be working for the other windows & indicator.
Louis Szeto
Hi Sheikh
You forgot to use the method .Add
btw you can init you rolling window in alpha model class's init to save memory and time. I didnt include tho
Cheers
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.
Sheikh Pancham
ha ha thanks Louis. I guess I missed that.
Ok, I'll try what you're saying about the initializing the rolling window in the alpha model class.
Sheikh Pancham
Thanks guys!
Varad Kabade
Hi Sheikh,
Thank you, Louis, for your response. The above algorithm has many issues. We have made the following changes:
fast_volume_LWMA_indicator, slow_volume_LWMA_indicator, ROC_indicator are hooked for automatic update and are also updated manually. We removed the manual update part.
fast_volume_LWMA_indicator, slow_volume_LWMA_indicator require Field as Volume, but the algorithm had created with the default field(Close) we changed the Field to Volume
ROC_indicator takes the output of trLWMA_indicator as its input, so we need to use the IndicatorExtension property to refer to the following code snippet.
self.ROC_indicator = IndicatorExtensions.Of(RateOfChange(1),self.trLWMA_indicator)
We shifted the whole indicator logic and all the rolling windows to SymbolData class and replaced the whole rolling window logic with a method in SymbolData class.
Refer to the attached backtest.
Best,
Varad Kabade
Sheikh Pancham
Thanks Varad, nicely done!
Sheikh Pancham
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!