# Does anyone have an indicator which will display the current time frame on a label?

#### kingkunta

##### New member
Hi I use 1,2,3,5,10,15m TFs very often and would like to know if anyone has an idea of an indicator to just display it in the corner? thanks in advance!

Solution
HTML:
``````def agg = GetAggregationPeriod() ;
if  agg == AggregationPeriod.DAY then "Day" else
if  agg == AggregationPeriod.WEEK then "Week" else
if  agg == AggregationPeriod.HOUR then "Hour" else
if  agg == AggregationPeriod.THIRTY_MIN then "30 mins" else
if  agg == AggregationPeriod.FIFTEEN_MIN then "15 mins" else
if  agg == AggregationPeriod.TEN_MIN then "10 mins" else
if  agg == AggregationPeriod.FIVE_MIN then "5 mins" else
if  agg == AggregationPeriod.THREE_MIN then "3 mins" else
if  agg == AggregationPeriod.TWO_MIN then "2 mins" else
if  agg == AggregationPeriod.MIN then "1 min" else "add your agg", Color.CYAN);``````
HTML:
``````def agg = GetAggregationPeriod() ;
if  agg == AggregationPeriod.DAY then "Day" else
if  agg == AggregationPeriod.WEEK then "Week" else
if  agg == AggregationPeriod.HOUR then "Hour" else
if  agg == AggregationPeriod.THIRTY_MIN then "30 mins" else
if  agg == AggregationPeriod.FIFTEEN_MIN then "15 mins" else
if  agg == AggregationPeriod.TEN_MIN then "10 mins" else
if  agg == AggregationPeriod.FIVE_MIN then "5 mins" else
if  agg == AggregationPeriod.THREE_MIN then "3 mins" else
if  agg == AggregationPeriod.TWO_MIN then "2 mins" else
if  agg == AggregationPeriod.MIN then "1 min" else "add your agg", Color.CYAN);``````

TY SO MUCH!
HTML:
``````def agg = GetAggregationPeriod() ;
if  agg == AggregationPeriod.DAY then "Day" else
if  agg == AggregationPeriod.WEEK then "Week" else
if  agg == AggregationPeriod.HOUR then "Hour" else
if  agg == AggregationPeriod.THIRTY_MIN then "30 mins" else
if  agg == AggregationPeriod.FIFTEEN_MIN then "15 mins" else
if  agg == AggregationPeriod.TEN_MIN then "10 mins" else
if  agg == AggregationPeriod.FIVE_MIN then "5 mins" else
if  agg == AggregationPeriod.THREE_MIN then "3 mins" else
if  agg == AggregationPeriod.TWO_MIN then "2 mins" else
if  agg == AggregationPeriod.MIN then "1 min" else "add your agg", Color.CYAN);``````

Hi I use 1,2,3,5,10,15m TFs very often and would like to know if anyone has an idea of an indicator to just display it in the corner? thanks in advance!

Here is another

Ruby:
``````def agg1 = GetAggregationPeriod();
then "Y" else
if agg1 == 7776000000
then "Q" else
if agg1 == 2592000000
then "M" else
if agg1 == 604800000
then "W" else
if agg1 >= 84400000 and agg1 < 604800000
then agg1 / 60000 / 1440 + "D"  else
if agg1 >= 3600000 and agg1 < 84400000
then agg1 / 60000 / 60 + "H"
else agg1 / 60000 + "m", Color.YELLOW);``````

Hi I use 1,2,3,5,10,15m TFs very often and would like to know if anyone has an idea of an indicator to just display it in the corner? thanks in advance!
I don't understand why you would need that when it is already displayed next to the symbol.

# Global Market Opens and Closes
# Vertical lines mark all open and closes
# Horizontal lines mark US, AUD opens and closes
# ThinkScript Chat Room Group
# Added Close / Open Lines for US and AUD

declare hide_on_daily;

input Plot_Verticle_Line = yes;
input Show_US = yes;
input Show_London = yes;
input Show_Sydney = yes;
input Show_Asian = yes; #HINT Show_Asian: IMPORTANT, BE SURE to adjust for part of year where USA goes to Daylight Savings but Asia remains on Standard time
input US_Open = 0930;
input US_Close = 1600;
input GBP_Open = 0300;
input GBP_Close = 1130;
input AUD_Open = 1800;
input AUD_Close = 0000;
input JPY_Open = 1900; #HINT JPY_Open: IMPORTANT, BE SURE to adjust for part of year where USA goes to Daylight Savings but Asia remains on Standard time
input JPY_Close = 0100; #HINT JPT_Close: IMPORTANT, BE SURE to adjust for part of year where USA goes to Daylight Savings but Asia remains on Standard time
input US_Bond_Close = 1500;
input Metals_Futures_Close = 1700;

#US
AddVerticalLine(secondsFromTime(US_Open)[1] < 0 && secondsFromTime(US_Open) >= 0 and
Plot_Verticle_Line and
Show_US, concat("US_Open", ""), Color.Green, curve.POINTS);
AddVerticalLine(secondsFromTime(US_Close)[1] < 0 && secondsFromTime(US_Close) >= 0 and
Plot_Verticle_Line and
Show_US, concat("US_Close", ""), Color.Green, curve.POINTS);
#AUD
def AUDopen = if secondsFromTime(AUD_Open)[1] < 0 &&
secondsFromTime(AUD_Open) >= 0
then barnumber()
else AUDopen[1];
def DataAUDopenLine = if barnumber()-1 == AudOpen
then if IsNaN(barnumber())
then HighestAll(open[1])
else open[1]
else DataAUDopenLine[1];

secondsFromTime(AUD_Open) >= 0 and
Plot_Verticle_Line and
Show_Sydney, concat("AUD_Open", " "), Color.Yellow, curve.POINTS);

def AUDclose = if secondsFromTime(AUD_Close)[1] < 0 &&
secondsFromTime(AUD_Close) >= 0
then barnumber()
else AUDclose[1];
def DataAUDcloseLine = if barnumber()-1 == Audclose
then if IsNaN(barnumber())
then HighestAll(close[1])
else close[1]
else DataAUDcloseLine[1];
Plot_Verticle_Line and
Show_Sydney, concat("AUD_Close",""),Color.Yellow, curve.POINTS);
# JPY
secondsFromTime(JPY_Open) >= 0 and
Plot_Verticle_Line and
Show_Asian, concat("JPY_Open", ""), Color.Red, curve.POINTS);

secondsFromTime(JPY_Close) >= 0 and
Plot_Verticle_Line and
Show_Asian, concat("JPY_Close", ""), Color.Red, curve.POINTS);
# GBP
secondsFromTime(GBP_Open) >= 0 and
Plot_Verticle_Line and
Show_London, concat("GBP_Open", ""), Color.Blue, curve.POINTS);

secondsFromTime(GBP_Close) >= 0 and
Plot_Verticle_Line and
Show_London, concat("GBP_Close", ""), Color.Blue, curve.POINTS);
# US Bond Close
secondsFromTime(US_Bond_Close) >= 0 and
Plot_Verticle_Line and
Show_London, concat("US_Bond_Close", ""), Color.Plum, curve.POINTS);
# Metals Futures Close
secondsFromTime(Metals_Futures_Close) >= 0 and
Plot_Verticle_Line and
Show_London, concat("Metal_Futs_Close", ""), Color.Orange, curve.POINTS);
# End Code

found this, if you tweak it a little, you can replace add vert lines with add labels

87k+ Posts
378 Online

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