MetaStock -> Tools -> Indicator Builder -> New Copy and paste formula below. ==================== Support & Resistance ==================== ---8<--------------------------- { Support & Resistance v2.0 } { Plots support/resistance levels based on normal or hindsight peaks/troughs } { ©Copyright 2004 Jose Silva } { http://www.metastocktools.com } { User inputs } plot:=Input("[1]Support, [2]Resistance, [3]Both, [4]Combination",1,4,3); x:=Input("use [1]High/Low, [2]Close",1,2,1); type:=Input("Type: [1]Normal, [2]Hindsight", 1,2,1); depth:=Input("Peak/Trough minimum depth (0~50%)",0,50,5); pds:=Input("Peak/Trough period base (3~252)", 3,252,5); { Price field } xHi:=If(x=1,H,C); xLo:=If(x=1,L,C); { Non-hindsight Support/Resistance } Hi:= (HHV(xHi,pds-1)>xHi)>Ref(HHV(xHi,pds-1)>xHi,-1); HiVal1:=ValueWhen(1,Hi,Ref(xHi,-1)); Lo:= (LLV(xLo,pds-1)Ref(LLV(xLo,pds-1)LoVal1*(1+depth/100); Lo:=Lo AND LoVal1