$BNB //@version=5
indicator("BNB 540-570 Range Strategy", overlay=true)

// === LEVELS ===
buyZoneLow = 538.0
buyZoneHigh = 545.0
sellZoneLow = 565.0
sellZoneHigh = 572.0
stopLoss = 528.0
breakout = 575.0

// === PLOT LEVELS ===
plot(buyZoneLow, "Buy Zone Low 538", color=color.green, linewidth=1)
plot(buyZoneHigh, "Buy Zone High 545", color=color.green, linewidth=1)
plot(sellZoneLow, "Sell Zone Low 565", color=color.red, linewidth=1)
plot(sellZoneHigh, "Sell Zone High 572", color=color.red, linewidth=1)
plot(stopLoss, "Stop Loss 528", color=color.orange, linewidth=2)
plot(breakout, "Breakout 575", color=color.blue, linewidth=1)

// === FILL ZONES ===
buyFill = plot(buyZoneHigh, color=na)
sellFill = plot(sellZoneLow, color=na)
fill(plot(buyZoneLow), buyFill, color=color.new(color.green, 90), title="Buy Zone Fill")
fill(plot(sellZoneHigh), sellFill, color=color.new(color.red, 90), title="Sell Zone Fill")

// === SIGNALS ===
inBuyZone = close >= buyZoneLow and close <= buyZoneHigh
inSellZone = close >= sellZoneLow and close <= sellZoneHigh

plotshape(inBuyZone, title="BUY SIGNAL", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY", textcolor=color.white, size=size.small)
plotshape(inSellZone, title="SELL SIGNAL", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL", textcolor=color.white, size=size.small)

// === ALERTS ===
alertcondition(inBuyZone, title="BNB Buy Zone", message="BNB is in Buy Zone 538-545")
alertcondition(inSellZone, title="BNB Sell Zone", message="BNB is in Sell Zone 565-572")
alertcondition(close < stopLoss, title="BNB Stop Loss Hit", message="BNB broke below 528 Stop Loss")
alertcondition(close > breakout, title="BNB Breakout", message="BNB broke above 575 Breakout")