========================= Rolling Frame Compression ========================= This indicator takes the last CLOSE of each 'n' periods (a frame) and compresses the results for contiguous frames into contiguous bars on the right side of the chart. ---8<--------------------------- {Rolling Frame Compression} {© 2003 Roy Larsen} {rlarsen@man.quik.co.nz} n:=Input("Periods Per Frame" ,2,10,3); d:=Input("Reference Bar, 0=Last",-20,00,0)*-1; a:=LastValue(Cum(1))-Cum(1); g:=d+1+a*(n-1); j:=ValueWhen(LastValue(g+PREV-PREV),1,C); j; ---8<--------------------------- ======================== Weekly OHLCV Compression ======================== ---8<--------------------------- {© 2003 Roy Larsen} {rlarsen@man.quik.co.nz} {use on daily charts} X:=Input("1=Open 2=High 3=Low 4=Close 5=Volume",1,5,4); Q:=Input("1=Dynamic Current Week",0,1,1); {0=update at end of week unless no Friday} {1=dynamic current week - MS compatible} M:=DayOfWeek()<=ValueWhen(2,1,DayOfWeek()); F:=DayOfWeek()=5; B:=LastValue(Cum(1))=Cum(1); J:=If(F,1,If(Alert(F,2)=0 AND M,2,0)); J:=If(B+(J=0)+Q=3,1,J); Hw:=HighestSince(1,M,H); Hw:=ValueWhen(1,J,If(J=1,Hw,ValueWhen(2,1,Hw))); Lw:=LowestSince(1,M,L); Lw:=ValueWhen(1,J,If(J=1,Lw,ValueWhen(2,1,Lw))); K:=ValueWhen(1,J,If(J=1,C,ValueWhen(2,1,C))); Ow:=ValueWhen(1,J,If(J=1,ValueWhen(1,M,O), ValueWhen(2,M OR Cum(1)=2,O))); Z:=If(M,V/1000,PREV+(V/1000)); Z:=Int(Z); Z:=ValueWhen(1,J,If(J=1,Z,ValueWhen(2,1,Z))); X:=If(X=1,Ow,If(X=2,Hw,If(X=3,Lw,If(X=5,Z,K)))); F:=LastValue(Cum(1))-Cum(1); G:=LastValue(Cum(J>0))-Cum(J>0); I:=1+F-G; N:=LastValue(Cum(J>0)); I:=ValueWhen(2,F<=N,1)*I; ValueWhen(LastValue(I-PREV+PREV),J,X); ---8<--------------------------- http://www.metastocktips.co.nz/