This screener is an attempt to find price volatility explosion in intraday. The code spots if the last activity of the Bollinger bands were quiet before it breaks up or down a keltner channel made of typical price moving average.
The default parameters work well for forex on a 5 minutes timeframe.
You can try and explore the parameters for any instrument and timeframe horizons. If you find better parameters or ideas to complete this code, I would be glad to improve it.
//********* Parameters *********
//Keltner channel
n=20
coeff=1.5
//Bollinger Bands
period=10
deviation=1
//Candles lookback
xCandles=4
//******************************
//keltner bands
MA = Average[N](TypicalPrice)
UpperBand = MA + coeff*Average[N](Range)
LowerBand = MA - coeff*Average[N](Range)
//bollinger bands
BBmiddle = average[period](close)
dev = std[period](close)
BBup = BBmiddle+dev*deviation
BBdown = BBmiddle-dev*deviation
count = 0
for i = 1 to xCandles do
c1 = BBup[i]<UpperBand[i]
c2 = BBdown[i]>LowerBand[i]
if c1 and c2 then
count = count+1
endif
next
validate = count=xCandles
bullishexplosion = BBup>UpperBand
bearishexplosion = BBdown<LowerBand
SCREENER [validate AND (bullishexplosion OR bearishexplosion)] (close-MA)