/////////////////////////
// RSI of WRO and WSO ///
////////////////////////
TimeFrameSet(60*in1Minute);
// WRO - WIDNER'S RESISTANCE OSCILLATOR
p1=-4;
p2=9;
r1=ValueWhen(Ref(L,p1)==LLV(L,p2),Ref(L,p1),1);
r2=ValueWhen(Ref(L,p1)==LLV(L,p2),Ref(L,p1),2);
r3=ValueWhen(Ref(L,p1)==LLV(L,p2),Ref(L,p1),3);
r4=ValueWhen(Ref(L,p1)==LLV(L,p2),Ref(L,p1),4);
r5=ValueWhen(Ref(L,p1)==LLV(L,p2),Ref(L,p1),5);
r6=ValueWhen(Ref(L,p1)==LLV(L,p2),Ref(L,p1),6);
r1m=Max(0,Min(1,int(r1/C)));
r2m=Max(0,Min(1,int(r2/C)));
r3m=Max(0,Min(1,int(r3/C)));
r4m=Max(0,Min(1,int(r4/C)));
r5m=Max(0,Min(1,int(r5/C)));
r6m=Max(0,Min(1,int(r6/C)));
WRO=100*(1-(r1m+r2m+r3m+r4m+r5m+r6m)/6);
Plot(WRO,"",colorGreen,styleDashed);
// WSO - WIDNER'S SUPPORT OSCILLATOR
p1=-4;
p2=9;
s1=ValueWhen(Ref(H,p1)==HHV(H,p2),Ref(H,p1),1);
s2=ValueWhen(Ref(H,p1)==HHV(H,p2),Ref(H,p1),2);
s3=ValueWhen(Ref(H,p1)==HHV(H,p2),Ref(H,p1),3);
s4=ValueWhen(Ref(H,p1)==HHV(H,p2),Ref(H,p1),4);
s5=ValueWhen(Ref(H,p1)==HHV(H,p2),Ref(H,p1),5);
s6=ValueWhen(Ref(H,p1)==HHV(H,p2),Ref(H,p1),6);
s1m=Max(0,Min(1,int(s1/C)));
s2m=Max(0,Min(1,int(s2/C)));
s3m=Max(0,Min(1,int(s3/C)));
s4m=Max(0,Min(1,int(s4/C)));
s5m=Max(0,Min(1,int(s5/C)));
s6m=Max(0,Min(1,int(s6/C)));
WSO=100*(1-(s1m+s2m+s3m+s4m+s5m+s6m)/6);
Plot(WSO,"",colorRed,styleDashed);
// AVERAGES + RSI
x1=EMA(WRO,5);
x2=EMA(WRO,10);
x3=EMA(WRO,15);
x4=(x1+x2+x3)/3;
x5=RSIa(x4,5);
y1=EMA(WSO,5);
y2=EMA(WSO,10);
y3=EMA(WSO,15);
y4=(y1+y2+y3)/3;
y5=RSIa(y4,5);
z1=(x5+y5)/2;
z2=EMA(z1,5);
z3=Zig(x2,5);
Cond=IIf(z3>Ref(z3,-1),colorGreen,colorRed);
Plot(z3,"",Cond,8);
Plot(15,"",colorBlue,1);
Plot(85,"",colorBlue,1);
PlotShapes(IIf(Cross(z3,15),shapeUpArrow,shapeNone),colorGreen);
PlotShapes(IIf(Cross(85,z3),shapeDownArrow,shapeNone),colorRed);
I'm not particularly well-acquainted with AFL, did you compare your indicator values with amibroker platform? I don't have that capability.
If I were you, I'd turn to mq4 sources you posted before, I saw that they are coded by Mladen, a coder I respect and admire very much! Look how clean his code is! If you have the first version in FSB working, but values don't match, you can compare array values between mt and FSB, that's how you will know where the culprit might be. I've been practicing this method in recent times with difficult projects, a bit of a fuss, but eventually gets you where you want it to be. If any specific problems arise, post them, I'll try to advise to best of my little knowledge I possess.