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

Notification

Icon
Error

Options
Go to last post Go to first unread
zigzag  
#1 Posted : Friday, April 17, 2009 5:21:47 AM(UTC)
zigzag

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/13/2009(UTC)
Posts: 42

Hello

I am trying to create an adaptive trend scoring indicator for SPY as follows:

tp:=Int(5*ATR(3)/1.5);

counter:=if(h>ref(h,-1) and l>ref(l,-1),1,if(h<ref(h,-1) and l<ref(l,-1),-1,0);

score:=Sum(counter,LastValue(tp+PREV-PREV));

I have used the "adaptive" trick code (LastValue(tp+prev-prev) before and it works well but I can't get it to work in this case.

Any ideas?

Many thanks

ZigZag

wabbit  
#2 Posted : Friday, April 17, 2009 5:58:23 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
extfml("forum.Sum",data,periods);


wabbit [:D]

Users browsing this topic
Guest (Hidden)
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.