Hello everyone, I'm new to Metastock .
This is my formula.
A:=If(C>Ref(C,-1),V,0)+If(Ref(C,-1)>Ref(C,-2),V,0)+If(Ref(C,-2)>Ref(C,-3),V,0)+(If(C=Ref(C,-1),V,0)+If(Ref(C,-1)=Ref(C,-2),V,0)+If(Ref(C,-2)=Ref(C,-3),V,0))/2;
B:=If(C<Ref(C,-1),V,0)+If(Ref(C,-1)<Ref(C,-2),V,0)+If(Ref(C,-2)<Ref(C,-3),V,0)+(If(C=Ref(C,-1),V,0)+If(Ref(C,-1)=Ref(C,-2),V,0)+If(Ref(C,-2)=Ref(C,-3),V,0))/2;
Vr3:=If(b=0,Ref(vr3,-1),A/B);
vr3;
"Vr3:=If(b=0,Ref(vr3,-1),A/B)" have a math error.
I want to get previous value, if b=0.
Thanks for any help