Ultra Spearman Rank Correlation Indicator For MT5
The Ultra Spearman Rank Correlation Indicator For MT5 is based on several signal lines that are formed based on the standard deviation in the price. Most of the time, the traders fails to set the take profit level at the perfect place since they don’t understand when the market will stop moving in favor of the trend. When the market is trending up, you are going to notice blue bars in the indicator indicator window. The bigger the bar is the higher the strength of the bull. On the contrary, if the bears dominate the market, you will notice pink bars in the indicator window. On the contrary, you will notice grey color bars when the market is sideway. Find the trade setups by using the critical support and resistance level and take the reading of this indicator to analyze the quality of the trade setups. If you feel confused with this tool, you should learn to use this indicator in a demo account.
Installing the Ultra Spearman Rank Correlation Indicator For MT5
After you downloaded the indicator via the form above you need to unzip the zip-file. Then you need to copy the file ultraspearmanrankcorrelation.mq5 into the folder MQL5\Indicators of your MT5 installation. After that please restart MT5 and then you will be able to see the indicator in the list of indicators.
Parameters of the Ultra Spearman Rank Correlation Indicator For MT5
The Ultra Spearman Rank Correlation Indicator For MT5 has 15 parameters to configure.
input int rangeN=14;
input Smooth_Method W_Method=MODE_JJMA; // Smooth method
input int StartLength=3; // Start length
input int WPhase=100; // Phase
input uint Step=5; // Period step
input uint StepsTotal=10; // Steps total
input Smooth_Method SmoothMethod=MODE_JJMA; // Smooth method
input int SmoothLength=3; // Smooth length
input int SmoothPhase=100; // Smooth phase
input uint UpLevel=80; // Overbought level (in %)
input uint DnLevel=20; // Oversold level (in %)
input color UpLevelsColor=Blue; // Overbought level color
input color DnLevelsColor=Blue; // Oversold level color
input STYLE Levelstyle=DASH_; // Level style
input WIDTH LevelsWidth=Width_1; // Level width
Buffers of the Ultra Spearman Rank Correlation Indicator For MT5
The Ultra Spearman Rank Correlation Indicator For MT5 provides 3 buffers.
SetIndexBuffer(0,BullsBuffer,INDICATOR_DATA);
SetIndexBuffer(1,BearsBuffer,INDICATOR_DATA);
SetIndexBuffer(2,ColorBuffer,INDICATOR_COLOR_INDEX);
Main Parts Of The Code
int OnCalculate(const int rates_total, // bars in history at current tick
const int prev_calculated,// bars in history at previous call
const datetime &time[],
const double &open[],
const double& high[], // price array of High prices (used in calculations)
const double& low[], // price array of Low prices (used in calculations)
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[])
{
//---- check calculated bars
if(BarsCalculated(SRC_Handle) lt rates_total
|| rates_total lt min_rates_total)
return(RESET);
//---- declaration of local variables
int to_copy,limit,bar,maxbar0,maxbar1,maxbar2;
double upsch,dnsch,SRC[];
//---- calculation of starting bar index (maxbar) for XMASeries() method
maxbar0=rates_total-1;
maxbar1=maxbar0-min_rates_src;
maxbar2=maxbar0-min_rates_xma;
//---- calculation of starting bar index imit for recalculation loop
if(prev_calculated gt rates_total || prev_calculated lt =0)// checking of first call
limit=maxbar0; // starting index for all bars
else limit=rates_total-prev_calculated; // starting index for new bars
to_copy=limit+1;
//---- set indexing as time series
ArraySetAsSeries(open,true);
ArraySetAsSeries(low,true);
ArraySetAsSeries(high,true);
ArraySetAsSeries(close,true);
ArraySetAsSeries(SRC,true);
//---- copy new data to arrays
if(CopyBuffer(SRC_Handle,0,0,to_copy,SRC) lt =0) return(RESET);
//---- calculation of indicator values
for(bar=limit; bar gt =0 && !IsStopped(); bar--)
{
for(int sm=int(StepsTotal); sm gt =0 && !IsStopped(); sm--)
invalue0[sm]=XMA[sm].XMASeries(maxbar1,prev_calculated,rates_total,W_Method,WPhase,period[sm],SRC[bar],bar,true);
if(bar gt maxbar2)
{
if(bar) ArrayCopy(invalue1,invalue0,0,0,WHOLE_ARRAY);
continue;
}
upsch=0;
dnsch=0;
for(int sm=int(StepsTotal); sm gt =0 && !IsStopped(); sm--)
if(invalue0[sm] gt invalue1[sm]) upsch++;
else dnsch++;
BullsBuffer[bar]=XMA[StTot1].XMASeries(maxbar2,prev_calculated,rates_total,SmoothMethod,SmoothPhase,SmoothLength,upsch,bar,true);
BearsBuffer[bar]=XMA[StTot2].XMASeries(maxbar2,prev_calculated,rates_total,SmoothMethod,SmoothPhase,SmoothLength,dnsch,bar,true);
if(bar) ArrayCopy(invalue1,invalue0,0,0,WHOLE_ARRAY);
}
//---- modify starting index limit for recalculations
if(prev_calculated gt rates_total || prev_calculated lt =0)// checking of first call
limit--;
//---- calculation of indicator values
for(bar=limit; bar gt =0 && !IsStopped(); bar--)
{
ColorBuffer[bar]=0;
if(BullsBuffer[bar] gt BearsBuffer[bar])
{
if(BullsBuffer[bar] gt dUpLevel || BearsBuffer[bar] lt dDnLevel)
{
if(BullsBuffer[bar+1] lt =BullsBuffer[bar]) ColorBuffer[bar]=7;
else ColorBuffer[bar]=8;
}
else
{
if(BullsBuffer[bar+1] lt =BullsBuffer[bar]) ColorBuffer[bar]=5;
else ColorBuffer[bar]=6;
}
}
if(BullsBuffer[bar] lt BearsBuffer[bar])
{
if(BullsBuffer[bar] lt dDnLevel || BearsBuffer[bar] gt dUpLevel)
{
if(BearsBuffer[bar+1] lt =BearsBuffer[bar]) ColorBuffer[bar]=1;
else ColorBuffer[bar]=2;
}
else
{
if(BearsBuffer[bar+1] lt =BearsBuffer[bar]) ColorBuffer[bar]=3;
else ColorBuffer[bar]=4;
}
}
}
//----
return(rates_total);
}
//+------------------------------------------------------------------+