indicator · on price · open source
Discount Array (OB Cluster) indicator
Discount Array (OB Cluster) is a free open-source indicator by @deepwick. Discount Array stacks the bottom boundaries of recent bullish order blocks below the… Deepwick Script runs a subset of Pine Script.
Running…
Loading chart…
What Discount Array (OB Cluster) does
Discount Array stacks the bottom boundaries of recent bullish order blocks below the current price. Mirror of the premium array.
- Plot the most recent
maxObsbullish OB bottoms. - A cluster of OBs in a tight band = the institutional long zone.
- Combine with a discount filter (price below 50% range) for highest-probability longs.
- Discount arrays are the canonical buy zone in an uptrend — price often returns to multiple stacked OBs before launching higher.
- Sweeping the top of the array and reclaiming = high-conviction trend continuation.
- Stacked discount arrays of 3+ OBs are the strongest demand reads.
- The most recent OB is plotted with thicker line weight so it dominates visually.
- Tapping the discount array alerts you to a possible long entry when paired with a bullish CHoCH.
Source code
Deepwick Script, a subset of Pine Script · read-only
//@version=6
indicator("Discount 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)
bullColor = input.string("color.green", "Bull OB Color")
lineWidth = input.int(2, "Line Width", minval=1, maxval=5)
alertNew = input.bool(true, "Alert on New OB added")
alertTap = input.bool(false, "Alert when Price Taps Array")
transparency = input.int(80, "Fill Transparency", minval=50, maxval=99)
showLabels = input.bool(false, "Show OB Level Labels")
markerText = input.string("OB", "Marker Text")
ph = ta.pivothigh(high, swing, swing)
var float lastPh = na
var float prevPh = na
var float ob1 = na
var float ob2 = na
var float ob3 = na
var float ob4 = na
var float ob5 = na
if not na(ph)
prevPh := lastPh
lastPh := ph
if not na(lastPh) and not na(prevPh) and lastPh > prevPh
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 := low[i]
found := true
break
p_Bull_OB_1 = plot(ob1, "Bull OB 1", color=bullColor, style=plot.style_linebr, linewidth=3)
p_Bull_OB_2 = plot(ob2, "Bull OB 2", color=color.lime, style=plot.style_linebr, linewidth=2)
p_Bull_OB_3 = plot(ob3, "Bull OB 3", color=color.lime, style=plot.style_linebr, linewidth=2)
p_Bull_OB_4 = plot(ob4, "Bull OB 4", color=color.lime, style=plot.style_linebr, linewidth=1)
p_Bull_OB_5 = plot(ob5, "Bull OB 5", color=color.lime, style=plot.style_linebr, linewidth=1)
alertcondition(not na(ob1) and na(ob1[1]), "New bullish OB added", "Bullish OB added to discount array")
alertcondition(low <= ob1 and close > ob1, "Discount array tapped", "Price tapped the bottom of the discount array")
alertcondition(low <= ob2 and close > ob2 and not (low <= ob1 and close > ob1), "Discount deep tap", "Price reached the second OB in the discount array")
No comments yet.
Sign in to comment.