To make standard deviation bands work, I had to do the rsi calculation fully first, like so:
void StandardDeviationMethod(int countedBars)
{
if(countedBars < 0)
countedBars=0;
//----
for(int i=Bars - countedBars; i>=0; i--)
{rsi[i]=iRSI(NULL, 0, rsiPeriod, PRICE_CLOSE, i);}
for( i=Bars - countedBars; i>=0; i--)
{double rsiDiviation=iStdDevOnArray(rsi, 0, rsiPeriod, 0,
MODE_SMA, i);
double kDiviation=diviation * rsiDiviation;
upperBorder[i]=50 + kDiviation;
lowerBorder[i]=50 - kDiviation;
}
}
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
FX5_SelfAdjustingRSI:
Author: John Smith