PINE LIBRARY

three_line_strike_lib

162
"three_line_strike_lib"

This script is a Pine Script v5 library that identifies and visualizes classic candlestick reversal patterns—Three Line Strike and Engulfing Candles—for use in custom indicators or strategies.

Key Features

Candle Color Detection: Determines whether each candle is bullish (+1), bearish (-1), or neutral/doji (0).

Engulfing Logic:

Bearish Engulfing: A green candle followed by a larger red candle.

Bullish Engulfing: A red candle followed by a larger green candle.

The body size comparison ensures that only meaningful engulfing events are flagged.

Three Line Strike (3LS):

Bearish 3LS: Three consecutive bullish candles followed by a bearish engulfing candle.

Bullish 3LS: Three consecutive bearish candles followed by a bullish engulfing candle.

Customizable Plots:

Choose between standard shapes or fun meme icons (🍆 for bullish, 🍑 for bearish) to mark detected patterns on the chart.

Toggle display of Three Line Strike patterns and “Big A$$” (Engulfing) candles independently.

Alert Support: Signals can be tied to TradingView alerts for real-time notifications.

Usage

Import this library into your own Pine Script to access the exported functions:

candleColorIndex(barIndex) – returns candle color index.

isEngulfing(checkBearish) – checks for engulfing patterns.

isBearishEngulfing() / isBullishEngulfing() – shortcut functions.

is3LSBear() / is3LSBull() – detects Three Line Strike signals.

With the provided input toggles and plotting logic, traders can quickly highlight potential reversal or trend continuation points on any timeframe. This tool is especially useful for price action traders and scalpers seeking visual confirmation of these well-known candlestick setups.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.