The following is a “translation” of the Easy Language Code for Momentum Divergence into MetaStock’s Formula Language I’ve added some {notes}. I’ve created 2 separate MetaStock Functions (Indicaors) one for Close, the other for MACD. It enables me to identify them more readily. However, you must be absolutely sure you have the same LBP for both the Close and MACD plots!!!! To get both plots into the same window simply drag them in. If you are going to be using these in Explorations, and you are going to be using both the 15 and 40 period divergences, create separate indicators for each. (eg Diverge15 and Diverge40) where each has the appropriate default period. The Explorer uses the default value. I add the Buy Zone and Sell Zone lines apart from the plot. It enables me to control them independently. {Close Plot - Creates Plot1} LBP:=Input("Look Back Period",5,200,15); {The above default is 15. 5 to 200 are available settings.} CloseValue:=If(HHV(CLOSE,LBP)-LLV(CLOSE,LBP)<>0,HHV(CLOSE,LBP)-LLV(CLOSE,LBP),50); ClosePlot:=100*(CLOSE-LLV(CLOSE,LBP))/CloseValue; ClosePlot; {MACD Plot - Creates Plot2} FastMA:= Input("FastMA periods",5, 200, 12); SlowMA:= Input("SlowMA periods",5, 200, 26); LBP:=Input("Look Back Period",5,200,15); MyMACD:=Mov(CLOSE,FastMA,E)-Mov(CLOSE,SlowMA,E); {Above line required because MS doesn’t permit changes to the MACD moving average periods in its built-in macd function. I’m using exponential moving averages.} MACDvalue:= If(HHV(MyMACD,LBP)-LLV(MyMACD,LBP)<>0,{THEN} HHV(MyMACD,LBP)-LLV(MyMACD,LBP), {ELSE} 50); MACDplot:=100*(MyMACD-LLV(MyMACD,LBP))/MACDvalue; MACDplot; *************************************************************** Chris Manning has stated that the “best” settings for MACD divergences was to use 5,35,5 (FastMA,SlowMA,SignalMA) for the histogram. (It appears that you are not using the MacdMA variable.) The following code replaces the MACD Plot code above. It uses the difference of the MACD and the signal line, rather than the difference of the two moving averages. I haven’t done any testing of the relative merits. FastMA:= Input("FastMA periods",5, 200, 5); SlowMA:= Input("SlowMA periods",5, 200, 35); SigMA:= Input("Signal period",5,50,5); {The above defaults give Chris’s settings. More traditionally you’d have 12,26,9) LBP:= Input("Look Back Period",5,200,15); MyMACD:=Mov(CLOSE,FastMA,E)-Mov(CLOSE,SlowMA,E); Histo:=MyMACD-Mov(MyMACD,SigMA,E); MACDvalue:= If(HHV(Histo,LBP)-LLV(Histo,LBP)<>0, HHV(Histo,LBP)-LLV(Histo,LBP),50); MACDplot:=100*(Histo-LLV(Histo,LBP))/MACDvalue; MACDplot;