Getting Clear With Short-Term Swings
In his article, “Getting Clear With Short-Term Swings”, Ron Black demonstrates an indicator that finds an effective way to identify and visualize short-term price swings. The method is simple and objective. It requires no calculation and has no delay.
Using Tradecision’s Indicator Builder, one needs to create the SWING LINE indicator:
var
hH:=H;
lL:=L;
lH:=H;
hL:=L;
upsw:=0;
upswprev:=0;
end_var
if HISTORYSIZE < 1 then upswprev:=0;
else upswprev:=upsw\1\;
{Find Swing Direction}
if upswprev=1 then begin
if H>hH\1\ then hH:=H; {update hH, hL}
else hH := hH\1\;
if L>hL\1\ then hL:=L;
else hL := hL\1\;
if HlH then begin {swing changes to up}
upsw:=1;
hH:=H;
hL:=L;
end;
end;
print(1,upswprev);
if upsw=1 then return hL;
if upsw=0 then return lH;
return 0;
<hL then begin {swing changes to down}
upsw:=0;
lL:=L;
lH:=H;
end;
end;
if upswprev=0 then begin
if L<lL\1\ then lL:=L; {update lL, lH}
else lL:= lL\1\;
if H<lH\1\ then lH:=H;
else lH:= lH\1\;return 0;
lH then begin {swing changes to up}
upsw:=1;
hH:=H;
hL:=L;
end;
end;
print(1,upswprev);
if upsw=1 then return hL;
if upsw=0 then return lH;
return 0;
|
Download to import into Tradecision. 
How to use this indicator in Tradecision:
- Click Download.
- Save this indicator in a safe location on your hard drive.
- Open Tradecision and in the Tools menu click Indicator Builder.
- In the Indicator Builder dialog, click Import, locate the saved file and then click OK.
The indicator will be added to the Custom Indicators list.
|