Bill Irvin's Cycle Indicator

 

Hi, could you help me translate a Metastock indicator to metatrader ? Here's the code :

Period:= 15; denom1:= If(HHV(H,Period)-LLV(L,Period)>0, HHV(H,Period)-LLV(L,Period), 1); P1:= Mov(((C-LLV(L,Period))/ denom1)*100,3,E); denom2 := If(HHV(P1,Period)-LLV(P1,Period)>0, HHV(P1,Period)-LLV(P1,Period), 1); Mov(((P1-LLV(P1,Period))/denom2)*100,3,E)

Reason: