Display AddChartBubble at Highest or Lowest of Candle

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:

samoya

Active member
VIP
Thanks, that is also what I am looking for. Is it possible to show the bubble in the left upper corner (High and Low of the last recent bar?
Thank you very much

TlWhAyI.png
 

samoya

Active member
VIP
@rad14733 Thanks a lot. Sorry for my dumb question, I am not a coder. May I ask for your kind help to change the upper code to show it as a "chart label"? Really appreciate your kind help.

Thank you
 

Similar threads

Top