Bullish/Bearish Engulfing Alerts (oversold/overbought)

Chuck

Moderator
Staff member
Code:
# Bullish/ Bearish Engulfing Alerts (Oversold/ Overbought)
# Use with caution and in context of market.
# Make sure to adjust settings that fits you best.

input length = 14;
input over_Bought = 75;
input over_Sold = 25;
input price = close;
input averageType = AverageType.WEIGHTED;
#defining engulfing bars
def BodyMax = Max(open, close);
def BodyMin = Min(open, close);
def IsEngulfing = BodyMax > BodyMax[1] and
BodyMin < BodyMin[1];
#defining the bullish / bearish signals
def bullish_signal = RSI(length = length, averageType = averageType) < over_Sold and Isengulfing and close > open;
def bearish_signal = RSI(length = length, averageType = averageType) > over_Bought and Isengulfing and close < open;
#plotting the bullish / bearish signals
plot bullish = bullish_signal;
bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
plot bearish = bearish_signal;
bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
alert(bullish_signal, “BULLISH ENGULFING”, alert.bar, sound.Chimes);
alert(bearish_signal, “BEARISH ENGULFING”, alert.bar, sound.Bell);
 
Top