Bullish Engulfing
bullishEngulfing = close > open[1] and open < close[1] and open < close
plotshape(bullishEngulfing, style=shape.labelup, location=location.belowbar, color=color.green, size=size.small, title="1. Bullish Engulfing
// 2. Bearish Engulfing
bearishEngulfing = close < open[1] and open > close[1] and open > close
plotshape(bearishEngulfing, style=shape.labeldown, location=location.abovebar, color=color.red, size=size.small, title="2. Bearish Engulfing
// 3. Bullish Hammer
bullishHammer = (high - low) > 3 * (open - close) and (close - low) / (0.001 + high - low) > 0.6 and (open - low) / (0.001 + high - low) > 0.6
plotshape(bullishHammer, style=shape.labelup, location=location.belowbar, color=color.lime, size=size.small, title="3. Bullish Hammer
// 4. Bearish Hammer
bearishHammer = (high - low) > 3 * (open - close) and (high - close) / (0.001 + high - low) > 0.6 and (high - open) / (0.001 + high - low) > 0.6
plotshape(bearishHammer, style=shape.labeldown, location=location.abovebar, color=color.orange, size=size.small, title="4. Bearish Hammer
// 5. Doji
doji = abs(close - open) <= (high - low) * 0.1
plotshape(doji, style=shape.labelup, location=location.belowbar, color=color.blue, size=size.small, title="5. Doji
// 6. Morning Star
morningStar = close[2] < open[2] and close[1] < open[1] and close > open and close[1] < close[2]
plotshape(morningStar, style=shape.labelup, location=location.belowbar, color=color.purple, size=size.small, title="6. Morning Star
// 7. Evening Star
eveningStar = close[2] > open[2] and close[1] > open[1] and close < open and close[1] > close[2]
plotshape(eveningStar, style=shape.labeldown, location=location.abovebar, color=color.yellow, size=size.small, title="7. Evening Star
// 8. Bullish Harami
bullishHarami = close[1] < open[1] and close > open and close < open[1] and open > close[1]
plotshape(bullishHarami, style=shape.labelup, location=location.belowbar, color=color.fuchsia, size=size.small, title="8. Bullish Harami
// 9. Bearish Harami
bearishHarami = close[1] > open[1] and close < open and close > open[1] and open < close[1]
plotshape(bearishHarami, style=shape.labeldown, location=location.abovebar, color=color.teal, size=size.small, title="9. Bearish Harami
// 10. Shooting Star
shootingStar = (high - low) > 3 * (open - close) and (high - close) / (0.001 + high - low) > 0.6 and (high - open) / (0.001 + high - low) > 0.6
plotshape(shootingStar, style=shape.labeldown, location=location.abovebar, color=color.maroon, size=size.small, title="10. Shooting Star")
``