PunkChainer Levels PunkAlgo 3.0
PunkChainer Levels PunkAlgo 3.0
// FVG Module
showfvg = input.bool(false, "Show Smart MTF FVG", group = "🧊 FVG MTF Module")
changelvl = input.bool(true, "Move box levels with price touch", group='FVG MTF
Module')
changecolor = input.bool(true, "Change box color with price touch", group='FVG MTF
Module')
extend_r = input.bool(true, "Extend boxes to the right", group='FVG MTF Module')
plotLabel = input.bool(defval=false, title='Plot OB Label', inline='FVG label',
group='Style')
LabelColor = input.color(defval=color.gray, title='Color', inline='FVG label',
group='Style')
LabelSize = input.string(defval=size.tiny, title="Size", options=[size.huge,
size.large, size.small, size.tiny, size.auto, size.normal], inline='FVG label',
group='Style')
BullColor = input.color(defval=color.new(#00dbff, 90), title='Bullish FVG Color',
inline='Set Custom Color', group='Style')
BearColor = input.color(defval=color.new(#0c3299, 90), title='Bearish FVG Color',
inline='Set Custom Color', group='Style')
BullColorTested = input.color(defval=color.new(color.gray, 90), title='Tested
Bullish FVG Color', inline='Set Custom Color', group='Style')
BearColorTested = input.color(defval=color.new(color.gray, 90), title='Tested
Bearish FVG Color', inline='Set Custom Color', group='Style')
find_box(t) =>
var int x = na
var float _top = na
var float _bottom = na
var int _time = na
if barstate.isconfirmed
x := low[2] >= high ? -1 : low >= high[2] ? 1 : 0
_top := x > 0 ? low : x < 0 ? low[2] : 0
_bottom := x > 0 ? high[2] : x < 0 ? high : 0
_time := time - t * 60000 * 2
[_time, _top, _bottom, x]
if showfvg
if tf1 and timeframe.change("1")
create_box(_time1, _top1, _bottom1, xtf1, "1")
if tf2 and timeframe.change("3")
create_box(_time2, _top2, _bottom2, xtf2, "3")
if tf3 and timeframe.change("5")
create_box(_time3, _top3, _bottom3, xtf3, "5")
if tf4 and timeframe.change("15")
create_box(_time4, _top4, _bottom4, xtf4, "15")
if tf5 and timeframe.change("30")
create_box(_time5, _top5, _bottom5, xtf5, "30")
if tf6 and timeframe.change("45")
create_box(_time6, _top6, _bottom6, xtf6, "45")
if tf7 and timeframe.change("60")
create_box(_time7, _top7, _bottom7, xtf7, "60")
if tf8 and timeframe.change("120")
create_box(_time8, _top8, _bottom8, xtf8, "120")
if tf9 and timeframe.change("180")
create_box(_time9, _top9, _bottom9, xtf9, "180")
if tf10 and timeframe.change("240")
create_box(_time10, _top10, _bottom10, xtf10, "240")
if tf11 and timeframe.change("D")
create_box(_time11, _top11, _bottom11, xtf11, "D")
if tf12 and timeframe.change("W")
create_box(_time12, _top12, _bottom12, xtf12, "W")
control_box(bull_box, 1)
control_box(bear_box, -1)