Reactive state engine problem

I cannot calculate this function in reactive state engine.

@state 

def cci(high,low,close,timeP){

 tp=rowAvg(high,low,close) 

 dev=mmad(tp,timeP) 

 sma=mavg(tp,timeP) 

 return (tp-sma)/(0.015* dev) 

 }

In 2.00.2 it gives error: Can't find the corresponding reactive state function for sequence sensitive function mmad

[2]

I tried second method 

def mmadas(tp,sma,timeP){

return moving(def(x,y)->avg(abs(x-y.last())), [tp, sma], timeP)

}

def cci(high,low,close,timeP){

 tp=rowAvg(high,low,close) 

 sma=mavg(tp,timeP) 

 dev=mmadas(tp,sma,timeP) 

 return (tp-sma)/(0.015* dev) 

 }

In 2.00.2 It gives error: func must be an aggregate function.


Please help me.

请先 登录 后评论

1 个回答

YcHan韩迎春

mmad is not supported yet in createReactiveStateEngine. We will continue to find a solution.

请先 登录 后评论
  • 1 关注
  • 0 收藏,994 浏览
  • Vishvesh Upadhyay 提出于 2021-11-09 20:09

相似问题