indicator · on price · open source
Premium Array (OB Cluster)
Running…
Loading chart…
About
Premium Array stacks the top boundaries of recent bearish order blocks above the current price. A dense cluster of equal-priced OBs is a high-probability short zone.
- Plot the most recent
maxObsbearish OB tops. - Use with an OB-touched signal for premium shorts.
- Cluster of 3+ OBs in a tight band = the institutional short zone.
Source code
//@version=5
indicator("Premium Array (OB Cluster)", overlay=true)
swing = input.int(5, "Swing Length", minval=2, maxval=50)
maxObs = input.int(5, "Max OBs", minval=1, maxval=10)
lookback = input.int(30, "OB Lookback", minval=5, maxval=100)
pl = ta.pivotlow(low, swing, swing)
var float lastPl = na
var float prevPl = na
var float ob1 = na
var float ob2 = na
var float ob3 = na
var float ob4 = na
var float ob5 = na
if not na(pl)
prevPl := lastPl
lastPl := pl
if not na(lastPl) and not na(prevPl) and lastPl < prevPl
found = false
for i = 1 to math.min(lookback, swing * 4)
if not found and close[i] > open[i]
ob5 := ob4
ob4 := ob3
ob3 := ob2
ob2 := ob1
ob1 := high[i]
found := true
break
p_Bear_OB_1 = plot(ob1, "Bear OB 1", color=color.red, style=plot.style_linebr)
p_Bear_OB_2 = plot(ob2, "Bear OB 2", color=color.maroon, style=plot.style_linebr)
p_Bear_OB_3 = plot(ob3, "Bear OB 3", color=color.maroon, style=plot.style_linebr)
p_Bear_OB_4 = plot(ob4, "Bear OB 4", color=color.maroon, style=plot.style_linebr)
p_Bear_OB_5 = plot(ob5, "Bear OB 5", color=color.maroon, style=plot.style_linebr)
alertcondition(not na(ob1) and na(ob1[1]), "New bearish OB added", "Bearish OB added to premium array")
No comments yet.
Sign in to comment.