# Highest high and Lowest low from the 30th Bar to the Last Bar

#### kvr53

##### New member
How do I make a chart label to show highest high and lowest low from the 30th Bar to the Last Bar ? (from 9:30- 15:59)

Solution
How do I make a chart label to show highest high and lowest low from the 30th Bar to the Last Bar ? (from 9:30- 15:59)

Try this

Ruby:
``````input count      = 30;

def barcount     = if GetDay() != GetDay()[1]
then 0
else if rth
then barcount[1] + 1
else barcount[1];
def bn          = BarNumber();
def countbn     = if GetDay() == GetLastDay() and barcount == count
then bn
else Double.NaN;
def hi_after    = if bn ==...``````

#### SleepyZ

##### Well-known member
VIP
How do I make a chart label to show highest high and lowest low from the 30th Bar to the Last Bar ? (from 9:30- 15:59)

Try this

Ruby:
``````input count      = 30;

def barcount     = if GetDay() != GetDay()[1]
then 0
else if rth
then barcount[1] + 1
else barcount[1];
def bn          = BarNumber();
def countbn     = if GetDay() == GetLastDay() and barcount == count
then bn
else Double.NaN;
def hi_after    = if bn ==  HighestAll(countbn)
then high[-1]
else if bn > HighestAll(countbn) and rth
then Max(high, hi_after[1])
else hi_after[1];

def lo_after    = if bn ==  HighestAll(countbn)
then low[-1]
else if  bn > HighestAll(countbn) and rth
then Min(low, lo_after[1])
else lo_after[1];

AddLabel(1, "HH after " + count + " bars : " + hi_after, Color.GREEN);
AddLabel(1, "LL after " + count + " bars : " + lo_after);

input debug = yes;
AddChartBubble(1, low - 3 * TickSize(), barcount + "\n" + bn + "\n" + hi_after + " \n" + lo_after, Color.GRAY, no);
#``````

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

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?