A precise picture of the short-term price swings is basic to understanding the market direction. The Clear method is an effective way to identify and visualize short-term price swings. The method benefits the individual trader because it is simple, objective, requires no calculation, and has no delay.
This indicator is the implementation of the swing line indicator presented in Ron Black’s article in this issue (“Getting Clear With Short-Term Swings”).
Code converted from TradeStation programming language by a request in the English forum.
//PRC_SwingLine Ron Black | indicator
//20.09.2017
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
if upsw=1 then
if high>hH then
hH=high
endif
if low>hL then
hL=low
endif
if high<hL then
upsw=0
lL=low
lH=high
endif
endif
if upsw=0 then
if low<lL then
lL=low
endif
if high<lH then
lH=high
endif
if low>lH then
upsw=1
hH=high
hL=low
endif
endif
if upsw=1 then
swingline=hL
r=0
g=255
b=255
else
swingline=lH
r=255
g=0
b=255
endif
return swingline coloured(r,g,b) style(line,2) as "Swing Line"