RSI, MA, BOLL or RSI, BOLL MA diferents results | Forex Factory

HeroPoker_HeroPoker扑克_HeroPoker德扑圈官网

Attachments: RSI, MA, BOLL or RSI, BOLL MA diferents results

RSI, MA, BOLL or RSI, BOLL MA diferents results

Why the results are different if I do the following steps:
I have the rsi, then I put the bollinger band (Previous indicator option), after that I put the Ma (Previous indicator opton)

it is different that
I have the rsi, then I put the MA (Previous indicator option), after that I put the bollinger band (Previous indicator opton)
Attached Image
In the first example you are using rsi as the data for the BB and the BB as the input data for the MA


In the second example you are using rsi as the input data for the MA (this is different than the first example) and you are using the MA as the input data for the BB( this is also a different data input)
I calculate the second data as followig

double rsiVal(int shift)
{
double rsival = iRSI(Symbol(),0,RSIPeriod,PRICE_CLOSE,shift);
return(rsival);
}

//=============== function: bands1 (gets BB value on the RSI array for recently closed bar)
double bands1()
{
double rsi[];
ArrayResize(rsi, Bars);
ArraySetAsSeries(rsi,true);
for(int i=Bars; i>=0; i--)
{
rsi[i]=iRSI(Symbol(),0, RSIPeriod, PRICE_CLOSE,i+0);
}
double bb = iBandsOnArray(rsi,0,BandsPeriod,BandsDeviations,0,MODE_MAIN,0);
return(bb);
}

double rsiMAVal(int shift)
{
double rsi[];
ArrayResize(rsi, Bars);
ArraySetAsSeries(rsi,true);
for(int i=Bars; i>=0; i--)
{
rsi[i]=iRSI(Symbol(),0, RSIPeriod, PRICE_CLOSE,i+shift);
}
double ma = iMAOnArray(rsi,0,RSIMAPeriod,0,MODE_EMA,0);
return(ma);
}
but How I can calculate the first example?