In this script for premaket high low , what do I change to make chartbubble to the right side of the line for cleaner look, Thanks in advance.
Code:
declare once_per_bar;
input PlotPreMktLinesHrsPastOpen = yes;
input ShowChartBubbles = yes;
def bar = BarNumber();
def nan = Double.NaN;
def vHigh = high;
def vLow = low;
def PMhrs = RegularTradingStart(GetYYYYMMDD()) > GetTime();
def RMhrs = RegularTradingStart(GetYYYYMMDD()) < GetTime();
def PMStart = RMhrs[1] and PMhrs;
def PMHigh = CompoundValue(1, if PMStart then vHigh else if PMhrs then Max(vHigh, PMHigh[1]) else PMHigh[1], 0);
def PMLow = CompoundValue(1, if PMStart then vLow else if PMhrs then Min(vLow, PMLow[1]) else PMLow[1], 0);
def highBar = if PMhrs and vHigh == PMHigh then bar else nan;
def lowBar = if PMhrs and vLow == PMLow then bar else nan;
def PMHighBar = if bar == HighestAll(highBar) then PMHigh else PMHighBar[1];
def PMLowBar = if bar == HighestAll(lowBar) then PMLow else PMLowBar[1];
plot PMH = if PlotPreMktLinesHrsPastOpen and PMHighBar != 0
then PMHighBar
else nan;
plot PML = if PlotPreMktLinesHrsPastOpen and PMLowBar != 0
then PMLowBar
else nan;
# Add Chart Bubbles
AddChartBubble(ShowChartBubbles and bar == HighestAll(highBar), PMHighBar *1, "'PMH' ", Color.RED, yes);
AddChartBubble(ShowChartBubbles and bar == HighestAll(lowBar), PMLowBar *1, "'PML' ", Color.GREEN, no);
Last edited by a moderator: