This code was done to detect any value which was stable the last 20 days (MMA7 variations < 5%) and operate a breakout by breaking the highest of these last 20 days
// MMA7 condition
maxexp = highest[20](exponentialaverage[7])[1]
minexp = lowest[20](exponentialaverage[7])[1]
percexp = (maxexp - minexp) / minexp
c1= percexp < 5/100
// Find max candle on last 20 unit
maxcandle = highest[20](high)[1]
c2 = close > maxcandle
// 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
// Screener
SCREENER[c1 and c2 and c3](percexp*100 as "MMA7 variation")