================== Hourly SMA - Close ================== This indicator can be used on 1, 5, 10, 15, 20 and 30 minute charts to display the value of a 60 minute simple moving average. ---8<--------------------------- {Hourly SMA - Close} {© 2003 Roy Larsen} {rlarsen@man.quik.co.nz} {use on intraday charts} D:=Input("Periods (Hours)",1,100,10); Q:=Input("1=Dynamic last bar, 2=Sample only @ end of hour",1,2,1); {1=dynamic last hour, MS compatible} {2=sample end of hour when available} A:=Minute()=0; B:=Hour()<>ValueWhen(2,1,Hour()) OR DayOfWeek()<>ValueWhen(2,1,DayOfWeek()); F:=LastValue(Cum(1))=Cum(1); J:=If(A,1,If(Alert(A,2)=0 AND B,2,0)); J:=If(F AND J=0 AND Q=1,1,J); K:=ValueWhen(1,J,If(J=1,C,Ref(C,-1))); G:=Cum((J>0)*K); M:=(G-ValueWhen(D+1,J,G))/D; M; ---8<--------------------------- http://www.metastocktips.co.nz/