input percent1 = 5;
input percent2 = 7;
input percent3 = 10;
input showbubbles = yes;
def bubblemover = 3;
def bm = bubblemover;
def bm1 = bm + 1;
DefineGlobalColor("H", Color.GREEN);
DefineGlobalColor("L", Color.RED);
def lastprice = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then close else Double.NaN);
plot hpercent1 = lastprice + (lastprice * percent1 / 100);
plot lpercent1 = lastprice - (lastprice * percent1 / 100);
hpercent1.SetDefaultColor(GlobalColor("H"));
lpercent1.SetDefaultColor(GlobalColor("L"));
AddChartBubble(showbubbles and !IsNaN(close[bm1]) and IsNaN(close[bm]), hpercent1, percent1 + "%", hpercent1.TakeValueColor());
AddChartBubble(showbubbles and !IsNaN(close[bm1]) and IsNaN(close[bm]), lpercent1, percent1 + "%", lpercent1.TakeValueColor());
plot hpercent2 = lastprice + (lastprice * percent2 / 100);
plot lpercent2 = lastprice - (lastprice * percent2 / 100);
hpercent2.SetDefaultColor(GlobalColor("H"));
lpercent2.SetDefaultColor(GlobalColor("L"));
AddChartBubble(showbubbles and !IsNaN(close[bm1]) and IsNaN(close[bm]), hpercent2, percent2 + "%", hpercent2.TakeValueColor());
AddChartBubble(showbubbles and !IsNaN(close[bm1]) and IsNaN(close[bm]), lpercent2, percent2 + "%", lpercent2.TakeValueColor());
plot hpercent3 = lastprice + (lastprice * percent3 / 100);
plot lpercent3 = lastprice - (lastprice * percent3 / 100);
hpercent3.SetDefaultColor(GlobalColor("H"));
lpercent3.SetDefaultColor(GlobalColor("L"));
AddChartBubble(showbubbles and !IsNaN(close[bm1]) and IsNaN(close[bm]), hpercent3, percent3 + "%", hpercent3.TakeValueColor());
AddChartBubble(showbubbles and !IsNaN(close[bm1]) and IsNaN(close[bm]), lpercent3, percent3 + "%", lpercent3.TakeValueColor());