Today, we introduce the “Structural Breaks” indicator and screener.
This indicator focuses on identifying bullish and bearish trading opportunities by detecting supply and demand patterns and using pivots to mark critical price zones.
The “Structural Breaks” indicator overlays directly on the price chart, providing an intuitive and straightforward visual interpretation of trading signals. Among its configurable features are:
The core of the indicator lies in its ability to distinguish between bullish and bearish movements through a series of logical functions that examine the candle structure in relation to identified pivots. These functions include:
The signals generated by the “Structural Breaks” indicator are presented visually for easy interpretation:
This indicator lends itself to a variety of trading strategies, from intraday operations to longer-term trend analysis. Some applications include:
////////////////////////////////////////////////////////////////
//PRC_Structural Breaks indicator
//version = 0
//19.03.24
//Iván González @ www.prorealcode.com
//Sharing ProRealTime knowledge
////////////////////////////////////////////////////////////////
//------------Inputs-----------------------------------------//
prd = 1 //pivot length
//------------Bullish and bearish conditions-----------------//
isObUp = close[1]<open[1] and close>open and close > high[1]
isObDown = close[1]>open[1] and close < open and close < low[1]
//------------Pivots low-------------------------------------//
if low > low[prd] and lowest[prd](low) > low[prd] and low[prd] < lowest[prd](low)[prd+1] then
$pl[z+1] = low[prd]
$plx[z+1] = barindex[prd]
z = z + 1
endif
//------------Pivots high------------------------------------//
if high < high[prd] and highest[prd](high)<high[prd] and high[prd]>highest[prd](high)[prd+1] then
$ph[t+1]=high[prd]
$phx[t+1]=barindex[prd]
t=t+1
endif
//----------Bearish Signal-----------------------------------//
bearishTriangle = isObDown and ((max(high, high[1]) > $ph[t] and close < $ph[t]) or (max(high, high[1]) > $ph[t][1] and close < $ph[t][1]))
//----------Bullish Signal-----------------------------------//
bullishTriangle = isObUp and ((min(low, low[1]) < $pl[z] and close > $pl[z]) or (min(low, low[1]) < $pl[z][1] and close > $pl[z][1]))
//----------Draw Signals-------------------------------------//
if bullishTriangle then
drawtext("▲",barindex,low-tr)coloured("green")
elsif bearishTriangle then
drawtext("▼",barindex,high+tr)coloured("red")
endif
return //$pl[z] as "Pivot low", $ph[t] as "Pivot high"
////////////////////////////////////////////////////////////////
//PRC_Structural Breaks Screener
//version = 0
//19.03.24
//Iván González @ www.prorealcode.com
//Sharing ProRealTime knowledge
////////////////////////////////////////////////////////////////
//------------Inputs-----------------------------------------//
prd = 1 //pivot length
//------------Bullish and bearish conditions-----------------//
isObUp = close[1]<open[1] and close>open and close > high[1]
isObDown = close[1]>open[1] and close < open and close < low[1]
//------------Pivots low-------------------------------------//
if low > low[prd] and lowest[prd](low) > low[prd] and low[prd] < lowest[prd](low)[prd+1] then
$pl[z+1] = low[prd]
$plx[z+1] = barindex[prd]
z = z + 1
endif
//------------Pivots high------------------------------------//
if high < high[prd] and highest[prd](high)<high[prd] and high[prd]>highest[prd](high)[prd+1] then
$ph[t+1]=high[prd]
$phx[t+1]=barindex[prd]
t=t+1
endif
//----------Bearish Signal-----------------------------------//
bearishTriangle = isObDown and ((max(high, high[1]) > $ph[t] and close < $ph[t]) or (max(high, high[1]) > $ph[t][1] and close < $ph[t][1]))
//----------Bullish Signal-----------------------------------//
bullishTriangle = isObUp and ((min(low, low[1]) < $pl[z] and close > $pl[z]) or (min(low, low[1]) < $pl[z][1] and close > $pl[z][1]))
//----------Screener condition-------------------------------//
screener[bearishTriangle or bullishTriangle]