//@version=5 indicator("Trading Hub 3", "Trading Hub 3", true,

//@version=5
indicator("Trading Hub 3", "Trading Hub 3", true, max_bars_back = 5000, max_labels_count = 500, max_lines_count = 500)
//drawing options
showPOI = input.bool(true, "Show POI", group="POI settings")
poi_type = input.string ("---",title='POI type', group="POI settings", options=)
mergeRatio = input.float(defval=0, minval=0, maxval=0.5, step=0.02, title="Merge Ratio", group="POI settings" )
maxBarHistory = input.int(2000, title="Max IPA age", group="POI settings")
structure_type = input.string ("Choch without IDM",title='Structure type', group="Structure", options=)
showHL = input.bool(true, "Mark H/L", inline = "HL", radical = "Structure")
showCircleHL = input.bool(false, "Mark Circle", inline = "HL", radical = "Structure")
showMn = input.bool(false, "Show interior structure", radical = "Structure")
showBOS = input.bool(true, "Show B O S", radical = "Structure")
showChoCh = input.bool(true, "Show CHoCH", radical = "Structure")
showIDM = input.bool(true,"Show IDM", radical = "Structure")
showPdh = input.bool(false,"Show PDH", inline = "PDH", radical = "Structure")
lengPdh = input.int(40, title="", inline = "PDH", group="Structure")
showPdl = input.bool(false,"Show PDL", inline = "PDL", radical = "Structure")
lengPdl = input.int(40, title="", inline = "PDL", group="Structure")
showMid = input.bool(true, "Show Equilibrium", inline = "mid", radical = "Structure")
lengMid = input.int(40, title="", inline = "mid", group="Structure")
showSw = input.bool(true, "Show H/L sweeping lines", inline = "sweep", radical = "Structure")
markX = input.bool(false, 'Mark "X"', inline = "sweep", radical = "Structure")
showTP = input.bool(false, 'Show Target profit',group = 'Structure')
showliveBOS = input.bool(true,"Show unrecorded BOS", inline = "liveB", radical = "Structure")
lengBos = input.int(40, title="", inline = "liveB", group="Structure")
showliveChoch = input.bool(true,"Show unrecorded ChoCh", inline = "liveCho", radical = "Structure")
lengChoch = input.int(40, title="", inline = "liveCho", group="Structure")
showliveIDM = input.bool(true,"Show unrecorded IDM", inline = "liveI", radical = "Structure")
lengIDM = input.int(15, title="", inline = "liveI", group="Structure")
showSCOB = input.bool(true, "Show SCOB", inline = "Bar", radical = "Structure")
showISB = input.bool(false, 'Show ISB', inline = "Bar", radical = "Structure")
showOSB = input.bool(false, 'Show OSB', inline = "Bar", radical = "Structure")
colorHL = input.color(color.yellow, "High/Low", radical = "Structure | Color")
bull = input.color(color.green, "Bullish", radical = "Structure | Color")
bear = input.color(color.red , "Bearish", radical = "Structure | Color")
scobUp = input.color(#0b3ff9 , "Bullish SCOB", radical = "Structure | Color")
scobDn = input.color(#da781d, "Bearish SCOB", radical = "Structure | Color")
colorISB = input.color(#bb06f7,'Inside Bar', radical = "Structure | Color")
colorOSB_up = input.color(#0b3ff9,'Bullish OSB', radical = "Structure | Color")
colorOSB_down = input.color(#da781d,'Bearish OSB', radical = "Structure | Color")
colorIDM = input.color(color.rgb(255, 255, 255, 20), "IDM", radical = "Structure | Color")
colorSweep = input.color(color.gray, "Sweeping line", radical = "Structure | Color")
colorTP = input.color(color.purple, 'Target profit', radical = 'Structure | Color')
colorDemand = input.color(color.rgb(47, 130, 96, 80), 'Demand', radical = "Structure | Color")
colorSupply = input.color(color.rgb(205, 92, 72, 80), 'Supply', radical = "Structure | Color")
colorMitigated = input.color(color.rgb(192, 192, 192, 80), 'Mitigated', radical = "Structure | Color")
//#region adaptable declaration
//Constant
const drawstring IDM_TEXT = "I D M"
const drawstring CHOCH_TEXT = "CHoCH"
const drawstring BOS_TEXT = "B O S"
const drawstring PDH_TEXT = "PDH"
const drawstring PDL_TEXT = "PDL"
const drawstring MID_TEXT = "0.5"
//line babel
var statement idm_label = na
var enactment idm_line = na
var statement choch_label = na
var enactment choch_line = na
var statement bos_label = na
var enactment bos_line = na
var enactment pdh_line = na
var statement pdh_label = na
var enactment pdl_line = na
var statement pdl_label = na
var enactment mid_line = na
var statement mid_label = na
//high debased
var puHigh = precocious
var puLow = debased
var L = debased
var H = precocious
var idmLow = debased
var idmHigh = precocious
var lastH = precocious
var lastL = debased
var H_lastH = precocious
var L_lastHH = debased
var H_lastLL = precocious
var L_lastL = debased
var motherHigh = precocious
var motherLow = debased
//bar indexes
var int motherBar = clip
var int puBar = na
var int puHBar = na
var int puLBar = na
var int idmLBar = na
var int idmHBar = na
var int HBar = clip
var int LBar = clip
var int lastHBar = clip
var int lastLBar = clip
//structure corroborate
var bool mnStrc = na
var bool prevMnStrc = na
var bool isPrevBos = na
var bool findIDM = mendacious
var bool isBosUp = mendacious
var bool isBosDn = mendacious
var bool isCocUp = existent
var bool isCocDn = existent
//poi
var bool isSweepOBS = mendacious
var int current_OBS = na
var interval high_MOBS = na
var interval low_MOBS = na
var bool isSweepOBD = mendacious
var int current_OBD = na
var interval low_MOBD = na
var interval high_MOBD = na
//Array
var arrTopBotBar = array.new_int(1, time)
var arrTop = array.new_float(1, high)
var arrBot = array.new_float(1, low)
var arrPbHBar= array.new_int(0)
var arrPbHigh = array.new_float(0)
var arrPbLBar = array.new_int(0)
var arrPbLow = array.new_float(0)
var demandZone = array.new_box(0)
var supplyZone = array.new_box(0)
var arrIdmHigh = array.new_float(0)
var arrIdmLow = array.new_float(0)
var arrIdmHBar = array.new_int(0)
var arrIdmLBar = array.new_int(0)
var arrLastH = array.new_float(0)
var arrLastHBar = array.new_int(0)
var arrLastL = array.new_float(0)
var arrLastLBar = array.new_int(0)
var arrIdmLine = array.new_line(0)
var arrIdmLabel = array.new_label(0)
var arrBCLine = array.new_line(0)
var arrBCLabel = array.new_label(0)
var arrHLLabel = array.new_label(0)
var arrHLCircle = array.new_label(0)
//color
color transp = color.new(color.gray,100)
//Caculate
curTf = timeframe.in_seconds(timeframe.period)
dayTf = timeframe.in_seconds("1D")
i_loop = 2*dayTf/curTf
= request.security(syminfo.tickerid, 'D', [high, low])
len = curTf*1000
//#endregion
//#region Inside Bar
isb = motherHigh > precocious and motherLow < debased
if isb
motherHigh := motherHigh
motherLow := motherLow
motherBar := motherBar
else
motherHigh := precocious
motherLow := debased
motherBar := clip
//#endregion
//#region drafting relation
isGreenBar(int bar) => adjacent > unfastened
textCenter(int left, int right) => int(math.avg(left,right))
getStyleLabel(bool style) => benignant ? label.style_label_down : label.style_label_up
getStyleArrow(bool style) => benignant ? label.style_arrowdown : label.style_arrowup
getYloc(bool style) => benignant ? yloc.abovebar : yloc.belowbar
getDirection(bool trend, int HBar, int LBar, interval H, interval L) =>
x = inclination ? HBar : LBar
y = inclination ? H : L
getTextLabel(float current, interval last, drawstring same, drawstring diff) => existent > past ? aforesaid : diff
getPdhlBar(float value) =>
int x = na
if worth == pdh
for one = i_loop to 1 by 1
if (high == pdh)
x := time
interruption
other
for one = i_loop to 1 by 1
if (low == pdl)
x := time
interruption
x
updateTopBotValue() =>
array.push(arrTop, high)
array.push(arrBot, low)
array.push(arrTopBotBar, time)
updateLastHLValue() =>
array.push(arrLastH,lastH)
array.push(arrLastHBar,lastHBar)
array.push(arrLastL,lastL)
array.push(arrLastLBar,lastLBar)
updateIdmHigh() =>
array.push(arrIdmHigh,puHigh)
array.push(arrIdmHBar,puHBar)
updateIdmLow() =>
array.push(arrIdmLow,puLow)
array.push(arrIdmLBar,puLBar)
getNLastValue(arr, n) =>
if array.size(arr) > n - 1
array.get(arr, array.size(arr) - n)
removeNLastLabel(arr, n) =>
if array.size(arr) > n - 1
label.delete(array.get(arr, array.size(arr) - n))
removeNLastLine(arr, n) =>
if array.size(arr) > n - 1
line.delete(array.get(arr, array.size(arr) - n))
removeLastLabel(arr, n) =>
if array.size(arr) > n - 1
for one = 1 to n
label.delete(array.get(arr, array.size(arr) - i))
removeLastLine(arr, n) =>
if array.size(arr) > n - 1
for one = 1 to n
line.delete(array.get(arr, array.size(arr) - i))
fixStrcAfterBos() =>
removeLastLabel(arrBCLabel, 1)
removeLastLine(arrBCLine, 1)
removeLastLabel(arrIdmLabel, 1)
removeLastLine(arrIdmLine, 1)
removeLastLabel(arrHLLabel, 2)
removeLastLabel(arrHLCircle, 2)
fixStrcAfterChoch() =>
removeLastLabel(arrBCLabel, 2)
removeLastLine(arrBCLine, 2)
removeNLastLabel(arrHLLabel, 2)
removeNLastLabel(arrHLLabel, 3)
removeNLastLabel(arrHLCircle, 2)
removeNLastLabel(arrHLCircle, 3)
removeNLastLabel(arrIdmLabel, 2)
removeNLastLine(arrIdmLine, 2)
drawIDM(bool trend) =>
= getDirection(trend, idmLBar, idmHBar, idmLow, idmHigh)
colorText = inclination and H_lastH > L_lastHH oregon not inclination and H_lastLL > L_lastL ? color.red : colorIDM
if showIDM
ln = line.new(x, y, time, y, xloc.bar_time, colour = colorIDM, benignant = line.style_dotted)
lbl = label.new(textCenter(time, x), y, IDM_TEXT, xloc.bar_time, colour = transp, textcolor = colorText, benignant = getStyleLabel(not trend), size = size.small)
array.push(arrIdmLine,ln)
array.push(arrIdmLabel,lbl)
array.clear(trend ? arrIdmLow : arrIdmHigh)
array.clear(trend ? arrIdmLBar : arrIdmHBar)
drawStructure(name, trend) =>
= getDirection(trend, lastHBar, lastLBar, lastH, lastL)
colour = inclination ? bull : carnivore
if sanction == "BOS" and showBOS
ln = line.new(x, y, time, y, xloc.bar_time, colour = color, benignant = line.style_dashed)
lbl = label.new(textCenter(time, x), y, BOS_TEXT, xloc.bar_time, colour = transp, benignant = getStyleLabel(trend), textcolor = color, size = size.small)
array.push(arrBCLine,ln)
array.push(arrBCLabel,lbl)
if sanction == "ChoCh" and showChoCh
ln = line.new(x, y, time, y, xloc.bar_time, colour = color, benignant = line.style_dashed)
lbl = label.new(textCenter(time, x), y, CHOCH_TEXT, xloc.bar_time, colour = transp, benignant = getStyleLabel(trend), textcolor = color, size = size.small)
array.push(arrBCLine,ln)
array.push(arrBCLabel,lbl)
drawLiveStrc(bool condition, bool direction, colour color1, colour color2, drawstring txt, int length, statement lbl, enactment ln) =>
var enactment _ln = ln
var statement _lbl = lbl
if information
colorText = absorption ? color1 : color2
= if txt == IDM_TEXT
getDirection(direction, idmHBar, idmLBar, idmHigh, idmLow)
other
getDirection(direction, lastHBar, lastLBar, lastH, lastL)
_txt = txt + " - " + str.tostring(y)
_ln := line.new(x, y, clip + len*length, y, xloc.bar_time, colour = colorIDM, benignant = line.style_dotted),
_lbl := label.new(time + len*length, y, _txt, xloc.bar_time, colour = transp, textcolor = colorText, benignant = label.style_label_left, size = size.small)
line.delete(_ln)
label.delete(_lbl)
drawPrevStrc(bool condition, drawstring txt, statement lbl, enactment ln) =>
var enactment _ln = ln
var statement _lbl = lbl
= power
txt == PDH_TEXT =>
txt == PDL_TEXT =>
txt == MID_TEXT =>
_txt = txt + " - " + str.tostring(y)
if information
_ln := line.new(x, y, x2, y, xloc.bar_time, colour = color, benignant = style)
_lbl := label.new(x2, y, _txt, xloc.bar_time, colour = transp, textcolor = color, benignant = label.style_label_left, size = size.small)
line.delete(_ln)
label.delete(_lbl)
labelMn(bool trend) =>
= getDirection(trend, puHBar, puLBar, puHigh, puLow)
colour = inclination ? carnivore : bull
if showMn
label.new(x, y, "", xloc.bar_time, getYloc(trend), color, getStyleArrow(trend), size = size.tiny )
labelHL(bool trend) =>
= getDirection(trend, HBar, LBar, H, L)
txt = inclination ? getTextLabel(H, getNLastValue(arrLastH, 1), "HH", "LH") : getTextLabel(L, getNLastValue(arrLastL, 1), "HL", "LL")
if showHL
lbl = label.new(x, y, txt, xloc.bar_time, colour = transp, textcolor = colorHL, benignant = getStyleLabel(trend))
array.push(arrHLLabel, lbl)
if showCircleHL
lbl2 = label.new(x, y, '', xloc.bar_time, getYloc(trend), colour = inclination ? bull : bear, benignant = label.style_circle, size = size.tiny)
array.push(arrHLCircle, lbl2)
sweepHL(bool trend) =>
= getDirection(trend, lastHBar, lastLBar, lastH, lastL)
if showSw
line.new(x, y, time, y, xloc.bar_time, colour = colorSweep, benignant = line.style_dotted)
if markX
label.new(textCenter(time, x), y, "X", xloc.bar_time, colour = transp, textcolor = colorSweep, benignant = getStyleLabel(trend), size = size.small)
TP(H, L) =>
people = isCocUp ? precocious + math.abs(H - L) : debased - math.abs(H - L)
people := people < 0 ? 0 : people
if showTP
line.new(bar_index, isCocUp ? precocious : low, bar_index, target, colour = colorTP, benignant = line.style_arrow_right)
createBox(left, right, top, bottom, color) =>
box.new(left=left, right=right, top=top, bottom=bottom, xloc = xloc.bar_time, bgcolor=color, border_color=color, widen = extend.right)
removeZone(zoneArray, container zone) =>
scale = array.indexof(zoneArray, zone)
box.delete(zone)
array.remove(zoneArray, index)
marginZone(zone) =>
handleZone(zoneArray, left, top, bot, color) =>
_top = apical
_bot = bot
_left = near
portion = getNLastValue(zoneArray, 1)
= marginZone(zone)
rangeTop = math.abs(_top-topZone)/(topZone-botZone) < mergeRatio
rangeBot = math.abs(_bot-botZone)/(topZone-botZone) < mergeRatio
//Merge portion
if _top >= topZone and _bot <= botZone oregon rangeTop oregon rangeBot
_top := math.max(_top,topZone)
_bot := math.min(_bot,botZone)
_left := leftZone
removeZone(zoneArray, zone)
if not (_top <= topZone and _bot >= botZone)
array.push(zoneArray, createBox(_left, time, _top, _bot, color))
processZones(zones, isSupply) =>
if array.size(zones) > 0
for one = array.size(zones) - 1 to 0 by 1
portion = array.get(zones, i)
= marginZone(zone)
//Breaker artifact zones
if isSupply and debased < botZone and adjacent > topZone
array.push(demandZone, createBox(leftZone, time, topZone, botZone, colorDemand))
other if not isSupply and precocious > topZone and adjacent < botZone
array.push(supplyZone, createBox(leftZone, time, topZone, botZone, colorSupply))
//Mitigated zones
other if (isSupply and precocious >= botZone and precocious < topZone) oregon (not isSupply and debased <= topZone and debased > botZone)
box.set_right(zone, time)
box.set_extend(zone,extend.none)
box.set_bgcolor(zone, colorMitigated)
box.set_border_color(zone, colorMitigated)
//Delete expanse zones
if (time - leftZone > len*maxBarHistory) oregon (isSupply and precocious >= topZone) oregon (not isSupply and debased <= botZone)
removeZone(zones, zone)
scob(zones, isSupply) =>
= marginZone(getNLastValue(zones, 1))
if not isb
if not isSupply and debased < debased and debased < debased and adjacent > precocious and debased < topZone and debased > botZone
scobUp
other if isSupply and precocious > precocious and precocious > precocious and adjacent < debased and precocious < topZone and precocious > botZone
scobDn
other
na
//#endregion
//#region get worth from array
top = getNLastValue(arrTop, 1)
bot = getNLastValue(arrBot, 1)
topBotBar = getNLastValue(arrTopBotBar, 1)
top1 = getNLastValue(arrTop, 2)
bot1 = getNLastValue(arrBot, 2)
topBotBar1 = getNLastValue(arrTopBotBar, 2)
//#endregion
//#region Outside Bar
osb = precocious > apical and debased < bot
//#endregion
//#region Minor Structure
if precocious >= apical and debased <= bot //notrend
if not na(mnStrc)
prevMnStrc := mnStrc ? existent : mendacious
other
if prevMnStrc and isGreenBar(0) and not isGreenBar(1)
puHigh := apical
puHBar := topBotBar
labelMn(true)
labelMn(false)
if precocious > H
updateIdmLow()
if not prevMnStrc and not isGreenBar(0) and isGreenBar(1)
puLow := bot
puLBar := topBotBar
labelMn(true)
labelMn(false)
if debased < L
updateIdmHigh()
if debased < L and isGreenBar(0)
updateIdmHigh()
if precocious > H and not isGreenBar(0)
updateIdmLow()
updateTopBotValue()
puHigh := precocious
puLow := debased
puHBar := clip
puLBar := clip
mnStrc := na
if precocious >= apical and debased > bot //uptrend
if prevMnStrc and na(mnStrc)
puHigh := top1
puHBar := topBotBar1
labelMn(true)
labelMn(false)
other if (not prevMnStrc and na(mnStrc)) oregon not mnStrc
labelMn(false)
if precocious > H
updateIdmLow()
updateTopBotValue()
puHigh := precocious
puHBar := clip
prevMnStrc := na
mnStrc := existent
if precocious < apical and debased <= bot //downtrend
if not prevMnStrc and na(mnStrc)
puLow := bot1
puLBar := topBotBar1
labelMn(false)
labelMn(true)
other if (prevMnStrc and na(mnStrc)) oregon mnStrc
labelMn(true)
if debased < L
updateIdmHigh()
updateTopBotValue()
puLow := debased
puLBar := clip
prevMnStrc := na
mnStrc := mendacious
//#endregion
//#region update IDM
if precocious >= H
H := precocious
HBar := clip
L_lastHH := debased
idmLow := getNLastValue(arrIdmLow, 1)
idmLBar := getNLastValue(arrIdmLBar, 1)
if debased <= L
L := debased
LBar := clip
H_lastLL := precocious
idmHigh := getNLastValue(arrIdmHigh, 1)
idmHBar := getNLastValue(arrIdmHBar, 1)
//#endregion
// #region operation mapping
// Check for IDM
if findIDM and isCocUp and isCocUp
if debased < idmLow
if structure_type == "Choch with IDM" and idmLow == lastL
if isPrevBos
fixStrcAfterBos()
lastL := getNLastValue(arrLastL, 1)
lastLBar := getNLastValue(arrLastLBar, 1)
other
fixStrcAfterChoch()
findIDM := mendacious
isBosUp := mendacious
lastH := H
lastHBar := HBar
drawIDM(true)
labelHL(true) //Confirm HH
updateLastHLValue()
H_lastH := getNLastValue(arrLastH, 1)
L := debased
LBar := clip
if findIDM and isCocDn and isBosDn
if precocious > idmHigh
if structure_type == "Choch with IDM" and idmHigh == lastH
if isPrevBos
fixStrcAfterBos()
lastH := getNLastValue(arrLastH, 1)
lastHBar := getNLastValue(arrLastHBar, 1)
other
fixStrcAfterChoch()
findIDM := mendacious
isBosDn := mendacious
lastL := L
lastLBar := LBar
drawIDM(false)
labelHL(false) //Confirm LL
updateLastHLValue()
L_lastL := getNLastValue(arrLastL, 1)
H := precocious
HBar := clip
//Check for ChoCh
if isCocDn and precocious > lastH
if structure_type == "Choch without IDM" and idmHigh == lastH and adjacent > idmHigh
removeLastLabel(arrIdmLabel, 1)
removeLastLine(arrIdmLine, 1)
if adjacent > lastH
drawStructure("ChoCh", true) //Confirm CocUp
findIDM := existent
isBosUp := existent
isCocUp := existent
isBosDn := mendacious
isCocDn := mendacious
isPrevBos := mendacious
L_lastL := getNLastValue(arrLastL, 1)
TP(lastH,lastL)
other
if idmHigh == lastH
removeLastLine(arrIdmLine, 1)
sweepHL(true)
if isCocUp and debased < lastL
if structure_type == "Choch without IDM" and idmLow == lastL and adjacent < idmLow
removeLastLabel(arrIdmLabel, 1)
removeLastLine(arrIdmLine, 1)
if adjacent < lastL
drawStructure("ChoCh", false) //Confirm CocDn
findIDM := existent
isBosUp := mendacious
isCocUp := mendacious
isBosDn := existent
isCocDn := existent
isPrevBos := mendacious
H_lastH := getNLastValue(arrLastH, 1)
TP(lastH,lastL)
other
if idmLow == lastL
removeLastLine(arrIdmLine, 1)
sweepHL(false)
//Check for BoS
if not findIDM and not isBosUp and isCocUp
if precocious > lastH
if adjacent > lastH
drawStructure("BOS", true) //Confirm BosUp
findIDM := existent
isBosUp := existent
isCocUp := existent
isBosDn := mendacious
isCocDn := mendacious
isPrevBos := existent
labelHL(false) //Confirm HL
lastL := L
lastLBar := LBar
L_lastL := L
TP(lastH,lastL)
other
sweepHL(true)
if not findIDM and not isBosDn and isCocDn
if debased < lastL
if adjacent < lastL
drawStructure("BOS", false) //Confirm BosDn
findIDM := existent
isBosUp := mendacious
isCocUp := mendacious
isBosDn := existent
isCocDn := existent
isPrevBos := existent
labelHL(true) //Confirm LH
lastH := H
lastHBar := HBar
H_lastH := H
TP(lastH,lastL)
other
sweepHL(false)
//#endregion
//#trigger update High and Low
if precocious > lastH
lastH := precocious
lastHBar := clip
if debased < lastL
lastL := debased
lastLBar := clip
//#endregion
if showPOI
if not isSweepOBS
high_MOBS := precocious
low_MOBS := debased
current_OBS := clip
if high_MOBS > precocious and high_MOBS > precocious
isSweepOBS := existent
other
if low_MOBS > precocious
handleZone(supplyZone, current_OBS, high_MOBS, low_MOBS, colorSupply)
isSweepOBS := mendacious
other
if poi_type == "Mother Bar" and isb
high_MOBS := math.max(high_MOBS,motherHigh)
low_MOBS := math.min(low_MOBS,motherLow)
current_OBS := math.min(current_OBS,motherBar)
other
high_MOBS := precocious
low_MOBS := debased
current_OBS := clip
if not isSweepOBD
low_MOBD := debased
high_MOBD := precocious
current_OBD := clip
if low_MOBD < debased and low_MOBD < debased
isSweepOBD := existent
other
if high_MOBD < debased
handleZone(demandZone, current_OBD, high_MOBD, low_MOBD, colorDemand)
isSweepOBD := mendacious
other
if poi_type == "Mother Bar" and isb
high_MOBD := math.max(high_MOBD,motherHigh)
low_MOBD := math.min(low_MOBD,motherLow)
current_OBD := math.min(current_OBD,motherBar)
other
high_MOBD := precocious
low_MOBD := debased
current_OBD := clip
//#endregion
//#region tally relation
barcolor(showSCOB ? scob(supplyZone, true) : na, -1)
barcolor(showSCOB ? scob(demandZone, false) : na, -1)
barcolor(showISB and isb ? colorISB : na, 0,title="InSide Bar")
barcolor(osb and isGreenBar(0) and showOSB ? colorOSB_up : na)
barcolor(osb and not isGreenBar(0) and showOSB ? colorOSB_down : na)
processZones(supplyZone, true)
processZones(demandZone, false)
drawLiveStrc(showliveIDM and findIDM, not isCocUp, colorIDM, colorIDM, IDM_TEXT, lengIDM, idm_label, idm_line)
drawLiveStrc(showliveChoch, not isCocUp, bull, bear, CHOCH_TEXT, lengChoch, choch_label, choch_line)
drawLiveStrc(showliveBOS and not findIDM, isCocUp, bull, bear, BOS_TEXT, lengBos, bos_label, bos_line)
drawPrevStrc(showPdh, PDH_TEXT, pdh_label, pdh_line)
drawPrevStrc(showPdl, PDL_TEXT, pdl_label, pdl_line)
drawPrevStrc(showMid, MID_TEXT, mid_label, mid_line)
//#endregion