OPEN-SOURCE SCRIPT
Confluence Trend Signals

Confluence Trend Signals
The Confluence Trend Signals indicator is a comprehensive, multi-factor tool designed to identify high-probability trading setups by integrating five separate, proven technical analysis components. It generates clear "High Quality BUY" and "High Quality SELL" signals based on the alignment of these different trend and structure elements.-----Key Confluence Components
The indicator combines the following five components to calculate a final confluence score and trigger signals:
🪸 Coral Trend: Acts as the primary trend filter, using both a "Fast Coral" for entries and a "Slow Coral" for bias confirmation.
📏 Price % of Pivots: Measures price's current position relative to recent swing pivots (highs/lows) and includes an optional Higher Timeframe (HTF) Pivot filter for macro trend alignment.
📈 MACD: Utilizes a custom MACD to confirm directional momentum.
🧱 Smart Money Concepts (SMC) - Order Blocks: Detects both Swing and Internal Order Blocks, and checks if price is within "proximity" (defined by ATR) of a relevant unmitigated block.
📊 VWAP Bias: Filters trades based on price position relative to the Volume Weighted Average Price (VWAP), with a momentum bonus for rising/falling VWAP.
-----High Quality Signal Logic
A signal is generated only when a minimum confluence score is reached and specific gating conditions are met.
High Quality BUY Signal: Requires a Coral Bull Flip, high Pivot % > low Pivot %, MACD bullish alignment, proximity to a bullish Order Block, and price above VWAP (bullish bias).
High Quality SELL Signal: Requires a Coral Bear Flip, high Pivot % < low Pivot %, MACD bearish alignment, proximity to a bearish Order Block, and price below VWAP (bearish bias).
-----Advanced Trade Management
The indicator includes a robust risk management engine with multiple options:
Stop Loss (SL): Calculates a Stop Loss based on ATR (Average True Range) and includes an option for a Structure-Based SL placed beyond the nearest relevant Order Block or swing point.
Take Profits (TPs): Provides up to three Take Profit levels (TP1, TP2, TP3) based on multiples of the initial risk.
Exit Modes: Supports Trailing Stops (trailing to BE, TP1, TP2) or Fixed Exits with options for a single TP target or Partial Exits (scaling out at multiple TPs).
Confluence Decay Exit: A unique feature that closes the trade if the underlying directional confluence score drops below a dynamic or absolute threshold for a specified number of bars, aiming to "let winners run" until the core thesis is invalidated.
The Confluence Trend Signals indicator is a comprehensive, multi-factor tool designed to identify high-probability trading setups by integrating five separate, proven technical analysis components. It generates clear "High Quality BUY" and "High Quality SELL" signals based on the alignment of these different trend and structure elements.-----Key Confluence Components
The indicator combines the following five components to calculate a final confluence score and trigger signals:
🪸 Coral Trend: Acts as the primary trend filter, using both a "Fast Coral" for entries and a "Slow Coral" for bias confirmation.
📏 Price % of Pivots: Measures price's current position relative to recent swing pivots (highs/lows) and includes an optional Higher Timeframe (HTF) Pivot filter for macro trend alignment.
📈 MACD: Utilizes a custom MACD to confirm directional momentum.
🧱 Smart Money Concepts (SMC) - Order Blocks: Detects both Swing and Internal Order Blocks, and checks if price is within "proximity" (defined by ATR) of a relevant unmitigated block.
📊 VWAP Bias: Filters trades based on price position relative to the Volume Weighted Average Price (VWAP), with a momentum bonus for rising/falling VWAP.
-----High Quality Signal Logic
A signal is generated only when a minimum confluence score is reached and specific gating conditions are met.
High Quality BUY Signal: Requires a Coral Bull Flip, high Pivot % > low Pivot %, MACD bullish alignment, proximity to a bullish Order Block, and price above VWAP (bullish bias).
High Quality SELL Signal: Requires a Coral Bear Flip, high Pivot % < low Pivot %, MACD bearish alignment, proximity to a bearish Order Block, and price below VWAP (bearish bias).
-----Advanced Trade Management
The indicator includes a robust risk management engine with multiple options:
Stop Loss (SL): Calculates a Stop Loss based on ATR (Average True Range) and includes an option for a Structure-Based SL placed beyond the nearest relevant Order Block or swing point.
Take Profits (TPs): Provides up to three Take Profit levels (TP1, TP2, TP3) based on multiples of the initial risk.
Exit Modes: Supports Trailing Stops (trailing to BE, TP1, TP2) or Fixed Exits with options for a single TP target or Partial Exits (scaling out at multiple TPs).
Confluence Decay Exit: A unique feature that closes the trade if the underlying directional confluence score drops below a dynamic or absolute threshold for a specified number of bars, aiming to "let winners run" until the core thesis is invalidated.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.