PureBytes Links
Trading Reference Links
|
Hi All,
I had to read about a very good new indicator, called "Relative
Momentum Index"
I'm no so good in programming AFL, but I think the formula would be
very interested for all off us.
Can anyone translate the formula?
The formula, that i have is only for "Tradestation 4.0"
Formula:
Inputs: Price(C), Len(5), Y(10);
Vars: Counter(0),DownAmt(0),UpAmt(0),UpSum(0),
DownSum(0),UpAvg(0),DownAvg(0),MyRange(0),RMI(0);
if currentBar < Y then begin
MyRange = Len;
UpSum = 0;
DownSum = 0;
ForCounter = 0 to MyRange -1 begin
UpAmt = Price(Counter) - Price(Counter+Y); if UpAmt >= 0 then
DownAmt = 0
Else Begin
DownAmt = -UpAmt;
UpAmt = 0;
End;
UpSum = UpSum + UpAmt;
DownSum = DownSum + DownAmt;
End;
UpAvg = UpSum / MyRange;
DownAvg = DownSum / MyRange;
End
Else if CurrentBar > Y then Begin
UpAmt = Price(0) - Price(y);
if UpAmt >= 0 then begin
DownAmt = 0;
End
Else Begin
DownAmt = -UpAmt;
UpAmt = 0;
End;
UpAvg = (UpAvg(1) * (MyRange -1) + UpAmt) / MyRange;
DownAvg = (DownAvg(1) * (MyRange - 1) + DownAmt)/MyRange; End;
if UpAvg + DownAvg <>0 then
RMI = 100 * UpAvg / (UpAvg + DownAvg)
Else
RMI = 0;
Plot1(RMI,"RMI")
It would be very nice, if anyone can translate this.
Best regards to All and
Thomasz Janeczko
|