MaryParticipant
Average
Hello, the Breakout screener with high volume below only shows stocks for the Upside Breakout.
How can this Screener below be modified to do the same thing for the Downside please? Breakout candle with high volume to the Down side? Thank you.
// today variation
tdVar = (close[0] – open[0]) / open[0] * 100
// Var condition
avgVar = 0
for i = 1 to 10 do
if (close[i] > open[i]) then
avgVar = avgVar + (close[i] – open[i]) / open[i]
else
avgVar = avgVar + (open[i] – close[i]) / close[i]
endif
next
avgVar = avgVar / 10 * 100
c1 = tdVar > avgVar
// highest break condition
maxValue = highest[10](high)[1]
c2 = maxvalue < close and open < maxvalue
// Volume condition
avgVol = average[20](volume)
sum = 0
for i=0 to 20
if (volume[i] < avgVol*10) then
sum = sum + volume[i]
else
sum = sum + avgVol
endif
next
avgVol = sum / 21
c3 = avgVol > 1000
// Breakout Var%
breakoutVar = (close – maxvalue)/close*100
// Screener
SCREENER[c1 and c2 and c3](breakoutVar as “Breakout Var%”)
Try this one (not tested):
// today variation
tdVar = (close[0] – open[0]) / open[0] * 100
// Var condition
avgVar = 0
for i = 1 to 10 do
if (close[i] > open[i]) then
avgVar = avgVar + (close[i] – open[i]) / open[i]
else
avgVar = avgVar + (open[i] – close[i]) / close[i]
endif
next
avgVar = avgVar / 10 * 100
c1 = tdVar > avgVar
// lowest break condition
minValue = lowest[10](low)[1]
c2 = minValue > close and open > minValue
// Volume condition
avgVol = average[20](volume)
sum = 0
for i=0 to 20
if (volume[i] < avgVol*10) then
sum = sum + volume[i]
else
sum = sum + avgVol
endif
next
avgVol = sum / 21
c3 = avgVol > 1000
// Breakout Var%
breakoutVar = abs(close – minValue)/close*100
// Screener
SCREENER[c1 and c2 and c3](breakoutVar as “Breakout Var%”)
MaryParticipant
Average
Thank you I put in the code but there is an error saying that
minValue is not defined.
Can this be corrected please?
Thank you
Sorry, it’s due to line 14 having mistakingly joined two lines.
Replace it with these lines:
// lowest break condition
minValue = lowest[10](low)[1]
MaryParticipant
Average
Hi Robert,
I fixed it as you suggested but now the code is not showing error but returning nothing at all not on nasdaq, not on nyc not, not on any georaphic zone.
this is the code I have fixed as you suggested:
// today variation
tdVar = (close[0] – open[0]) / open[0] * 100
// Var condition
avgVar = 0
for i = 1 to 10 do
if (close[i] > open[i]) then
avgVar = avgVar + (close[i] – open[i]) / open[i]
else
avgVar = avgVar + (open[i] – close[i]) / close[i]
endif
next
avgVar = avgVar / 10 * 100
c1 = tdVar > avgVar
// lowest break condition
minValue = lowest[10](low)[1]
c2 = minValue > close and open > minValue
// Volume condition
avgVol = average[20](volume)
sum = 0
for i=0 to 20
if (volume[i] < avgVol*10) then
sum = sum + volume[i]
else
sum = sum + avgVol
endif
next
avgVol = sum / 21
c3 = avgVol > 1000
// Breakout Var%
breakoutVar = abs(close – minValue)/close*100
// Screener
SCREENER[c1 and c2 and c3](breakoutVar as “Breakout Var%”)
Sorry, I missed changing a line. Replace the line just below the line FOR…. with this one:
if (close[i] < open[i]) then
MaryParticipant
Average
Thank you Robert, screener working great!