OPEN-SOURCE SCRIPT
Confirmed Pivots + MACD Signals (with BOS Lines)

Confirmed Pivots + MACD Signals
This indicator combines confirmed swing highs/lows (pivots) with MACD-based momentum signals to highlight key reversal and continuation points on the chart.
Core Logic
Confirmed Pivots:
The script identifies swing highs and lows using the user-defined pivot confirmation length.
Once a structure is broken beyond the last pivot, that level becomes a confirmed support (CL) or resistance (CH) line.
These levels are plotted as dashed horizontal rays and labeled directly on the chart.
MACD Integration:
The classic MACD crossover/under logic is used:
Bullish Crossover: MACD line crosses above the Signal line.
Bearish Crossunder: MACD line crosses below the Signal line.
Signal Filtering by Proximity:
A Proximity Zone (%) defines how close price must be to an active support or resistance to trigger a signal.
Buy Signal: When price is within the support zone and a bullish MACD crossover occurs.
Sell Signal: When price is within the resistance zone and a bearish MACD crossunder occurs.
Inputs
Pivot Confirmation Length: Bars used to confirm swing points.
MACD Fast/Slow/Signal Lengths: Standard MACD settings.
Proximity Zone (%): Defines zone width (e.g., 1% around active level).
Output
Labels: "CH" (Confirmed High) and "CL" (Confirmed Low) with color-coded dashed lines.
Signals: "BUY" and "SELL" markers appear when both pivot and MACD conditions align.
Tips
Works best on higher timeframes (H1 and above).
Combine with price action or trend filters for confirmation.
Use proximity percentage according to volatility (e.g., smaller % for low-vol assets).
⚠️ Disclaimer:
This script is provided for educational and informational purposes only.
It does not constitute financial or investment advice, and the author is not responsible for any financial losses that may occur from its use.
Always perform your own analysis and use this indicator together with other technical and risk management tools before making trading decisions.
---------------------------------------------------------------------------------------------
سقف و کف تاییدشده + سیگنالهای MACD
این اندیکاتور ترکیبی از شناسایی سقفها و کفهای تاییدشده (Pivot High/Low) به همراه سیگنالهای مومنتوم MACD است که نقاط برگشت یا ادامهی روند را روی چارت مشخص میکند.
🔹 منطق عملکرد
تایید سقف و کفها:
ابتدا سقف و کفهای محلی بر اساس تعداد کندلهای تنظیمشده شناسایی میشوند.
وقتی ساختار قیمتی از آخرین سقف یا کف عبور کند، آن سطح به عنوان حمایت یا مقاومت تاییدشده در نظر گرفته شده و با برچسبهای “CL” (کف تاییدشده) و “CH” (سقف تاییدشده) و خطوط نقطهچین رسم میشود.
ادغام با MACD:
از منطق کلاسیک کراساور/کراسآندر MACD استفاده شده است:
کراس صعودی: عبور خط MACD از بالای خط سیگنال.
کراس نزولی: عبور خط MACD از زیر خط سیگنال.
فیلتر سیگنال با ناحیه مجاور:
با استفاده از درصد ناحیه مجاور (Proximity Zone %)، فقط زمانی سیگنال صادر میشود که قیمت نزدیک حمایت یا مقاومت فعال باشد.
سیگنال خرید: وقتی قیمت در ناحیهی حمایت و همزمان MACD صعودی شود.
سیگنال فروش: وقتی قیمت در ناحیهی مقاومت و همزمان MACD نزولی شود.
تنظیمات ورودی
طول تأیید پیوتها
تنظیمات MACD (Fast, Slow, Signal)
درصد ناحیه مجاور برای فعال شدن سیگنالها
خروجیها
برچسبهای “CL” و “CH” برای سطوح تاییدشده
نشانگرهای “BUY” و “SELL” در محل صدور سیگنال
نکات کاربردی
بهترین عملکرد در تایمفریمهای بالاتر (۱ ساعته به بالا)
برای دقت بیشتر، آن را با فیلتر روند یا پرایساکشن ترکیب کنید
درصد ناحیه مجاور را با توجه به نوسانات دارایی تنظیم کنید
This indicator combines confirmed swing highs/lows (pivots) with MACD-based momentum signals to highlight key reversal and continuation points on the chart.
Core Logic
Confirmed Pivots:
The script identifies swing highs and lows using the user-defined pivot confirmation length.
Once a structure is broken beyond the last pivot, that level becomes a confirmed support (CL) or resistance (CH) line.
These levels are plotted as dashed horizontal rays and labeled directly on the chart.
MACD Integration:
The classic MACD crossover/under logic is used:
Bullish Crossover: MACD line crosses above the Signal line.
Bearish Crossunder: MACD line crosses below the Signal line.
Signal Filtering by Proximity:
A Proximity Zone (%) defines how close price must be to an active support or resistance to trigger a signal.
Buy Signal: When price is within the support zone and a bullish MACD crossover occurs.
Sell Signal: When price is within the resistance zone and a bearish MACD crossunder occurs.
Inputs
Pivot Confirmation Length: Bars used to confirm swing points.
MACD Fast/Slow/Signal Lengths: Standard MACD settings.
Proximity Zone (%): Defines zone width (e.g., 1% around active level).
Output
Labels: "CH" (Confirmed High) and "CL" (Confirmed Low) with color-coded dashed lines.
Signals: "BUY" and "SELL" markers appear when both pivot and MACD conditions align.
Tips
Works best on higher timeframes (H1 and above).
Combine with price action or trend filters for confirmation.
Use proximity percentage according to volatility (e.g., smaller % for low-vol assets).
⚠️ Disclaimer:
This script is provided for educational and informational purposes only.
It does not constitute financial or investment advice, and the author is not responsible for any financial losses that may occur from its use.
Always perform your own analysis and use this indicator together with other technical and risk management tools before making trading decisions.
---------------------------------------------------------------------------------------------
سقف و کف تاییدشده + سیگنالهای MACD
این اندیکاتور ترکیبی از شناسایی سقفها و کفهای تاییدشده (Pivot High/Low) به همراه سیگنالهای مومنتوم MACD است که نقاط برگشت یا ادامهی روند را روی چارت مشخص میکند.
🔹 منطق عملکرد
تایید سقف و کفها:
ابتدا سقف و کفهای محلی بر اساس تعداد کندلهای تنظیمشده شناسایی میشوند.
وقتی ساختار قیمتی از آخرین سقف یا کف عبور کند، آن سطح به عنوان حمایت یا مقاومت تاییدشده در نظر گرفته شده و با برچسبهای “CL” (کف تاییدشده) و “CH” (سقف تاییدشده) و خطوط نقطهچین رسم میشود.
ادغام با MACD:
از منطق کلاسیک کراساور/کراسآندر MACD استفاده شده است:
کراس صعودی: عبور خط MACD از بالای خط سیگنال.
کراس نزولی: عبور خط MACD از زیر خط سیگنال.
فیلتر سیگنال با ناحیه مجاور:
با استفاده از درصد ناحیه مجاور (Proximity Zone %)، فقط زمانی سیگنال صادر میشود که قیمت نزدیک حمایت یا مقاومت فعال باشد.
سیگنال خرید: وقتی قیمت در ناحیهی حمایت و همزمان MACD صعودی شود.
سیگنال فروش: وقتی قیمت در ناحیهی مقاومت و همزمان MACD نزولی شود.
تنظیمات ورودی
طول تأیید پیوتها
تنظیمات MACD (Fast, Slow, Signal)
درصد ناحیه مجاور برای فعال شدن سیگنالها
خروجیها
برچسبهای “CL” و “CH” برای سطوح تاییدشده
نشانگرهای “BUY” و “SELL” در محل صدور سیگنال
نکات کاربردی
بهترین عملکرد در تایمفریمهای بالاتر (۱ ساعته به بالا)
برای دقت بیشتر، آن را با فیلتر روند یا پرایساکشن ترکیب کنید
درصد ناحیه مجاور را با توجه به نوسانات دارایی تنظیم کنید
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。