Here is a screener that will detect 3 Lines Breakouts. It has to be tuned to fit your needs : change the ScreenerBehavior variable to the value that you target : 1 = bullish breakouts, 0 = bearish breakouts , 2 = all breakouts.
// Change the below variable to change the screener behavior
// 1 = bullish breakouts
// 0 = bearish breakouts
// 2 = all breakouts
once ScreenerBehavior=1
// Trend=0 mean that the current block is red
// Trend=1 mean that the current block is green
once Trend=1
// On each candle the breakout are put to false
Breakout=0
if (close > Chand1PH and Trend=1) then
Chand3PB=Chand2PB
Chand3PH=Chand2PH
Chand2PB=Chand1PB
Chand2PH=Chand1PH
Chand1PB=Chand1PH
len=len+1
if (len > 3) then
len=3
endif
Chand1PH=close
elsif (close < Chand1PB and Trend=0) then
Chand3PB=Chand2PB
Chand3PH=Chand2PH
Chand2PB=Chand1PB
Chand2PH=Chand1PH
Chand1PH=Chand2PB
len=len+1
if (len > 3) then
len=3
endif
Chand1PB=close
elsif (Trend=1 and ((close < Chand3PB and len=3) or (close < Chand2PB and len=2) or (close < Chand1PB and len=1))) then
Chand3PB=Chand2PB
Chand3PH=Chand2PH
Chand2PB=Chand1PB
Chand2PH=Chand1PH
Chand1PB=close
Chand1PH=Chand2PB
len=1
Trend=0
if (ScreenerBehavior = 0 or ScreenerBehavior = 2) then
Breakout = 1
endif
elsif (Trend=0 and ((close > Chand3PH and len=3) or (close > Chand2PH and len=2) or (close > Chand1PH and len=1))) then
Chand3PB=Chand2PB
Chand3PH=Chand2PH
Chand2PB=Chand1PB
Chand2PH=Chand1PH
Chand1PH=close
Chand1PB=Chand2PH
len=1
Trend=1
if (ScreenerBehavior = 1 or ScreenerBehavior = 2) then
Breakout = 1
endif
endif
screener[Breakout]