Add chart bubble for a high or low of the most current candle at the open?

Cmeeker778

New member
Any help would be appreciated. Seems like it should be rather easy to write, but not sure where to start.

I have this, but I get an error for the "addchartbubble"

Code:
input count = 5;
def l = low(period = aggregationperiod.FIVE_MIN);
def h = high(period = aggregationperiod.FIVE_MIN);
def FiveBarLow = lowest(l,count);
def FiveBarHigh = highest(h,count);
Addchartbubble(1,"Lowest in Last 5 Minutes: " + FiveBarLow, color.white);
Addchartbubble(1,"Highest in Last 5 Minutes: " + FiveBarHigh, color.white);
 
Last edited by a moderator:

mfsteve

Member
VIP
Wrong number of arguments in AddChartBubble()

You want something like this?

Code:
#hint: High/low bubbles on last candle
input count = 5;
def l = low(period = aggregationperiod.FIVE_MIN);
def h = high(period = aggregationperiod.FIVE_MIN);
def FiveBarLow = lowest(l,count);
def FiveBarHigh = highest(h,count);
def LastBar = if IsNan(Close[-1]) then 1 else 0;
Addchartbubble(LastBar, low, "Lowest in Last 5 Minutes: " + FiveBarLow, color.white, no);
Addchartbubble(LastBar, high, "Highest in Last 5 Minutes: " + FiveBarHigh, color.white, yes);

Edit: Added chart bubble direction.
 
Last edited:

Similar threads

Top