[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RSI Formula Discrepancy....



PureBytes Links

Trading Reference Links


I have written the formula for Wilders RSI in AFL because I need to 
use it in conjunction with the "Foreign" function. My attempt is as 
follows:

pd = 14;
Cu = IIf(C > Ref(C,-1),C,0);
Cd = IIf(C < Ref(C,-1),C,0);
Avgu = Sum(Cu,pd)/pd;
Avgd = Sum(Cd,pd)/pd;
RS = Avgu/Avgd;
Vrsi = 100-(100/(1+RS));
Graph0 = Vrsi;

I had expected this to produce an identical graph to:

Vrsi = RSI(14);
Graph0 = Vrsi;

Could someone please confirm that my formula is correct, and if so, 
why the graphs are not identical.

Keith