How do I move chartbubbles to the right side

s1111

Active member
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:
Solution
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...
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);

to get a bubble off to the right edge of the chart, i changed a bubble time parameter,
to look for the last barnumber on the chart, not the last peak bar.


Code:
#lines_addbubble

#https://usethinkscript.com/threads/how-do-i-move-chartbubbles-to-the-right-side.19387/
#How do I move chartbubbles to the right side
#s1111  Start dateYesterday at 10:56 PM  TagsNone

#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.


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;


#AddChartBubble(ShowChartBubbles and bar == HighestAll(highBar), PMHighBar *1, "'PMH' ", Color.RED, yes);
#AddChartBubble(ShowChartBubbles and bar == HighestAll(lowBar), PMLowBar *1, "'PML' ", Color.GREEN, no);

AddChartBubble((ShowChartBubbles and bar == HighestAll(if !isnan(bar) then bar else 0)), PMHighBar *1, "'PMH' ", Color.RED, yes);
AddChartBubble((ShowChartBubbles and bar == HighestAll(if !isnan(bar) then bar else 0)), PMLowBar *1, "'PML' ", Color.GREEN, no);
#
 
Solution

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
313 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top