Is it possible in Pinescript to plot the first engulfing bar (open and close)?

Viewed 77

This is the code that I use for the bullish engulfing:

engLong  = (close >= open[1] and close [1] < open[1])

close_engLong  = valuewhen(engLong, close, 0)

plot(close_engLong)

The engulfing consists of 2 bars and with this code the script draws the close value of the second bar. How can I draw the open and close value of the first engulfing bar?

0 Answers
Related