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!
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 4/5/2006(UTC) Posts: 129 Location: Norgate Data
|
Please define "the signal"
|
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 3/7/2007(UTC) Posts: 6 Location: Zurich
|
Close crosses MovAvg. / opening the next day
|
|
|
|
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;
|
|
|
|
|
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.