Is there a way to add chart bubbles to these levels?
Just saw your request.
Here is the bubble code added to your script below. They will display in expansion andt you can move sideways at input bubblemover.
Code:# 5 min opening range # Robert Payne #Plot opening range high / low input OpenRangeMinutes = 5; input MarketOpenTime = 0930; input ShowTodayOnly = yes; def Today = if GetDay() == GetLastDay() then 1 else 0; def FirstMinute = if SecondsFromTime(MarketOpenTime) < 60 then 1 else 0; def OpenRangeTime = if SecondsFromTime(MarketOpenTime) < 60 * OpenRangeMinutes then 1 else 0; #Plot yesterday's high / low plot Yhigh = if ShowTodayOnly and !Today then Double.NaN else high(period = "day" )[1]; plot Ylow = if ShowTodayOnly and !Today then Double.NaN else low(period = "day" )[1]; Yhigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); Yhigh.SetDefaultColor(Color.UPTICK); Yhigh.SetLineWeight(2); Ylow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); Ylow.SetDefaultColor(Color.DOWNTICK); Ylow.SetLineWeight(2); #Plot pivot plot Pivot = if ShowTodayOnly and !Today then Double.NaN else (high(period = "day" )[1] + low(period = "day" )[1] + close(period = "day" )[1]) / 3; Pivot.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); Pivot.SetDefaultColor(Color.YELLOW); Pivot.SetLineWeight(2); #Plot 10 day high / low plot TenHigh = if ShowTodayOnly and !Today then Double.NaN else Highest(high(period = "day" )[1], 10); plot TenLow = if ShowTodayOnly and !Today then Double.NaN else Lowest(low(period = "day" )[1], 10); TenHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); TenHigh.SetDefaultColor(Color.UPTICK); TenHigh.SetLineWeight(3); TenLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); TenLow.SetDefaultColor(Color.DOWNTICK); TenLow.SetLineWeight(3); input showbubbles = yes; input bubblemover = 3; def b = bubblemover; def b1 = b + 1; addchartBubble(showbubbles and !isnan(close[b1]) and isnan(close[b]), yhigh, "YH", color.green); addchartBubble(showbubbles and !isnan(close[b1]) and isnan(close[b]), ylow, "YL", color.red); addchartBubble(showbubbles and !isnan(close[b1]) and isnan(close[b]), pivot, "Pivot", color.yellow); addchartBubble(showbubbles and !isnan(close[b1]) and isnan(close[b]), Tenhigh, "TenH", color.green); addchartBubble(showbubbles and !isnan(close[b1]) and isnan(close[b]), Tenlow, "TenL", color.red); AssignPriceColor(if close >= Yhigh then Color.GREEN else if close <= Ylow then Color.RED else Color.CURRENT); AssignPriceColor(if close > Yhigh and open < close then Color.WHITE else if close > Yhigh and open > close then Color.GRAY else if close < Ylow and open < close then Color.WHITE else if close < Ylow and open > close then Color.GRAY else Color.CURRENT);
Last edited: