First, let's show everyone how to do the most basic form, which is described in the title of your question:
input timeFrame = AggregationPeriod.DAY;
def percentChange = 100 * (open(period = timeFrame) / close(period = timeFrame)[1] - 1);
AddLabel(yes, Concat(percentChange, "%"), Color.WHITE);
Since we are working from an intraday chart we use the secondary aggregation parameter of the open and close to read those data points from the daily time frame.
The rest of your specifications provide for a solution with an EXTREMELY narrow scope. Which means these values are only useful for a very small microcosm of the markets. For instance these values will never be applicable to any stocks in the S&P 500, the NSDAQ 100, or the Russel 2000.
As you know this forum is not here for one-off solutions that benefit only a single individual. So I always cringe when I see posts that use hard coded values instead of using something that is able to adapt to a wide range of stocks. So for my solution I will add user inputs to permit the rest of our viewers to easily adjust these values to fit whatever basket of stocks they are trading.
An ideal solution would apply the use of the Average True Range. Then compute a percent of the average true range to determine when a stock is "over extended". Hard coded values such as 47% and 50% are completely inflexible and should be avoided at all cost.
Nevertheless, here is your solution:
input timeFrame = AggregationPeriod.DAY;
input percentOver = 50.0;
input percentMax = 47.0;
input percentMin = 0.0;
def percentChange = Round(100 * (open(period = timeFrame) / close(period = timeFrame)[1] - 1), 1);
AddLabel(percentChange > percentOver, "Over Extended", Color.GREEN);
AddLabel(yes, Concat(percentChange, "%"), if percentChange < percentMin then Color.RED else if percentChange > percentMax then Color.GREEN else Color.WHITE);