Hi Ponderosa,
Sorry for the delay in replying. Are you a PineScript Mastery student? If so there is a video on how to get data from higher timeframes. If not the I highly recommend signing up as you will learn so much cool and useful stuff. Here's a link just incase.
https://courses.theartoftrading.com/cou ... ref=de21bf
Anyway this should help in the short term.
@version=5
indicator(title="HTF EMA", overlay=true)
// Get user input
res = input.string(title="EMA Timeframe", defval="240")
len = input.int(title="EMA Length", defval=100)
// Calculate EMA from higher timeframe
ema = ta.ema(close, len)
ema240 = request.security(syminfo.tickerid, res, ema[barstate.isrealtime ? 1 : 0])
rsi = ta.rsi(close,14)
condition = false
// If rsi > 30 and ema240 > previous bar
if rsi > 30
if ema240 > ema240[1]
condition = true
// If condition true do something here
// Draw EMA
plot(ema240, linewidth=2, title="HTF EMA")