2B Reversal Pattern Indicator

Category: Indicators By: Iván González Created: July 12, 2024, 5:08 PM
July 12, 2024, 5:08 PM
Indicators
1 Comment

The “2B Reversal Pattern” indicator, developed by Zeiierman, is a powerful tool for detecting reversal patterns in the market. This indicator is based on the 2B reversal theory, popularized by trader Victor Sperandeo.

The 2B Reversal Pattern is useful for identifying potential trend changes and can be applied across various timeframes to improve the accuracy of trading entries and exits.

Description of the 2B Reversal Pattern Indicator

The 2B Reversal Pattern relies on identifying false breakouts at support or resistance levels.

The logic behind this pattern is that when the price attempts to break a significant level but fails to maintain it, a reversal is likely to occur. This indicator automates the detection of these patterns, providing clear visual signals on the chart.

Pivot Point Calculation

To calculate pivot points, the indicator analyzes a defined range of bars (prd parameter). It identifies high (ph) and low (pl) pivots based on specific conditions:

  • Low Pivots: Identified when the lowest price (src1) is lower than in the previous and following bars within the defined range.
  • High Pivots: Identified when the highest price (src2) is higher than in the previous and following bars within the defined range.
if src1 > src1[prd] and lowest[prd](src1) > src1[prd] and src1[prd] < lowest[prd](src1)[prd+1] then
    pl = low[prd]
    plL = barindex[prd]
    drawpoint(barindex[prd],low[prd],2)coloured("red",90)
endif

if src2 < src2[prd] and highest[prd](src2) < src2[prd] and src2[prd] > highest[prd](src2)[prd+1] then
    ph = high[prd]
    phL = barindex[prd]
    drawpoint(barindex[prd],high[prd],2)coloured("blue",90)
endif

Pattern Detection

The indicator not only identifies pivots but also detects and confirms false breakouts:

  • Down Breakout: Confirmed when the close crosses below the high pivot (ph).
  • Up Breakout: Confirmed when the close crosses above the low pivot (pl).

Additionally, the indicator uses the average true range (atr) to add segments and text to the chart, providing a clear visual signal of the reversal.

if close crosses under bomin and barindex - bominL <= maxi and barindex - bominL >= mini then
    drawsegment(bominL, bomin, barindex, bomin) coloured(242, 54, 69) style(line, 2)
    drawtext("▼", barindex, high + atr * 0.5) coloured(242, 54, 69)
    bomin = 0
endif

if close crosses over bomax and barindex - bomaxL <= maxi and barindex - bomaxL >= mini then
    drawsegment(bomaxL, bomax, barindex, bomax) coloured(108, 229, 160) style(line, 2)
    drawtext("▲", barindex, low - atr * 0.5) coloured(108, 229, 160)
    bomax = 0
endif

Indicator Configuration

The 2B Reversal Pattern indicator comes with default parameters that can be adjusted to fit different trading strategies:

  • prd: Period for pivot calculation (default: 20).
  • maxi: Maximum number of bars to confirm the breakout (default: 15).
  • mini: Minimum number of bars to confirm the breakout (default: 3).

These parameters allow traders to customize the indicator’s sensitivity according to their needs.

Conclusion

The “2B Reversal Pattern” indicator is a valuable tool for any trader looking to detect and capitalize on reversal patterns in the market. Its ability to identify false breakouts and provide clear visual signals makes it ideal for improving accuracy in trading decisions. By adjusting its parameters, traders can tailor this indicator to their specific strategies and preferred timeframes.

//-------------------------------------------------------------------//
//PRC_2B Reversarl Pattern
//version = 0
//27.06.2024
//Iván González @ www.prorealcode.com
//Sharing ProRealTime knowledge
//-------------------------------------------------------------------//
//-----Inputs--------------------------------------------------------//
prd=20
maxi=10
mini=3
src1 = low
src2 = high
//-------------------------------------------------------------------//
//-----Pivot Point Calculation---------------------------------------//
//-----pivots low
if src1 > src1[prd] and lowest[prd](src1) > src1[prd] and src1[prd] < lowest[prd](src1)[prd+1] then
pl=low[prd]
plL=barindex[prd]
drawpoint(barindex[prd],low[prd],2)coloured("red",90)
endif
//-----pivots high
if src2 < src2[prd] and highest[prd](src2)<src2[prd] and src2[prd]>highest[prd](src2)[prd+1] then
ph=high[prd]
phL=barindex[prd]
drawpoint(barindex[prd],high[prd],2)coloured("blue",90)
endif
//-------------------------------------------------------------------//
//-----Pattern Detection---------------------------------------------//
//-----Calculate price level to check breakout down
if close crosses over ph then
bomin=low
bominL=barindex
drawsegment(phL,ph,bominL,ph)style(dottedline)
drawpoint(phL,ph,1)coloured("white")
ph=undefined
endif
//-----Calculate price level to check breakout up
if close crosses under pl then
bomax=high
bomaxL=barindex
drawsegment(plL,pl,bomaxL,pl)style(dottedline)
drawpoint(plL,pl,1)coloured("white")
pl=undefined
endif
//-----Breakout down confirmation
atr=averagetruerange[14](close)
if close crosses under bomin and barindex-bominL<=maxi and barindex-bominL>=mini then
drawsegment(bominL,bomin,barindex,bomin)coloured(242,54,69)style(line,2)
drawtext("▼",barindex,high+atr*0.5)coloured(242,54,69)
bomin=0
endif
//-----Breakout up confirmation
if close crosses over bomax and barindex-bomaxL<=maxi and barindex-bomaxL>=mini then
drawsegment(bomaxL,bomax,barindex,bomax)coloured(108,229,160)style(line,2)
drawtext("▲",barindex,low-atr*0.5)coloured(108,229,160)
bomax=0
endif
//-----Restart price level y cross is to late/soon
if close crosses over bomax then
bomax=0
elsif close crosses under bomin then
bomin=0
endif
//-------------------------------------------------------------------//
return

Download
Filename: PRC_2B-Reversal-Pattern.itf
Downloads: 242
Iván González Master
Code artist, my biography is a blank page waiting to be scripted. Imagine a bio so awesome it hasn't been coded yet.
Author’s Profile

Comments

Logo Logo
Loading...