You are on page 1of 2

instrument {

name = 'TARGET GAP 2023',


icon = 'indicators:MA',
overlay = true
}

barBack = input(100, "Candle Back", input.integer,1)


width = input(0.8, "Width", input.double, 0.1)

input_group{
"Bull color",
colorUp = input { default = rgba(64, 152, 252, 0.7), type =
input.color},
colorUpLine = input { default = rgba(64, 152, 252, 0.3), type =
input.color},
visibleLineBull = input { default = true, type = input.plot_visibility},
}

input_group{
"Bear color",
colorDn = input { default = rgba(255, 20, 147, 0.7), type =
input.color},
colorDnLine = input { default = rgba(255, 20, 147, 0.3), type =
input.color},
visibleLineBear = input { default = true, type = input.plot_visibility},
}

bullish = iff(close[1] > open[1] and close > open and high[2] < low, true, false)
bearish = iff(close[1] < open[1] and close < open and low[2] > high, true, false)

if bullish == true then


rect(high[2], low, "bullish",colorUp, width )

end

if bearish == true then


rect(low[2], high, "bearish",colorDn, width )

end

if visibleLineBull == true then


for i = 0, barBack, 1 do
lineBullish = iff(close[i+1] > open[i+1] and close[i] > open[i] and
high[i+2] < low[i], get_value(low[i]), false)
hline(lineBullish, i.."Bullish_L", colorUpLine, 1, 0, style.levels, true )
end

end

if visibleLineBear == true then


for i = 0, barBack, 1 do
lineBearish = iff(close[i+1] < open[i+1] and close[i] < open[i] and
low[i+2] > high[i], get_value( high[i]), false)
hline(lineBearish, i.."Bearish_H", colorDnLine, 1, 0, style.levels, true )
end
end

You might also like