# small text indicator for price above hourly, daily, weekly, monthly open?

#### tickwiz

##### New member
Hey guys! I am looking for an indicator that tells you when price is above or below all those opens. Like for example showing a green text or a red text bottom right of the chart or below the instrument data at the top.

Do you think its possible?

Thanks!

Solution
@tickwiz I think it is possible -
Code:
``````# chart aggregation must be no more than 1 hour
# chart length may have to be increased to provide enough data for the larger aggregations

def c1 = close(period = "month");
def c2 = close(period = "week");
def c3 = close(period = "day");
def c4 = close(period = "1 hour");
def o1 = open(period = "month");
def o2 = open(period = "week");
def o3 = open(period = "day");
def o4 = open(period = "1 hour");

AddLabel(1,"H",if c4 > o4 then color.green else if c4 == o4 then color.gray else color.red);
AddLabel(1,"D",if c3 > o3 then color.green else if c3 == o3 then color.gray else color.red);
AddLabel(1,"W",if c2 > o2 then color.green else if c2 == o2 then color.gray else color.red);
@tickwiz I think it is possible -
Code:
``````# chart aggregation must be no more than 1 hour
# chart length may have to be increased to provide enough data for the larger aggregations

def c1 = close(period = "month");
def c2 = close(period = "week");
def c3 = close(period = "day");
def c4 = close(period = "1 hour");
def o1 = open(period = "month");
def o2 = open(period = "week");
def o3 = open(period = "day");
def o4 = open(period = "1 hour");

AddLabel(1,"H",if c4 > o4 then color.green else if c4 == o4 then color.gray else color.red);
AddLabel(1,"D",if c3 > o3 then color.green else if c3 == o3 then color.gray else color.red);
AddLabel(1,"W",if c2 > o2 then color.green else if c2 == o2 then color.gray else color.red);
AddLabel(1,"M",if c1 > o1 then color.green else if c1 == o1 then color.gray else color.red);``````

87k+ Posts
179 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?