Roy,
How does the above code compared with the following code that you developed earlier?
Sa
{Volume By Price 25}
{?006 Roy Larsen, www.metastocktips.com}
d:=Input("Bars to Include",1,9999,100);
n:=Input("Scaling Factor",1,99,5);
k:=Input("Plot Frame?",0,1,1);
y:=Cum(1);f:=LastValue(y);z:=f-1=y;
d:=LastValue(If(d>=f,f-1,d));a:=(f-d<y)*(y>1);
g:=a*V;b:=LastValue(Cum(g));
q:=LastValue(HighestSince(1,a=0,C));
r:=LastValue(LowestSince(1,a=0,C));
i:=(q-r)/25;u:=r+i*.5;m:=n*d/b;
x:=LastValue(Cum((C<(r+i))*g));ValueWhen(1,f-x*m<y,u);
x:=LastValue(Cum((C>=(r+i))*(C<(r+i*2))*g));ValueWhen(1,f-x*m<y,u+i);
x:=LastValue(Cum((C>=(r+i*2))*(C<(r+i*3))*g));ValueWhen(1,f-x*m<y,u+i*2);
x:=LastValue(Cum((C>=(r+i*3))*(C<(r+i*4))*g));ValueWhen(1,f-x*m<y,u+i*3);
x:=LastValue(Cum((C>=(r+i*4))*(C<(r+i*5))*g));ValueWhen(1,f-x*m<y,u+i*4);
x:=LastValue(Cum((C>=(r+i*5))*(C<(r+i*6))*g));ValueWhen(1,f-x*m<y,u+i*5);
x:=LastValue(Cum((C>=(r+i*6))*(C<(r+i*7))*g));ValueWhen(1,f-x*m<y,u+i*6);
x:=LastValue(Cum((C>=(r+i*7))*(C<(r+i*8))*g));ValueWhen(1,f-x*m<y,u+i*7);
x:=LastValue(Cum((C>=(r+i*8))*(C<(r+i*9))*g));ValueWhen(1,f-x*m<y,u+i*8);
x:=LastValue(Cum((C>=(r+i*9))*(C<(r+i*10))*g));
ValueWhen(1,f-x*m<y,u+i*9);
x:=LastValue(Cum((C>=(r+i*10))*(C<(r+i*11))*g));
ValueWhen(1,f-x*m<y,u+i*10);
x:=LastValue(Cum((C>=(r+i*11))*(C<(r+i*12))*g));
ValueWhen(1,f-x*m<y,u+i*11);
x:=LastValue(Cum((C>=(r+i*12))*(C<(r+i*13))*g));
ValueWhen(1,f-x*m<y,u+i*12);
x:=LastValue(Cum((C>=(r+i*13))*(C<(r+i*14))*g));
ValueWhen(1,f-x*m<y,u+i*13);
x:=LastValue(Cum((C>=(r+i*14))*(C<(r+i*15))*g));
ValueWhen(1,f-x*m<y,u+i*14);
x:=LastValue(Cum((C>=(r+i*15))*(C<(r+i*16))*g));
ValueWhen(1,f-x*m<y,u+i*15);
x:=LastValue(Cum((C>=(r+i*16))*(C<(r+i*17))*g));
ValueWhen(1,f-x*m<y,u+i*16);
x:=LastValue(Cum((C>=(r+i*17))*(C<(r+i*18))*g));
ValueWhen(1,f-x*m<y,u+i*17);
x:=LastValue(Cum((C>=(r+i*18))*(C<(r+i*19))*g));
ValueWhen(1,f-x*m<y,u+i*18);
x:=LastValue(Cum((C>=(r+i*19))*(C<(r+i*20))*g));
ValueWhen(1,f-x*m<y,u+i*19);
x:=LastValue(Cum((C>=(r+i*20))*(C<(r+i*21))*g));
ValueWhen(1,f-x*m<y,u+i*20);
x:=LastValue(Cum((C>=(r+i*21))*(C<(r+i*22))*g));
ValueWhen(1,f-x*m<y,u+i*21);
x:=LastValue(Cum((C>=(r+i*22))*(C<(r+i*23))*g));
ValueWhen(1,f-x*m<y,u+i*22);
x:=LastValue(Cum((C>=(r+i*23))*(C<(r+i*24))*g));
ValueWhen(1,f-x*m<y,u+i*23);
x:=LastValue(Cum((C>=(r+i*24))*(C<(r+i*25))*g));
ValueWhen(1,f-Int(x*m)=y,u+i*24);
x:=(f-d=y)*k;ValueWhen(1,x,q);ValueWhen(1,Alert(x,2),If(x,q,r));