The only way to do this while referencing a higher time frame than your chart is to copy the entire code from both of the built-in chart studies and combine them into one. The code below contains both elements along with a single statement to generate the chart label. There are two user inputs to let you set the time frame and the label prefix from the user settings. This enables you to add the custom chart study to the same chart multiple times with different settings.
input timeFrame = AggregationPeriod.DAY;
input chartLabelText = "Daily RSI/MACD";
input fastLength = 12;
input slowLength = 26;
input MACDLength = 9;
input macdAverageType = AverageType.EXPONENTIAL;
input length = 14;
input rsiAverageType = AverageType.WILDERS;
def value = MovingAverage(macdAverageType, close(period = timeFrame), fastLength) - MovingAverage(macdAverageType, close(period = timeFrame), slowLength);
def avg = MovingAverage(macdAverageType, value, MACDLength);
def diff = value - avg;
def netChangeAverage = MovingAverage(rsiAverageType, close(period = timeFrame) - close(period = timeFrame)[1], length);
def totalChangeAverage = MovingAverage(rsiAverageType, AbsValue(close(period = timeFrame) - close(period = timeFrame)[1]), length);
def changeRatio = if totalChangeAverage != 0 then netChangeAverage / totalChangeAverage else 0;
def rsi = 50 * (changeRatio + 1);
AddLabel(yes, Concat(chartLabelText, Concat(" : ", rsi)), if diff > 0 then Color.GREEN else Color.RED);