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” در محل صدور سیگنال
نکات کاربردی
بهترین عملکرد در تایمفریمهای بالاتر (۱ ساعته به بالا)
برای دقت بیشتر، آن را با فیلتر روند یا پرایساکشن ترکیب کنید
درصد ناحیه مجاور را با توجه به نوسانات دارایی تنظیم کنید
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.