[LegacyColorValue = true]; {Place this on a RadarScreen} Inputs: NumBars(1), ChgColorAfterX_Bars(2), interval1(1), SymbolToCompare("$INDU"); Vars: x(0), Trend(0), STR(" "), UpTrend(false), DownTrend(false), Name1(GetSymbolName + NumToStr(Interval1,0)), AlertBar(0); value2 = GVGetNamedFloat(Name1,-99); if close > close[1] then Trend = 1; if close < close[1] then Trend = -1; Plot1(" ","Diverg",Black,White); if LastBarOnChart then begin if DataCompression < 2 and date <> date[1] then begin STR = " "; AlertBar = 0; end; if GetSymbolName = SymbolToCompare then begin for x = 0 to NumBars - 1 begin value1 = GVSetInteger(x,Trend[x]); end; end else begin UpTrend = true; DownTrend = true; for x = 0 to NumBars - 1 begin value1 = GVGetInteger(x); if value1 <> 1 then UpTrend = false; if value1 <> -1 then DownTrend = false; end; if UpTrend then begin { Possible Weak Divergence } for x = 0 to NumBars - 1 begin if Trend[x] <> -1 then UpTrend = false; end; if UpTrend then begin STR = "WEAK"; AlertBar = Barnumber; end; end; if DownTrend then begin { Possible Strong Divergence } for x = 0 to NumBars - 1 begin if Trend[x] <> 1 then DownTrend = false; end; if DownTrend then begin AlertBar = Barnumber; STR = "STRONG"; end; end; end; end; Plot1(STR,"Diverg",Black); if STR = "STRONG" then SetPlotBGColor(1,iff(Barnumber < AlertBar + ChgColorAfterX_Bars,Green,Cyan)); if STR = "WEAK" then SetPlotBGColor(1,iff(Barnumber < AlertBar + ChgColorAfterX_Bars,Red,Magenta));