I have Order Blocks and FVG code in Pine Script V5, how to modify the code to detect, the overlapping of Order Block and FVG, when happens?

I have a code shown below to detect and plot Bullish Order Blocks, Bearish Order Blocks and Fair Value Gap. Now the code to be modified for detecting and plot circles, whenever Order Blocks and FVG are overlapping every time in the chart. Green Circle plot when Bullish Order Blocks overlapping with FVG and Vice versa with Red Circle plotted [Bearish OB with FVG][Bullish OB with FVG].

I have tried many ways to get this done, but not coming through.

Code:

//------------------------------------------------------------------------------
// Settings
//------------------------------------------------------------------------------
length   = input.int(10, 'Swing Lookback', minval = 3)
showBull = input.int(3, 'Show Last Bullish OB', minval = 0)
showBear = input.int(3, 'Show Last Bearish OB', minval = 0)
useBody  = input(false, 'Use Candle Body')

// Style
bullCss      = input.color(color.new(#2157f3, 80), 'Bullish OB', inline = 'bullcss', group = 'Style')
bullBreakCss = input.color(color.new(#ff1100, 80), 'Bullish Break', inline = 'bullcss', group = 'Style')

bearCss      = input.color(color.new(#ff5d00, 80), 'Bearish OB', inline = 'bearcss', group = 'Style')
bearBreakCss = input.color(color.new(#0cb51a, 80), 'Bearish Break', inline = 'bearcss', group = 'Style')

showLabels = input(false, 'Show Historical Polarity Changes')

// Entry style
entryLabelColor = input.color(color.white, "Entry Label Color")
shortEntryColor = input.color(color.red, "Short Entry Color")
longEntryColor = input.color(color.green, "Long Entry Color")

//-----------------------------------------------------------------------------
// UDT's
//-----------------------------------------------------------------------------
var float bullishObTop = na
var float bullishObBottom = na
var int bullishObTime = na
var bool bullishBreaker = false
var int bullishBreakerTime = na

var float bearishObTop = na
var float bearishObBottom = na
var int bearishObTime = na
var bool bearishBreaker = false
var int bearishBreakerTime = na

//-----------------------------------------------------------------------------
// Functions
//-----------------------------------------------------------------------------
swings(len) =>
    var os = 0
    var float top = na
    var float bottom = na
    var int topIndex = na
    var int bottomIndex = na

    upper = ta.highest(len)
    lower = ta.lowest(len)

    os := high[len] > upper ? 0 : low[len] < lower ? 1 : os

    if os == 0 and os[1] != 0
        top := high[len]
        topIndex := bar_index[len]

    if os == 1 and os[1] != 1
        bottom := low[len]
        bottomIndex := bar_index[len]

    [top, topIndex, bottom, bottomIndex]

notransp(css) => color.rgb(color.r(css), color.g(css), color.b(css))

display(loc, top, bottom, breaker, breakerTime, css, breakCss) =>
    if breaker
        box.new(loc, top, breakerTime, bottom, notransp(css)
          , bgcolor = css
          , xloc = xloc.bar_time)

         box.new(breakerTime, top, time+1, bottom, na
          , bgcolor = breakCss
          , extend = extend.right
          , xloc = xloc.bar_time)
    
        line.new(loc, top, breakerTime, top, xloc.bar_time, color = notransp(css))
        line.new(loc, bottom, breakerTime, bottom, xloc.bar_time, color = notransp(css))
        line.new(breakerTime, top, time+1, top, xloc.bar_time, extend.right, notransp(breakCss), line.style_dashed)
        line.new(breakerTime, bottom, time+1, bottom, xloc.bar_time, extend.right, notransp(breakCss), line.style_dashed)
    else
        box.new(loc, top, time, bottom, na
          , bgcolor = css
          , extend = extend.right
          , xloc = xloc.bar_time)
    
        line.new(loc, top, time, top, xloc.bar_time, extend.right, notransp(css))
        line.new(loc, bottom, time, bottom, xloc.bar_time, extend.right, notransp(css))

//-----------------------------------------------------------------------------
// Detect Swings
//-----------------------------------------------------------------------------
[top, topIndex, bottom, bottomIndex] = swings(length)
max = useBody ? math.max(close, open) : high
min = useBody ? math.min(close, open) : low

//-----------------------------------------------------------------------------
// Bullish OB
//-----------------------------------------------------------------------------
if not na(top) and close > top
    minima = max[1]
    maxima = min[1]
    loc = time[1]

    for i = 1 to length-1
        minima := math.min(min[i], minima)
        maxima := minima == min[i] ? max[i] : maxima
        loc := minima == min[i] ? time[i] : loc

    bullishObTop := maxima
    bullishObBottom := minima
    bullishObTime := loc
    bullishBreaker := false
    bullishBreakerTime := na

if not na(bullishObTop)
    if close < bullishObBottom and not bullishBreaker
        bullishBreaker := true
        bullishBreakerTime := time

    if close > bullishObTop
        bullishObTop := na
        bullishObBottom := na
        bullishObTime := na
        bullishBreaker := false
        bullishBreakerTime := na

//-----------------------------------------------------------------------------
// Bearish OB
//-----------------------------------------------------------------------------
if not na(bottom) and close < bottom
    minima = min[1]
    maxima = max[1]
    loc = time[1]

    for i = 1 to length-1
        maxima := math.max(max[i], maxima)
        minima := maxima == max[i] ? min[i] : minima
        loc := maxima == max[i] ? time[i] : loc

    bearishObTop := maxima
    bearishObBottom := minima
    bearishObTime := loc
    bearishBreaker := false
    bearishBreakerTime := na

if not na(bearishObTop)
    if close > bearishObTop and not bearishBreaker
        bearishBreaker := true
        bearishBreakerTime := time

    if close < bearishObBottom
        bearishObTop := na
        bearishObBottom := na
        bearishObTime := na
        bearishBreaker := false
        bearishBreakerTime := na

//-----------------------------------------------------------------------------
// Check for OB and FVG overlap
//-----------------------------------------------------------------------------
fvg_found = false
for i = 1 to length - 1
    if (math.min(close[i], open[i]) < high[i+1] and math.max(close[i], open[i]) > low[i+1])
        fvg_found := true
        break

// Detect Long and Short Entries
if fvg_found
    if not na(bearishObBottom) and close < bearishObBottom
        label.new(bar_index, low, 'Short Entry', color=entryLabelColor, textcolor=shortEntryColor, style=label.style_circle, size=size.small)
    if not na(bullishObTop) and close > bullishObTop
        label.new(bar_index, high, 'Long Entry', color=entryLabelColor, textcolor=longEntryColor, style=label.style_circle, size=size.small)

//-----------------------------------------------------------------------------
// Set Order Blocks
//-----------------------------------------------------------------------------
for bx in box.all
    bx.delete()

for l in line.all
    l.delete()

if barstate.islast
    // Bullish
    if showBull > 0 and not na(bullishObTop)
        display(bullishObTime, bullishObTop, bullishObBottom, bullishBreaker, bullishBreakerTime, bullCss, bullBreakCss)

    // Bearish
    if showBear > 0 and not na(bearishObTop)
        display(bearishObTime, bearishObTop, bearishObBottom, bearishBreaker, bearishBreakerTime, bearCss, bearBreakCss)

// Debugging labels
if not na(bullishObTop)
    label.new(bullishObTime, bullishObTop, 'Bullish OB', color=color.white, textcolor=color.green)
if not na(bearishObTop)
    label.new(bearishObTime, bearishObTop, 'Bearish OB', color=color.white, textcolor=color.red)

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật