OPEN-SOURCE SCRIPT
CHoCH Fib Setup [Almaghamsi]

CHoCH Fib Setup is an educational overlay indicator that combines Change of Character (CHoCH) detection with Fibonacci retracement and extension levels.
The script is designed to help traders study one structured workflow on a single chart:
Identify a CHoCH on the current timeframe.
Draw Fibonacci levels on the impulse that produced that CHoCH.
Highlight a 0.5-0.618 pullback zone as a study area for potential entries.
Project extension targets at 1.272, 1.414, 2, 1.618 and 2.618.
Optionally filter setups with a higher-timeframe structure bias.
This is not a buy/sell signal service and it does not place trades. It is a visual study tool.
What the script does
The script uses pivot highs and lows to track the latest swing points. A bullish CHoCH is marked when price breaks above the last relevant swing high after a non-bullish bias. A bearish CHoCH is marked when price breaks below the last relevant swing low after a non-bearish bias. Users can require a close beyond the level or allow a wick break.
After a valid CHoCH, the script anchors a Fibonacci range to that impulse:
Retracement levels: 0, 0.236, 0.382, 0.5, 0.618, 0.786, 1.0
Entry study zone: 0.5 to 0.618
Stop-loss line at the opposite extreme of the impulse
Extension targets: 1.272, 1.414, 1.618 ,2 and 2.618
Each level is printed with its ratio and the actual price.
An optional higher-timeframe module reads the same structure logic on a user-selected timeframe. When enabled, long Fibonacci setups are drawn only if HTF bias is bullish, and short setups only if HTF bias is bearish. Counter-trend CHoCH events can still appear as faded labels ending with "x".
The settings panel is bilingual (English / Arabic), with English first. On-chart labels default to English and can be switched to Arabic.
Why this combination exists
CHoCH, Fibonacci retracements, Fibonacci extensions, and multi-timeframe bias are established public concepts. This script does not invent those concepts. Its purpose is to keep them in one readable workflow so the user does not have to draw the Fib range manually after every CHoCH.
The script is original as a packaged study layout: aligned CHoCH-to-Fib mapping, optional HTF gating, price labels on targets, and a bilingual interface. It does not claim to reverse-engineer any closed-source vendor tool.
How to use
Add the indicator to a standard candlestick chart.
Choose a working timeframe. Example: 15 minutes for entries.
Enable the HTF filter if desired and set a larger interval. Example: 60 on a 15-minute chart.
Wait for a CHoCH in the direction of the HTF bias.
Use the 0.5-0.618 box only as a pullback study zone, not as an automatic order.
Treat the red line as a structural invalidation reference, not a broker order.
Treat 1.272 / 1.414 / 1.618 /2 /2.618 as measured extension references only.
Confirm context with your own analysis and risk limits.
Limitations
Pivot length changes the CHoCH results. This is a simplified swing-break model and not a full Smart Money Concepts suite. It does not plot order blocks, FVGs, or liquidity pools. HTF bias can change until the higher-timeframe bar closes. The script keeps the latest aligned Fibonacci setup, not unlimited history. Pivot confirmation needs right-side bars, which is normal for pivot logic. There is no win rate because this is an indicator, not a strategy().
Disclaimer
This script is provided for education and chart study only. It is not investment advice, financial advice, trading advice, or a recommendation to buy or sell any instrument. Markets involve a high risk of loss. Past behavior around CHoCH or Fibonacci levels does not predict future results. Users are responsible for their own decisions, position sizing, and local regulations.
Open-source note
This publication is open-source so users can inspect the logic. If you reuse parts of the code in a public script, credit this publication and add a meaningful improvement before publishing.
مؤشر CHoCH Fib Setup أداة تعليمية على الشارت تجمع بين اكتشاف تغيير صفة الحركة (CHoCH) ومستويات فيبوناتشي للتصحيح والامتداد.
الهدف هو دراسة مسار واحد على نفس الشارت:
تحديد CHoCH على الفريم الحالي.
رسم فيبوناتشي على موجة الاندفاع التي صنعته.
تظليل منطقة 0.5 إلى 0.618 كمنطقة دراسة للدخول المحتمل.
إسقاط أهداف 1.272 و 1.414 و 1.618 و 2 و2.618.
إمكانية فلترة السيتب باتجاه الفريم الأعلى.
هذه ليست خدمة توصيات ولا تفتح صفقات تلقائيًا. هي أداة بصرية للدراسة.
ماذا يفعل المؤشر
يستخدم قممًا وقيعانًا محورية لتتبع آخر نقاط التأرجح. يُعلَّم CHoCH الصاعد عند كسر آخر قمة محورية بعد انحياز غير صاعد، والهابط عند كسر آخر قاع محوري بعد انحياز غير هابط. يمكن اشتراط الإغلاق أو السماح بكسر الظل.
بعد CHoCH صالح يُثبَّت فيبوناتشي على الموجة، مع منطقة 0.5-0.618 وخط إبطال عند طرف الموجة وأهداف امتداد 1.272 و 1.414 و 1.618 و 2 و 2.618، وكل مستوى يظهر مع سعره.
فلتر الفريم الأعلى اختياري. عند تفعيله يُرسم سيتر الشراء فقط إذا كان الفريم الأعلى صاعدًا، وسيتر البيع فقط إذا كان هابطًا. أحداث CHoCH المخالفة يمكن أن تظهر باهتة وتنتهي بـ x.
لوحة الإعدادات ثنائية اللغة والإنجليزية أولًا. نصوص الشارت افتراضيًا بالإنجليزية ويمكن تحويلها للعربية.
لماذا هذا التجميع
المفاهيم عامة ومعروفة. المؤشر لا يدّعي اختراعها. الغرض جمعها في مسار واحد حتى لا يُرسم الفيبو يدويًا بعد كل CHoCH. الأصالة في التغليف: ربط CHoCH بالفيبو، فلتر الفريم الأعلى، السعر على الأهداف، وواجهة ثنائية اللغة.
طريقة الاستخدام
أضف المؤشر على شارت شموع قياسي، اختر فريم العمل، فعّل الفلتر إن أردت، وانتظر CHoCH مع اتجاه الفريم الأعلى. صندوق 0.5-0.618 منطقة دراسة فقط، والخط الأحمر مرجع إبطال، والأهداف مراجع قياس. أكّد دائمًا بتحليلك وحدود المخاطرة.
القيود
النتيجة تتغير مع طول المحور. النموذج مبسّط ولا يرسم كتل أوامر ولا فجوات قيمة عادلة. انحياز الفريم الأعلى قد يتغير قبل إغلاق شمعة ذلك الفريم. لا توجد نسبة نجاح لأن هذا مؤشر وليس استراتيجية.
إخلاء المسؤولية
هذا المؤشر للتعليم ودراسة الشارت فقط، وليس استشارة استثمارية ولا توصية بشراء أو بيع أي أداة. التداول ينطوي على مخاطر خسارة مرتفعة، والسلوك السابق لا يتنبأ بالنتائج المستقبلية. المستخدم مسؤول عن قراراته وحجم المخاطرة والأنظمة المحلية.
ملاحظة المصدر المفتوح
نُشر السكربت مفتوح المصدر لمراجعة المنطق. إذا أعدت استخدام أجزاء منه في منشور عام، اذكر هذا المنشور وأضف تحسينًا حقيقيًا قبل النشر.
The script is designed to help traders study one structured workflow on a single chart:
Identify a CHoCH on the current timeframe.
Draw Fibonacci levels on the impulse that produced that CHoCH.
Highlight a 0.5-0.618 pullback zone as a study area for potential entries.
Project extension targets at 1.272, 1.414, 2, 1.618 and 2.618.
Optionally filter setups with a higher-timeframe structure bias.
This is not a buy/sell signal service and it does not place trades. It is a visual study tool.
What the script does
The script uses pivot highs and lows to track the latest swing points. A bullish CHoCH is marked when price breaks above the last relevant swing high after a non-bullish bias. A bearish CHoCH is marked when price breaks below the last relevant swing low after a non-bearish bias. Users can require a close beyond the level or allow a wick break.
After a valid CHoCH, the script anchors a Fibonacci range to that impulse:
Retracement levels: 0, 0.236, 0.382, 0.5, 0.618, 0.786, 1.0
Entry study zone: 0.5 to 0.618
Stop-loss line at the opposite extreme of the impulse
Extension targets: 1.272, 1.414, 1.618 ,2 and 2.618
Each level is printed with its ratio and the actual price.
An optional higher-timeframe module reads the same structure logic on a user-selected timeframe. When enabled, long Fibonacci setups are drawn only if HTF bias is bullish, and short setups only if HTF bias is bearish. Counter-trend CHoCH events can still appear as faded labels ending with "x".
The settings panel is bilingual (English / Arabic), with English first. On-chart labels default to English and can be switched to Arabic.
Why this combination exists
CHoCH, Fibonacci retracements, Fibonacci extensions, and multi-timeframe bias are established public concepts. This script does not invent those concepts. Its purpose is to keep them in one readable workflow so the user does not have to draw the Fib range manually after every CHoCH.
The script is original as a packaged study layout: aligned CHoCH-to-Fib mapping, optional HTF gating, price labels on targets, and a bilingual interface. It does not claim to reverse-engineer any closed-source vendor tool.
How to use
Add the indicator to a standard candlestick chart.
Choose a working timeframe. Example: 15 minutes for entries.
Enable the HTF filter if desired and set a larger interval. Example: 60 on a 15-minute chart.
Wait for a CHoCH in the direction of the HTF bias.
Use the 0.5-0.618 box only as a pullback study zone, not as an automatic order.
Treat the red line as a structural invalidation reference, not a broker order.
Treat 1.272 / 1.414 / 1.618 /2 /2.618 as measured extension references only.
Confirm context with your own analysis and risk limits.
Limitations
Pivot length changes the CHoCH results. This is a simplified swing-break model and not a full Smart Money Concepts suite. It does not plot order blocks, FVGs, or liquidity pools. HTF bias can change until the higher-timeframe bar closes. The script keeps the latest aligned Fibonacci setup, not unlimited history. Pivot confirmation needs right-side bars, which is normal for pivot logic. There is no win rate because this is an indicator, not a strategy().
Disclaimer
This script is provided for education and chart study only. It is not investment advice, financial advice, trading advice, or a recommendation to buy or sell any instrument. Markets involve a high risk of loss. Past behavior around CHoCH or Fibonacci levels does not predict future results. Users are responsible for their own decisions, position sizing, and local regulations.
Open-source note
This publication is open-source so users can inspect the logic. If you reuse parts of the code in a public script, credit this publication and add a meaningful improvement before publishing.
مؤشر CHoCH Fib Setup أداة تعليمية على الشارت تجمع بين اكتشاف تغيير صفة الحركة (CHoCH) ومستويات فيبوناتشي للتصحيح والامتداد.
الهدف هو دراسة مسار واحد على نفس الشارت:
تحديد CHoCH على الفريم الحالي.
رسم فيبوناتشي على موجة الاندفاع التي صنعته.
تظليل منطقة 0.5 إلى 0.618 كمنطقة دراسة للدخول المحتمل.
إسقاط أهداف 1.272 و 1.414 و 1.618 و 2 و2.618.
إمكانية فلترة السيتب باتجاه الفريم الأعلى.
هذه ليست خدمة توصيات ولا تفتح صفقات تلقائيًا. هي أداة بصرية للدراسة.
ماذا يفعل المؤشر
يستخدم قممًا وقيعانًا محورية لتتبع آخر نقاط التأرجح. يُعلَّم CHoCH الصاعد عند كسر آخر قمة محورية بعد انحياز غير صاعد، والهابط عند كسر آخر قاع محوري بعد انحياز غير هابط. يمكن اشتراط الإغلاق أو السماح بكسر الظل.
بعد CHoCH صالح يُثبَّت فيبوناتشي على الموجة، مع منطقة 0.5-0.618 وخط إبطال عند طرف الموجة وأهداف امتداد 1.272 و 1.414 و 1.618 و 2 و 2.618، وكل مستوى يظهر مع سعره.
فلتر الفريم الأعلى اختياري. عند تفعيله يُرسم سيتر الشراء فقط إذا كان الفريم الأعلى صاعدًا، وسيتر البيع فقط إذا كان هابطًا. أحداث CHoCH المخالفة يمكن أن تظهر باهتة وتنتهي بـ x.
لوحة الإعدادات ثنائية اللغة والإنجليزية أولًا. نصوص الشارت افتراضيًا بالإنجليزية ويمكن تحويلها للعربية.
لماذا هذا التجميع
المفاهيم عامة ومعروفة. المؤشر لا يدّعي اختراعها. الغرض جمعها في مسار واحد حتى لا يُرسم الفيبو يدويًا بعد كل CHoCH. الأصالة في التغليف: ربط CHoCH بالفيبو، فلتر الفريم الأعلى، السعر على الأهداف، وواجهة ثنائية اللغة.
طريقة الاستخدام
أضف المؤشر على شارت شموع قياسي، اختر فريم العمل، فعّل الفلتر إن أردت، وانتظر CHoCH مع اتجاه الفريم الأعلى. صندوق 0.5-0.618 منطقة دراسة فقط، والخط الأحمر مرجع إبطال، والأهداف مراجع قياس. أكّد دائمًا بتحليلك وحدود المخاطرة.
القيود
النتيجة تتغير مع طول المحور. النموذج مبسّط ولا يرسم كتل أوامر ولا فجوات قيمة عادلة. انحياز الفريم الأعلى قد يتغير قبل إغلاق شمعة ذلك الفريم. لا توجد نسبة نجاح لأن هذا مؤشر وليس استراتيجية.
إخلاء المسؤولية
هذا المؤشر للتعليم ودراسة الشارت فقط، وليس استشارة استثمارية ولا توصية بشراء أو بيع أي أداة. التداول ينطوي على مخاطر خسارة مرتفعة، والسلوك السابق لا يتنبأ بالنتائج المستقبلية. المستخدم مسؤول عن قراراته وحجم المخاطرة والأنظمة المحلية.
ملاحظة المصدر المفتوح
نُشر السكربت مفتوح المصدر لمراجعة المنطق. إذا أعدت استخدام أجزاء منه في منشور عام، اذكر هذا المنشور وأضف تحسينًا حقيقيًا قبل النشر.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.