Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=4
- study("", "", true)
- gapbar_perc = input(75, minval=25, title="Gap Bar Size (%)")
- gapbar = tr > (atr(14) * (gapbar_perc / 100))
- lookback = input(5)
- gap_true_above = low > high[2] and gapbar and hl2 >= highest(high, lookback)[1]
- gap_true_below = high < low[2] and gapbar and hl2 <= lowest(low, lookback)[1]
- barcolor(gap_true_above ? color.orange : na, title="Bull Gap Candle")
- barcolor(gap_true_below ? color.black : na, title="Bear Gap Candle")
- // Debug
- plot(highest(high, lookback)[1], "", color.blue, 10, transp = 70)
- plot(hl2, "", color.red)
- plotchar(hl2 >= highest(high, lookback)[1], "hlg", "•", location.top)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement