OPEN-SOURCE SCRIPT

RSI Divergence with Bullish Candle

Key Concepts in the Script:
RSI Calculation: The RSI is calculated with the user-defined period (rsiLength). The script uses the default 14-period RSI but you can adjust it.
Bullish Divergence:
Price Low: The script checks for the lowest price over the last 20 bars (ta.lowest(close, 20)).
RSI Low: The script checks for the lowest RSI over the same 20 bars.
Divergence Condition: Bullish divergence is identified when the price forms a lower low (priceLow1 < priceLow2), while the RSI forms a higher low (rsiLow1 > rsiLow2), and the RSI is below the oversold level (typically 30).
Bullish Candle Pattern:
A Bullish Engulfing pattern is defined as the current candle closing higher than it opened, and the close being above the previous candle's high.
A Hammer pattern is defined as a candlestick where the close is higher than the open, and the low is the lowest of the last 5 bars.
Buy Signal: The script generates a buy signal when both the bullish divergence and bullish candle are confirmed at the same time.

Pernyataan Penyangkalan