Hello,
I am using TOS engulfing candle code to find bullish and bearish engulfing candles (arrow in the image below). What I need help with is the candle right before the engulfing candle (indicated by the circle in the image below). I wanted to figure out a way to draw a horizontal line from the close of the candle to the top wick of the candle. I hope I explained it clearly, I tried using the PaintingStrategy but I am not familiar enough to make it work.
I really appreciate your help,
Thank you,
I am using TOS engulfing candle code to find bullish and bearish engulfing candles (arrow in the image below). What I need help with is the candle right before the engulfing candle (indicated by the circle in the image below). I wanted to figure out a way to draw a horizontal line from the close of the candle to the top wick of the candle. I hope I explained it clearly, I tried using the PaintingStrategy but I am not familiar enough to make it work.
I really appreciate your help,
Thank you,
Code:
#
# TD Ameritrade IP Company, Inc. (c) 2011-2020
#
#wizard plots
#wizard text: Inputs: length:
#wizard input: length
#wizard text: trend setup:
#wizard input: trendSetup
input length = 20;
input trendSetup = 3;
def BodyMax = Max(open, close);
def BodyMin = Min(open, close);
def IsEngulfing = BodyMax > BodyMax[1] and
BodyMin < BodyMin[1];
def IsWhite = open < close;
def IsBlack = open > close;
def IsPrevDoji = IsDoji(length)[1];
plot Bearish = IsAscending(close, trendSetup)[1] and
(IsWhite[1] or IsPrevDoji) and
IsBlack and
IsEngulfing;
plot Bullish = IsDescending(close, trendSetup)[1] and
(IsBlack[1] or IsPrevDoji) and
IsWhite and
IsEngulfing;
Bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
Bearish.SetDefaultColor(GetColor(1));
Bearish.SetLineWeight(2);
Bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
Bullish.SetDefaultColor(GetColor(2));
Bullish.SetLineWeight(2);
