RSI bullish divergence
RSI bullish divergence is an alert that checks every 15 minutes, fires at most once per bar and shows where it fires on the chart.
core language
alert "RSI bullish divergence"check: every 15mrepeat: once per barshow_on_chart: trueinput rsi_length = 14input lookback = 30momentum_now = rsi(close, rsi_length)lower_low = low < lowest(low, lookback)[1]higher_rsi = momentum_now > lowest(momentum_now, lookback)[1]when lower_low and higher_rsi and was(momentum_now < 30, within: 5 bars):notify "Bullish RSI divergence on {market.symbol}: RSI {momentum_now:0.0}"RSI bullish divergence is an alert that checks every 15 minutes, fires at most once per bar and shows where it fires on the chart.
You can change 2 inputs: rsi_length (default 14) and lookback (default 30).
It calculates momentum_now as the RSI over rsi_length bars, lower_low as whether the low is below the previous bar's lowest low of the last lookback bars and higher_rsi as whether momentum_now is above the previous bar's lowest momentum_now of the last lookback bars.
When lower_low and higher_rsi and momentum_now is below 30 at some point within the last 5 bars, it sends the notification "Bullish RSI divergence on {market.symbol}: RSI {momentum_now:0.0}".