This code does what you want in TradingView, open up Pine Editor on the chart paste it in and click add to chart. It will plot the EMA and the EMA +/- 1 ATR, as well as providing an alert whenever the price crosses either of those bands. You can customize the EMA length and ATR length, as well as the multiplier for the ATR band.
//@version=5
indicator("ATR Distance to EMA Alert", shorttitle="ADTEMA Alert", overlay=true)
// customizable settings
emaLength = input(50, title="EMA Length")
atrLength = input(14, title="ATR Length")
atrMultiplier = input(1.0, title="ATR Multiplier")
// calculations
priceEma = ta.ema(close, emaLength)
priceAtr = ta.atr(atrLength)
upperBand = priceEma + priceAtr * atrMultiplier
lowerBand = priceEma - priceAtr * atrMultiplier
// plot EMA line and ATR bands
plot(priceEma, color=color.blue)
plot(upperBand, color=color.red)
plot(lowerBand, color=color.green)
// alert conditions
alertcondition(ta.crossover(close, upperBand), title="Price Up Alert", message="Price has moved 1 ATR above EMA!")
alertcondition(ta.crossunder(close, lowerBand), title="Price Down Alert", message="Price has moved 1 ATR below EMA!")