Hi all,
Below is the MIDAS formula for intra day S/R bands. Its been given in the book "MIDAS technical analysis".
I am trying to copy the formula in metastock 11 but its showing error can some body please help to correctly put it in metastock formula.
sm:= Input("starting month",1,12,1);
sd:= Input("starting day of month",1,31,1);
sy:= Input("starting year",1980,2100,2000);
sh:=Input("hour", 1,24,1);
se:=Input("minute",0,60,0);
start:= sd=DayOfMonth() AND sm=Month() AND sy=Year() AND sh=Hour() AND se=Minute();
x:=Input("Price Field,1=O,2=H,3=L,4 =C,5= MP ()",1,5,4 );
y:=If( x =l,O,If(x=2,H,If(x=3,L,If(x=4,C,
If(x=5,MP(),0)))));
ab:=y*V;
denom:=If(Cum(V)-ValueWhen(1,start,Cum(V))=0,l,Cum(V)-
ValueWhen(l,start,Cum(V)));
If(BarsSince (start),(Cum(ab)-ValueWhen(1,start,Cum(ab)))/denom,MP())
here i am facing the problem:
ValueWhen(l,start,Cum(V)));
"the variable of expression must contain only constant data"
kindly help.