Back

Keltner Channel on a Class

Hi, I'm having a simple trouble. Using the Bootcamp "200-50 EMA Momentum Universe" I tried to add a Keltner Channel, but I'm having a problem. I know what's the problem but I'm not sure how to fix it.

I want to add a keltner channel to the SelectionData() class but I can't just added the same way as the other Exponential Moving Averages, the reason is because those indicators use just one price (for example closing price), while Keltner Channel use "IBaseDataBar", meaning the whole trade bar. This is because it use High, Low, Open and Close to calculate the different values of Middle Band, ATR, Upper band and Lower Band

Can someone show me how to add the keltner channel the right way in this code? I want the keltner Channel to be ready to use latter. It would be appreciated!

 


 
Update Backtest








0

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.


Hi Cristian,

One solution is to create a TradeBar from the data from self.History before feeding it into our Keltner Channel Indicator. I’ve shown how to do this in the attached backtest.

Best,
Shile Wen

0

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.


Update Backtest





0

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.


Loading...

This discussion is closed