SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
Strategies & Market Trends : Dunnigan's Swing Formulas -- Ignore unavailable to you. Want to Upgrade?


To: MechanicalMethod who wrote (4)11/21/2001 3:49:50 PM
From: MechanicalMethod  Read Replies (1) | Respond to of 37
 
Low overhead swing engine without buy or sell signals.

{111 swing1.14 for black background}
var: dir(0), inside(false), longRngH(0), longRngL(0), myBar(0), myH(0), myL(0),
offset(0), Si(0);
array:s[999,4](0); {s[1999,4](0) will lookback further}

if inside[1] then begin
if H>longRngH or L<longRngL then inside=false;
if H>longRngH and L>longRngL then dir=1; {up}
if H<longRngH and L<longRngL then dir= -1; {down}
end else begin
if H<=H[1] and L>=L[1] then begin
longRngL=L[1]; longRngH=H[1]; inside=true; {inside}
end;
if H>H[1] and L>L[1] then dir= 1; {up}
if H<H[1] and L<L[1] then dir= -1; {down}
end;

if inside=false then begin
myBar=currentbar; myH=H; myL=L;
end;

if dir<>dir[1] then begin si=si+1; s[si,0]=myBar[1];
if dir>0 then s[si,4]=myL[1] else s[si,4]=myH[1];
end;

for offset=currentbar-s[si,0] downto 0 begin
if dir<0 then setPlotColor[offset](1,magenta);
if dir>0 then setPlotColor[offset](1,blue);
end;
plot1[currentbar-s[si,0]](s[si,4]);