Im trying to convert this modified (and auto-adaptive) version of the Ergotic Candlestick Oscillator from metastock. Instead the original formula of Ergodic Candlestick oscillator this formula uses the length of a scaled stochastic indicator VRB:= Abs( Stoch(LE,1)-50)/50; and an exponent to obtain the variable moving average.
Im not able to convert the PREV function implemented needed to calculate in metastock the variable moving average useful to calculate the Close-Open variables during each session (fifth line) and consequently the other variables that takes into account the variations of maximum and minimum price (sixth line content) etc. Any help is higly appreciated.
AUTO ADAPTIVE ERGODIC CANDLESTICK OSCILLATOR
LE:=Input("LENGHT",1,200,14);
Exp:=Input("Exponent",1,200,5);
VRB:= Abs( Stoch(LE,1)-50)/50;
MEsp:=2/(Esp+1);
CaMe1:=If(Cum(1)<=((Le+Exp)*2),C-O,PREV+MEsp*VRB*((C-O)-PREV));
CaMe2:=If(Cum(1)<=((Le+Exp)*2),H-L,PREV+MEsp*VRB*((H-L)-PREV));
CaMe11:=If(Cum(1)<=((Le+Exp)*2),CaMe1,PREV+MEsp*VRB*(CaMe1-PREV));
CaMe22:=If(Cum(1)<=((Le+Exp)*2),CaMe2,PREV+MEsp*VRB*(CaMe2-PREV));
ECO:=CaMe11/CaMe22*100;
ECO;
0
Im not able to convert the PREV function implemented needed to calculate in metastock the variable moving average useful to calculate the Close-Open variables during each session (fifth line) and consequently the other variables that takes into account the variations of maximum and minimum price (sixth line content) etc. Any help is higly appreciated.
AUTO ADAPTIVE ERGODIC CANDLESTICK OSCILLATOR
LE:=Input("LENGHT",1,200,14);
Exp:=Input("Exponent",1,200,5);
VRB:= Abs( Stoch(LE,1)-50)/50;
MEsp:=2/(Esp+1);
CaMe1:=If(Cum(1)<=((Le+Exp)*2),C-O,PREV+MEsp*VRB*((C-O)-PREV));
CaMe2:=If(Cum(1)<=((Le+Exp)*2),H-L,PREV+MEsp*VRB*((H-L)-PREV));
CaMe11:=If(Cum(1)<=((Le+Exp)*2),CaMe1,PREV+MEsp*VRB*(CaMe1-PREV));
CaMe22:=If(Cum(1)<=((Le+Exp)*2),CaMe2,PREV+MEsp*VRB*(CaMe2-PREV));
ECO:=CaMe11/CaMe22*100;
ECO;
0