BullCharts Forum Homepage
Forum Home Forum Home > BullCharts > BullScript
  New Posts New Posts RSS Feed: Metastock swing indicator.
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Metastock swing indicator.

 Post Reply Post Reply Page  <12
Author
Message Reverse Sort Order / View First Unread Post
charlie_8 View Drop Down
Regular
Regular


Joined: 06 Apr 2011
Posts: 21
Post Options Post Options   Quote charlie_8 Quote  Post ReplyReply Direct Link To This Post Posted: 12 Apr 2011 at 9:10am
hi to all bs forum members,

i`m pretty new at BS. I have a swing indicator formula, that I often use in MS. could somebody help me to convert these 2 formulae in bullscript?

SWING REVERSAL UP
m1:= H<Ref(H,-1) AND L<Ref(L,-1);
m2:= H<Ref(H,-2) AND L<Ref(L,-2) AND
H>Ref(H,-1)AND L<Ref(L,-1);
m3:=H<Ref(H,-3) AND L<Ref(L,-3) AND
H>Ref(H,-2) AND L<Ref(L,-2) AND
H>Ref(H,-1) AND L<Ref(L,-1);
mark:= m1 OR m2 OR m3;
set:=L >ValueWhen(1,mark,L) AND H>ValueWhen(1,mark,H) AND
LowestSince(1,Ref(mark,-1),L) > ValueWhen(1,mark,L);
sig:= If(mark,1, If(set,0,PREV));
Cross(sig=0,0.5)

SWING REVERSAL DOWN
m1:= H>Ref(H,-1) AND L>Ref(L,-1);
m2:= H>Ref(H,-2) AND L>Ref(L,-2) AND
H>Ref(H,-1) AND L<Ref(L,-1);
m3:= H>Ref(H,-3) AND L>Ref(L,-3) AND
H>Ref(H,-2) AND L<Ref(L,-2) AND
H>Ref(H,-1) AND L<Ref(L,-1);
mark:= m1 OR m2 OR m3;
set:=L<ValueWhen(1,mark,L) AND H<ValueWhen(1,mark,H) AND
HighestSince(1,Ref(mark,-1) , H) < ValueWhen(1,mark,H);
sig:= If(mark,1, If(set, 0, PREV)); 
Cross(sig=0,0.5)

Thank you :)
Back to Top
 Post Reply Post Reply Page  <12

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.69
Copyright ©2001-2010 Web Wiz