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

Notification

Icon
Error

Options
Go to last post Go to first unread
DonVinci  
#1 Posted : Tuesday, September 16, 2008 2:58:42 AM(UTC)
DonVinci

Rank: Newbie

Groups: Registered, Registered Users
Joined: 3/7/2007(UTC)
Posts: 6
Location: Zurich

Dear all

Could you please let me know how to setup the following:

If C > MovAvg begin to sum-up the +1 days

and the same

If C < Mov-Avg begin to sum-up the -1 days

Always starting from zero after the signal.

Many thanks for your support!

Have a good day!

Richard Dale  
#2 Posted : Tuesday, September 16, 2008 5:17:27 PM(UTC)
Richard Dale

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 4/5/2006(UTC)
Posts: 129
Location: Norgate Data

Please define "the signal"

Cheers, Richard Norgate Data
DonVinci  
#3 Posted : Wednesday, September 17, 2008 2:41:56 AM(UTC)
DonVinci

Rank: Newbie

Groups: Registered, Registered Users
Joined: 3/7/2007(UTC)
Posts: 6
Location: Zurich

Close crosses MovAvg. / opening the next day
Richard Dale  
#4 Posted : Wednesday, September 17, 2008 9:31:38 AM(UTC)
Richard Dale

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 4/5/2006(UTC)
Posts: 129
Location: Norgate Data

Give this a go:

barcount:=Cum(1);
movavg := Mov(C,20,S);
above := C>=movavg;
below := C<movavg;
crossabove := Cross(C,movavg);
crossbelow := Cross(movavg,C);
abovecount := barcount-ValueWhen(1,crossabove,Cum(1))+1;
belowcount := -1 * (barcount-ValueWhen(1,crossbelow,Cum(1))+1);

valuetoprint := If(above,abovecount,belowcount);
valuetoprint;

Cheers, Richard Norgate Data
DonVinci  
#5 Posted : Saturday, September 20, 2008 3:51:45 PM(UTC)
DonVinci

Rank: Newbie

Groups: Registered, Registered Users
Joined: 3/7/2007(UTC)
Posts: 6
Location: Zurich

Great! Many thanks!

Kind regards

Vince

Users browsing this topic
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.