Williams Swing Points

Category: Screeners By: Violet Created: November 21, 2017, 9:01 AM
November 21, 2017, 9:01 AM
Screeners
12 Comments

Stock screener based on Williams Highs and Lows indicator made by @gabri

 

//Williams SwingPoints
// 20-11-2017
// Violet, extension of on Gabri's algo

//Test for insidebar
insidebar = high < high[1] and low > low[1]
if not insidebar and high > alto[1] then
 alto = high
 basso = low
 markup = barindex
 markhigh = high
endif
if not insidebar and low < basso[1] then
 alto = high
 basso = low
 markdown = barindex
 marklow = low
endif

if alto < alto[1] and trend = 1 then
 trend = 0
 thisbar = markup
 mediummarkup = shortmarkup
 shortmarkup = markup
 longmarkhigh = mediummarkhigh
 mediummarkhigh = shortmarkhigh
 shortmarkhigh = markhigh
 if longmarkhigh < mediummarkhigh and mediummarkhigh > shortmarkhigh then
  longmarkUpset = 1
  thisbar = mediummarkup
 else
  longmarkUpset = 0
 endif
endif

if basso > basso[1] and trend = 0 then
 trend = 1
 thisbar = markdown
 mediummarkdown = shortmarkdown
 shortmarkdown = markdown
 longmarklow = mediummarklow
 mediummarklow = shortmarklow
 shortmarklow = marklow
 if longmarklow > mediummarklow and mediummarklow < shortmarklow then
  longmarkDownset = 1
  thisbar = mediummarkdown
 else
  longmarkDownset = 0
 endif
endif

whichbar = barindex - thisbar
LookbackPeriods = 1

signalUP1 = trend = 1 and not longmarkUPset and whichbar <= LookbackPeriods
signalUp2 = trend = 1 and longmarkUpset and whichbar <= LookbackPeriods
signalDn1 = trend = 0 and not longmarkDownset and whichbar <= LookbackPeriods
signalDn2 = trend = 0 and longmarkDownset and whichbar <= LookbackPeriods

if signalup1 then
 type = 1 // arrowup
elsif signalup2 then 
 type = 2 // ellipse at bottom
elsif signalDn1 then
 type = -1 // arrowdown
elsif signalDn2 then
 type = -2 // ellipse at top
endif

signal = SignalUP1 OR signalUP2 or SignalDn1 OR signalDn2

screener [ signal ] sort by type

 

Download
Filename: Williams-Swing-Point.itf
Downloads: 724
Violet Master
I usually let my code do the talking, which explains why my bio is as empty as a newly created file. Bio to be initialized...
Author’s Profile

Comments

Logo Logo
Loading...