Thank you so much Ben. Here is the script I started. But, the 1min and 5 min RSI ended up with the same value. They should be different. What am I doing wrong? Thank you.

Code:

```
#Show/hide aggregation periods
input show1m = yes;#Hint show1m:1 minute
input show2m = yes;#Hint show2m:2 minutes
input show3m = yes;#Hint show3m:3 minutes
input show4m = yes;#Hint show4m:4 minutes
input show5m = yes;#Hint show5m:5 minutes
input show10m = yes;#Hint show10m:10 minutes
input show15m = yes;#Hint show15m:15 minutes
input show20m = yes;#Hint show20m:20 minutes
input show30m = yes;#Hint show30m:30 minutes
input show60m = yes;#Hint show60m:1 hour
input show2hr = yes;#Hint show2hr:2 hours
input show4hr = yes;#Hint show4hr:4 hours
input show1d = yes;#Hint show1d:1 day
### 1m timeframe ###
def tf1m = AggregationPeriod.MIN;
def rsi = reference RSI("over bought" = 95, "over sold" = 5, price = close(period = AggregationPeriod.MIN));
AddLabel(yes,"RSI1m ", if rsi >= 50 or rsi <= 50 then Color.RED else Color.GREEN);
### 5m timeframe ###
def tf5m = AggregationPeriod.five_MIN;
def rsi5 = reference RSI("over bought" = 95, "over sold" = 5, price = close(period = AggregationPeriod.FIVE_MIN));
AddLabel(yes, "RSI5m", if rsi >= 50 or rsi <= 50 then Color.RED else Color.GREEN);
```

Thank you Ben. This is the whole scrip:

#Show/hide aggregation periods

input show1m = yes;#Hint show1m:1 minute

input show5m = yes;#Hint show5m:5 minutes

### 1m timeframe ###

def tf1m = AggregationPeriod.MIN;

def rsi = reference RSI("over bought" = 95, "over sold" = 5, price = close(period = AggregationPeriod.MIN));

AddLabel(yes,"RSI1m ", if rsi >= 50 or rsi <= 50 then Color.RED else Color.GREEN);

### 5m timeframe ###

def tf5m = AggregationPeriod.five_MIN;

def rsi5 = reference RSI("over bought" = 95, "over sold" = 5, price = close(period = AggregationPeriod.FIVE_MIN));

AddLabel(yes, "RSI5m", if rsi >= 50 or rsi <= 50 then Color.RED else Color.GREEN);