Error

 Previous Topic Next Topic
 Ted #1 Posted : Saturday, September 18, 2004 1:29:49 PM(UTC) Rank: NewbieGroups: Registered, Registered Users, SubscribersJoined: 9/18/2004(UTC)Posts: 1 does anyone have two-day swing chart formula? much appreciated!
 Wanna join the discussion?! Login to your Discussions forum accountor Register a new forum account.
 Patrick #2 Posted : Saturday, September 18, 2004 4:28:33 PM(UTC) Rank: Advanced MemberGroups: Registered, Registered Users, SubscribersJoined: 9/8/2004(UTC)Posts: 2,266Was thanked: 1 time(s) in 1 post(s) This is the formula for a Gann Swing : {Market swing is defined as: Up = 2 higher highs, Down = 2 lower highs.} Us:=BarsSince((H > Ref(H,-1)) AND (Ref(H,-1) > Ref(H,-2))); Ds:=BarsSince((L < Ref(L,-1)) AND (Ref(L,-1) < Ref(L,-2))); Sd1:=If(Us=0, {then}If(Ref(L,-1)<>LowestSince(1,Ds=0,L), {then}1, {else}0), {else}If(Ds=0, {then}If(Ref(H,-1)<> HighestSince(1,Us=0,H), {then}-1, {else}0), {else}0)); Sd2:=If(Sd1=1, {then} If(Ref(BarsSince(Sd1=1),-1) > Ref(BarsSince(Sd1=-1),-1), {then}1, {else}0), {else} If(Sd1=-1, {then}If(Ref(BarsSince(Sd1=1),-1) < Ref(BarsSince(Sd1=-1),-1), {then}-1, {else}0), {else}0)); TD1:=ValueWhen(1,Sd2<>0,Sd2); Td1; This is only an indicator that will go from 1 to -1. Ultimately I would create an expert using this indicator and the cross function, which will make a lot more sense than an indicator. If that is not what you wanted then let me know more info, I might be able to create it for you.