Inputs: int maLength1(8), int maLength2(13), int maType1(0), // 0=Simiple; 1=Exp; 2=Wilders; 3=Hull int maType2(0), // 0=Simiple; 1=Exp; 2=Wilders; 3=Hull double colorAbove(Green), double colorBelow(Red), double colorCrossing(Yellow); Variables: double ma1(0.0), double ma2(0.0), bool isRadar(False), bool conditionAbove(False), bool conditionBelow(False), bool isCrossing(False); Once Begin isRadar = GetAppInfo( aiApplicationType ) = cRadarScreen; End; Switch (maType1) Begin Case 0: ma1 = AverageFC(Close, maLength1); Case 1: ma1 = XAverage(Close, maLength1); Case 2: ma1 = WAverage(Close, maLength1); Case 3: ma1 = HMA(Close, maLength1); Default: ma1 = AverageFC(Close, maLength1); End; Switch (maType2) Begin Case 0: ma2 = AverageFC(Close, maLength2); Case 1: ma2 = XAverage(Close, maLength2); Case 2: ma2 = WAverage(Close, maLength2); Case 3: ma2 = HMA(Close, maLength2); Default: ma2 = AverageFC(Close, maLength2); End; Plot1(ma1, !("MA1"), Yellow); Plot2(ma2, !("MA2"), Cyan); // check if we are in a RadarScreen If (isRadar) Then Begin // if in a RadarScreen, set plots to display text Plot3(NumToStr(maLength1, 0) + "x" + NumToStr(maLength2, 0), "MA Conditions", Black); End; If ((ma1[1] > ma2[1] and ma1 < ma2) or (ma1[1] < ma2[1] and ma1 > ma2)) Then Begin SetPlotBGColor(3, colorCrossing); End Else Begin If (ma1 > ma2) Then Begin SetPlotBGColor(3, colorAbove); End Else Begin if (ma1 < ma2) Then Begin SetPlotBGColor(3, colorBelow); End; End; End;