PureBytes Links
Trading Reference Links
|
>This is mostly a visual experience. That's why coding the RSI is
>difficult. The idea is to determine the trend. Here are structured
>rules:
That doesn't sound hard. What follows comes from the top of my
head, untested. Start with:
vars: rsi0(0), trend(0);
rsi0 = rsi(price, length);
trend = 0;
>UPTREND: The RSI must move above 60. This should happen in the last
>x bars. After this movement, the RSI may fall, but it should remain
>above 40.
if highest(rsi0, x) >= 60 then begin
if lowest(rsi0, highestbar(rsi0, x)) > 40 then trend = 1; {uptrend}
end;
>DOWNTREND: The RSI must move below 40. This should happen in the
>last x bars. After this movement, the RSI may rally, but it should
>remain below 60.
if lowest(rsi0, x) <= 40 then begin
if highest(rsi0,lowestbar(rsi0,x)) < 60 then trend = -1; {downtrend}
end;
>SIDEWAYS: If the RSI is not in an uptrend / downtrend then it is
>sideways.
The variable 'trend' will be 0 (sideways) if it wasn't set by one of
the conditions above.
--
,|___ Alex Matulich -- alex@xxxxxxxxxxxxxx
// +__> Director of Research and Development
// \
// __) Unicorn Research Corporation -- http://unicorn.us.com
|