logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
pete123  
#1 Posted : Thursday, January 8, 2009 6:49:20 PM(UTC)
pete123

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 1/7/2009(UTC)
Posts: 5

I am trying to formulae TD REI oscillator. Appreciate if someone can assist in coding. Thanks. X = (current high - high of 2 bars ago) + (current low - low of 2 bars ago) Y = Cumulative Sum of X (one bar ago to five bars ago) Hm = highest high in past 5 bars Lm = lowest low in past 5 bars TD REI = (Y/(Hm - Lm)) x 100
minnamor  
#2 Posted : Thursday, January 8, 2009 10:32:02 PM(UTC)
minnamor

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/27/2005(UTC)
Posts: 126
Location: Italy

From http://www.linnsoft.com/tour/techind/tdrei.htm:

N:=5;
X:= IF(((H>=Ref(L,-5) OR H>=Ref(L,-6)) AND (L<=Ref(H,-5) OR L<=Ref(H,-6)) ) OR ((Ref(H,-2)>=Ref(C,-7) OR Ref(H,-2)>=Ref(C,-8)) AND (Ref(L,-2)<=Ref(C,-7) OR Ref(L,-2)<=Ref(C,-8)))),
(H - Ref(H,-2)) + (L - Ref(L,-2)),
0);
TDREI = SUM(x,N) / SUM(ABS(X), N);
TDREI

Is this correct?

pete123  
#3 Posted : Friday, January 9, 2009 5:43:35 PM(UTC)
pete123

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 1/7/2009(UTC)
Posts: 5

thanks but there is some missing '(', ')', ':'.

pete123  
#4 Posted : Friday, January 9, 2009 6:33:18 PM(UTC)
pete123

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 1/7/2009(UTC)
Posts: 5

i HAVE corrected by adding '(', but i get division error by 0 error. N:=5; X:= If(((H>=Ref(L,-5) OR H>=Ref(L,-6)) AND (L<=Ref(H,-5) OR L<=Ref(H,-6))) OR ((Ref(H,-2)>=Ref(C,-7) OR Ref(H,-2)>=Ref(C,-8)) AND (Ref(L,-2)<=Ref(C,-7) OR (Ref(L,-2)<=Ref(C,-8)))), (H - Ref(H,-2)) + (L - Ref(L,-2)), 0); TDREI:= Sum(X,N) / Sum(Abs(X), N); TDREI
minnamor  
#5 Posted : Saturday, January 10, 2009 12:31:42 AM(UTC)
minnamor

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/27/2005(UTC)
Posts: 126
Location: Italy

Change

TDREI:= Sum(X,N) / Sum(Abs(X), N); to

TDREI:= Sum(X,N) / max(0.0001,Sum(Abs(X), N));

pete123  
#6 Posted : Saturday, January 10, 2009 8:07:27 AM(UTC)
pete123

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 1/7/2009(UTC)
Posts: 5

Thanks. The zero division error is no longer there.

However, the current TD REI does seem to differ from what i get from Bloomberg. Hmm, have to figure this one out.
Users browsing this topic
Guest (Hidden)
Similar Topics
TD REI Buy signal (Formula Assistance)
by gorachand 8/27/2017 5:19:35 PM(UTC)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.