mmad is not supported yet in createReactiveStateEngine. We will continue to find a solution.
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.