Percent Change Alert
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © ekthunrongSR

//@version=5
indicator("Percent Change Alert", overlay = true)

// volume
pct_chg_vol = input.int(30, "Percent Change Volume")
price_threshold = input.float(3.0, "Percent Change Price")
pct_chg_price = ((close - close[1])/close[1])
volume_signal = volume > volume[1]*(pct_chg_vol/100)
ema_len = input.int(50, "EMA Length")
ema = ta.ema(close, ema_len)
bull = close > ema
signal = pct_chg_price > (price_threshold/100) and volume_signal and bull

plot(ema, "EMA", color = color.blue)
plotshape(signal, "Signal", color = color.black, style = shape.arrowup, location = location.belowbar)
alertcondition(signal, "Long Signal", "{{ticker}}, Long Signal")





