Also take a look at the MACD Histogram Divergence kit v7.0: http://www.metastocktools.com/MACDH/MACDHdiverg.htm MetaStock -> Tools -> Indicator Builder -> New Copy and paste formula below. ===================== Divergences - Class A ===================== ---8<--------------------------- { Class A price/indicator divergence v4 } { +1 signal = bullish trough divergences } { -1 signal = bearish peak divergences } { ©Copyright 2004 Jose Silva } { For personal use only } { http://www.metastocktools.com } { User inputs } ind:=Input("MACD=1, Stoch=2, RSI=3, DMI=4, Mom=5",1,5,1); pds:=Input("Indicator periods",2,2520,10); f:=Input("Price field: Close=1, High/Low=2", 1,2,1); Ch:=Input("Peak/Trough depth minimum (0-100%)", 0,100,0)/100; shift:=Input("Shift signals back to match divergences=1",0,1,0); { Select divergence indicator } {y:=insert any indicator or Fml("formula name")} y:=If(ind=1,MACD(), If(ind=2,Stoch(pds,3), If(ind=3,RSI(C,pds), If(ind=4,DMI(C), Mo(C,pds))))); { Price peaks/troughs } xu:=If(f=1,C,H); xd:=If(f=1,C,L); Pkx:=xuRef(xu,-2) AND Ref(xu,-1)>=(xu+Ref(xu,-2))/2*(1+Ch); Pkx1:=ValueWhen(1,Pkx,Ref(xu,-1)); Pkx2:=ValueWhen(2,Pkx,Ref(xu,-1)); Trx:=xd>Ref(xd,-1) AND Ref(xd,-1)Ref(y,-2) AND Ref(y,-1)>=(y+Ref(y,-2))/2*(1+Ch); Pky1:=ValueWhen(1,Pky,Ref(y,-1)); Pky2:=ValueWhen(2,Pky,Ref(y,-1)); Try:=y>Ref(y,-1) AND Ref(y,-1)Try2,shift) -Ref((Pkx AND Pky AND Pkx1>Pkx2 AND Pky1