Back

Need help with custom indicator

Hi, I am trying to build the super trend indicator. But I run into some problems.

1) I dont know why the "self.up" is zero in the log. It seems the atr cannot be updated. After reviewing other discussions, I still cant fix it.

2) Also, is it a correct way to use TradeBarConsolidator(1) to pass 1 min TradeBar to the Update method. I do it this way because I ran into some type errors.

3) I can only find indicators doc/ example in C# on github. Is there any python version ?

Thx in advance

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.


Hello Tai Man Chan, you may need to call the Update method in OnData:

def OnData(self, data):
self.superTrend.Update(data["SPY"])
self.Debug("-------time : {}----<br>".format(self.Time))
self.Debug(" up : {}<br>".format(self.superTrend.Up))

 

1

Thx for helping out

0

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