TS RadarScreen "E" May 11, 2015 09:31PM |
Registered: 10 years ago Posts: 271 |
{*************************************************************** *** TS RadarScreen 3 MA cross *** *** Allows user to define MA type and length. *** *** 5/11/2014 by NCT *** **************************************************************} Inputs: MA_Type( 1 {1=SMA, 2=EMA}) , MA_Short( 0 ) , MA_Medium( 0 ) , MA_Long( 0 ) ; Var: MA_S( 0 ) , MA_M( 0 ) , MA_L( 0 ) , { Application Identifier } RS( GetAppInfo(aiApplicationType) = 2 ) , // True if indicator inserted in a Radarscreen Chart( GetAppInfo(aiApplicationType) = 1 ) ; // True if indicator inserted in a chart { --- Calculate Moving Averages --- } If MA_Type = 1 Then Begin MA_S = AverageFC(Close,MA_Short) ; MA_M = AverageFC(Close,MA_Medium) ; MA_L = AverageFC(Close,MA_Long) ; End Else If MA_Type = 2 Then Begin MA_S = XAverage(Close,MA_Short) ; MA_M = XAverage(Close,MA_Medium) ; MA_L = XAverage(Close,MA_Long) ; End Else RaiseRunTimeError("Invalid moving average type. Please select 1 for simple or 2 for exponential" ) ; { --- Plot Signal: RadarScreen ---} If RS Then Begin If MA_S > MA_M AND MA_M > MA_L Then Begin Plot1("","ESig",rgb(100,100,100)) ; SetPlotBGColor(1,rgb(111,255,111)) ; End Else if MA_S < MA_M AND MA_M < MA_L Then Begin Plot1("","ESig",rgb(100,100,100)) ; SetPlotBGColor(1,rgb(255,108,108)) ; End Else Begin Plot1("","ESig",rgb(255,255,165)); SetPlotBGColor(1,rgb(255,255,165)) ; End; End;
Re: TS RadarScreen "E" May 12, 2015 01:46AM |
Registered: 10 years ago Posts: 615 |
Re: TS RadarScreen "E" May 12, 2015 07:08AM |
Registered: 10 years ago Posts: 70 |
Re: TS RadarScreen "E" May 12, 2015 07:56AM |
Registered: 10 years ago Posts: 271 |