//+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ // http://www.forex-tsd.com/296720-post1293.html mladen //mod #property indicator_separate_window #property indicator_buffers 1 #property indicator_color1 Red extern int SmoothLength = 5; extern int MALength = 3; extern int MAmode = 3; extern int RSILength = 5; extern int Price = 5; extern double Sensitivity = 50.0; // // // // // double bBuffer[]; double bBuffer1[]; double smoothCoeffs[]; double smoothDivisor; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ // // // // // #define Pi 3.14159265358979323846264338 int init() { SetIndexBuffer(0, bBuffer1); SetIndexDrawBegin(0, RSILength + 1); SetIndexBuffer(1, bBuffer); //SetIndexDrawBegin(0, StochLength + 1); // // // // // ArrayResize(smoothCoeffs, SmoothLength); smoothCoeffs[0] = 1; smoothDivisor = 1; for (int i = 1; i < SmoothLength; i++) { double temp = i << 1 / Pi; smoothCoeffs[i] = MathSin(temp) / temp; smoothDivisor += smoothCoeffs[i]; } return (0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ // // // // // int start() { int counted_bars=IndicatorCounted(); int i,limit; if(counted_bars<0) return(-1); if(counted_bars>0) counted_bars--; limit = Bars-counted_bars; // // // // // for (i=limit; i >= 0; i--) { double sum = 0; // for (int l = 0; l < SmoothLength; l++) sum += iStochastic(NULL,0,StochLength,1,1,MODE_SMA,StochPrice,MODE_MAIN,l+i)*smoothCoeffs[l]; // for (int l = 0; l < SmoothLength; l++) sum += Close[l+i]*smoothCoeffs[l]; for (int l = 0; l < SmoothLength; l++) sum += iMA(NULL,0,MALength,0,MAmode,Price,l+i)*smoothCoeffs[l]; // // // // // double temp = MathMax(MathMin((sum/smoothDivisor ) / Sensitivity,0.9999),-0.9999); bBuffer1[i] = MathLog((temp+1.0)/(1.0-temp))/2.0; } for (i=limit; i >= 0; i--) bBuffer1[i] = iRSIOnArray(bBuffer1,0,RSILength,i); return(0); }
Sample
Analysis
Market Information Used:
Indicator Curves created:
Indicators Used:
Moving average indicator
Relative strength index
Custom Indicators Used:
Order Management characteristics:
Other Features: