candle_stability_index_param = input.float(0.5, 'Candle Stability Index', 0, 1, step=0.1, group='Technical', tooltip='Candle Stability Index measures the ratio between the body and the wicks of a candle. Higher - more stable.') rsi_index_param = input.int(50, 'RSI Index', 0, 100, group='Technical', tooltip='RSI Index measures how overbought/oversold is the market. Higher - more overbought/oversold.') candle_delta_length_param = input.int(5, 'Candle Delta Length', 3, group='Technical', tooltip='Candle Delta Length measures the period over how many candles the price increased/decreased. Higher - longer period.') disable_repeating_signals_param = input.bool(false, 'Disable Repeating Signals', group='Technical', tooltip='Removes repeating signals. Useful for removing clusters of signals and general clarity')
GREEN = color.rgb(29, 255, 40) RED = color.rgb(255, 0, 0) TRANSPARENT = color.rgb(0, 0, 0, 100)
bullish_engulfing = close[1] < open[1] and close > open and close > open[1] rsi_below = rsi < rsi_index_param decrease_over = close < close[candle_delta_length_param]
bull = bullish_engulfing and stable_candle and rsi_below and decrease_over and barstate.isconfirmed
bearish_engulfing = close[1] > open[1] and close < open and close < open[1] rsi_above = rsi > 100 - rsi_index_param increase_over = close > close[candle_delta_length_param]
bear = bearish_engulfing and stable_candle and rsi_above and increase_over and barstate.isconfirmed