Base Candles, Engulfing

Overview
Base Candles, Engulfing and Liquidity Sweeps is a chart-overlay indicator for reviewing candle structure and subsequent price movement around confirmed engulfing candles.
The indicator brings together three related observations:
Small-body candles, labeled as base candles under a configurable body-to-range definition.
Bullish and bearish engulfing patterns with strict or tolerance-based opening requirements.
Subsequent breakouts and breakdowns of saved engulfing-candle reference levels.
An optional previous-bar liquidity sweep detector and three configurable moving averages provide additional visual context.
The purpose of this combination is to separate pattern identification from subsequent level confirmation. An engulfing candle establishes a reference; later candles are evaluated against that reference rather than against their own high or low.
1. Base Candle Detection
A candle qualifies as a base candle when its absolute body size is no greater than the selected percentage of its full high-low range.
The default threshold is 15%.
A small marker is placed at the midpoint of the candle body. Its color is configurable.
In this indicator, “base candle” is a small-body classification only. It does not automatically identify a supply or demand base, consolidation zone, or order block. Candles with a zero high-low range are excluded.
2. Engulfing Candle Detection
Both bullish and bearish engulfing patterns require the current candle body to be larger than the previous candle body.
By default, the previous candle must have the opposite direction:
A bullish engulfing candle must follow a bearish candle.
A bearish engulfing candle must follow a bullish candle.
The “Allow Same-Direction Candles” setting removes this direction requirement. When enabled, a previous candle with equal open and close is also eligible if the remaining conditions are satisfied.
Strict Mode
A bullish pattern requires:
A bullish current candle.
An open at or below the lower edge of the previous body.
A close at or above the upper edge of the previous body.
A body larger than the previous body.
A bearish pattern applies the opposite conditions.
Strict mode does not use the opening tolerance.
Flexible Mode
Flexible mode allows the current candle to open slightly inside the previous candle body.
The allowed penetration is calculated as a percentage of the previous body size. The default allowance is 10%.
For example, if the previous body size is 1.00, a 10% allowance permits an opening penetration of up to 0.10.
A bullish pattern must still close strictly above the previous body. A bearish pattern must close strictly below it. The current body must remain larger than the previous body.
Disabling opening penetration sets the allowance to zero.
3. Engulfing Reference Breakouts and Breakdowns
The indicator saves reference levels only after an engulfing candle has closed.
Two reference modes are available:
Latest Engulfing Candle — Either Direction
The high and low of the most recent confirmed engulfing candle are used for both directions:
A bullish breakout occurs above its high.
A bearish breakdown occurs below its low.
A new confirmed engulfing candle replaces both reference levels.
By Direction — Bullish High / Bearish Low
The references are tracked separately:
Bullish breakouts use the high of the latest confirmed bullish engulfing candle.
Bearish breakdowns use the low of the latest confirmed bearish engulfing candle.
Updating one direction does not replace the other direction’s reference.
Reference Handling and Signal Repetition
The current bar is checked against the previously saved reference before any new engulfing reference is stored.
This prevents a candle from being evaluated against its own newly saved levels. A candle that is itself engulfing may still produce a valid signal against an earlier reference.
Each reference allows one breakout signal above its high and one breakdown signal below its low. The two sides are tracked independently.
The optional fresh-cross requirement adds the following conditions:
For a breakout, the previous close must be at or below the reference high.
For a breakdown, the previous close must be at or above the reference low.
An exact touch of the reference level is not sufficient. Price must be strictly above the high or below the low.
4. Previous-Bar Liquidity Sweeps
The sweep detector uses the immediately preceding candle’s high or low. It does not search for swing points, equal highs or lows, session levels, or higher-timeframe liquidity.
A bullish sweep requires:
A low below the previous candle’s low.
A bullish current candle.
A qualifying recovery close.
A bearish sweep requires:
A high above the previous candle’s high.
A bearish current candle.
A qualifying rejection close.
Two closing requirements are available:
Beyond Previous Candle Body: a bullish sweep closes above the previous body; a bearish sweep closes below it.
Back Across Swept Level: a bullish sweep closes above the previous low; a bearish sweep closes below the previous high.
The optional wick-only requirement keeps the candle body on the reclaimed side of the swept level.
These signals describe a price pattern. They do not verify the presence or execution of stop orders, institutional activity, or actual liquidity transactions.
5. Moving Averages
Three moving averages are included for optional visual context.
Each supports:
SMA
EMA
WMA
DEMA
TEMA
HMA
VWMA
The default configuration is:
MA 1: SMA, length 8.
MA 2: EMA, length 20.
MA 3: HMA, length 50.
The moving averages do not filter or modify the engulfing, breakout, breakdown, or sweep conditions.
6. Visual Controls
The indicator provides:
A small base-candle marker.
Configurable engulfing candle colors.
Level marks on displayed bullish and bearish engulfing candles.
Optional liquidity sweep arrows.
Breakout and breakdown triangles.
Two optional short reference lines beside the latest bar.
The short reference lines show the latest saved levels, without drawing a historical reference-line trail. They remain visible until the reference changes, even if a signal has already occurred at that level.
Hiding engulfing candle colors does not stop those patterns from being detected or saved as references.
Hiding liquidity sweep arrows does not disable their alert conditions.
7. Bar-Close Confirmation and Live-Bar Behavior
Separate confirmation settings are provided for:
Engulfing candle display.
Breakout and breakdown signals.
Liquidity sweep signals.
All three confirmation settings are enabled by default.
When confirmation is disabled, qualifying conditions may appear and disappear while the current bar is forming. Intrabar signals are provisional and may not remain after the bar closes or the chart is reloaded.
Engulfing reference levels are always updated only at bar close, regardless of the display confirmation setting.
Base-candle markers are not controlled by these confirmation options and may change while the current candle is forming.
The script uses chart-timeframe data and does not request other timeframes or use future-confirmed pivot detection.
8. Alerts
Four alert conditions are available:
Engulfing Reference High Breakout.
Engulfing Reference Low Breakdown.
Bullish Liquidity Sweep.
Bearish Liquidity Sweep.
Alerts must be created manually using TradingView’s alert interface.
For close-confirmed use, keep the relevant confirmation option enabled and select “Once Per Bar Close” when creating the alert.
The breakout and breakdown enable switches control their respective signals and alert conditions.
Suggested Workflow
Choose strict or flexible engulfing detection.
Select whether opposite-direction candles are required.
Choose the engulfing reference mode.
Observe subsequent price movement relative to the saved reference levels.
Use optional sweep markers and moving averages as additional context.
Base markers and sweep conditions are separate observations. They are not mandatory filters for engulfing breakouts or breakdowns.
Design Rationale
The candle concepts and moving-average formulas used here are established techniques. The implementation combines them into a specific pattern-to-reference workflow:
Configurable engulfing detection establishes the reference.
Confirmed reference storage separates pattern formation from later level testing.
Independent high and low tracking limits repeated signals for each reference.
Display controls allow a cleaner chart without changing the underlying pattern calculations.
Optional sweeps provide a separate view of previous-bar level rejection, rather than being treated as identical to engulfing patterns.
The indicator is intended to make these distinctions explicit and configurable, not to claim that familiar candle patterns constitute a new market theory.
Limitations
This is an indicator, not an automated trading strategy or a backtested trading system.
It does not:
Automatically identify supply and demand zones or order blocks.
Confirm actual stop-order execution.
Provide position sizing, stop-loss placement, or profit targets.
Establish profitability or a signal win rate.
Signals can fail, and their usefulness depends on the instrument, timeframe, settings, and broader market context.
Use standard candlestick charts when evaluating the patterns. Results on synthetic or non-standard chart types may differ because their candle values are constructed differently.
This tool is provided for educational and analytical purposes and does not constitute a recommendation to buy or sell.
نظرة عامة
مؤشر «شموع البيس والابتلاع وسحب السيولة» هو أداة تُعرض على الشارت الرئيسي، وتهدف إلى مراجعة بنية الشموع ومتابعة حركة السعر حول مستويات الشموع الابتلاعية المؤكدة.
يجمع المؤشر بين ثلاث ملاحظات مترابطة:
تحديد الشموع صغيرة الجسم، وتسميتها «شموع البيس» وفق نسبة قابلة للتعديل بين الجسم والمدى الكامل للشمعة.
اكتشاف الابتلاع الصاعد والهابط، بشروط صارمة أو بشروط مرنة تسمح بسماحية محددة لمكان الافتتاح.
متابعة اختراق أو كسر المستويات المرجعية المحفوظة للشموع الابتلاعية.
كما يتضمن رصدًا اختياريًا لسحب قمة أو قاع الشمعة السابقة، وثلاثة متوسطات متحركة قابلة للتخصيص لتوفير سياق بصري إضافي.
الهدف من هذا الجمع هو فصل اكتشاف النمط عن تأكيد حركة السعر اللاحقة: تُنشئ الشمعة الابتلاعية مستوى مرجعيًا، ثم تُقاس الشموع التالية عليه، بدل مقارنة الشمعة بقمتها أو قاعها هي نفسها.
1. تحديد شمعة البيس
تُصنّف الشمعة على أنها شمعة بيس عندما لا يتجاوز حجم جسمها النسبة المحددة من مداها الكامل بين أعلى وأدنى سعر.
النسبة الافتراضية هي 15%.
تظهر علامة صغيرة عند منتصف جسم الشمعة، ويمكن تغيير لونها من الإعدادات.
مصطلح «البيس» في هذا المؤشر يعني تصنيفًا للشموع صغيرة الجسم فقط. ولا يعني أن المؤشر يحدد تلقائيًا مناطق العرض والطلب أو مناطق التجميع أو كتل الأوامر. تُستبعد الشموع التي يتساوى فيها أعلى وأدنى سعر.
2. اكتشاف الشموع الابتلاعية
يشترط المؤشر في الابتلاع الصاعد والهابط أن يكون جسم الشمعة الحالية أكبر من جسم الشمعة السابقة.
افتراضيًا، يجب أن تكون الشمعة السابقة معاكسة لاتجاه الشمعة الحالية:
الابتلاع الصاعد تسبقه شمعة هابطة.
الابتلاع الهابط تسبقه شمعة صاعدة.
يمكن إلغاء هذا الشرط بتفعيل خيار «السماح بأن تكون الشمعتان من الاتجاه نفسه». وعند تفعيله، يمكن أيضًا قبول شمعة سابقة يتساوى افتتاحها وإغلاقها إذا تحققت بقية الشروط.
الوضع الصارم
يشترط الابتلاع الصاعد:
أن تكون الشمعة الحالية صاعدة.
أن يكون افتتاحها عند الحد السفلي لجسم الشمعة السابقة أو أسفله.
أن يكون إغلاقها عند الحد العلوي لجسم الشمعة السابقة أو أعلاه.
أن يكون جسمها أكبر من جسم الشمعة السابقة.
تُعكس هذه الشروط للابتلاع الهابط.
لا تُستخدم سماحية الافتتاح في الوضع الصارم.
الوضع المرن
يسمح الوضع المرن بافتتاح الشمعة الحالية داخل جسم الشمعة السابقة بمقدار محدد.
تُحسب السماحية كنسبة من حجم جسم الشمعة السابقة، والقيمة الافتراضية هي 10%.
مثلًا: إذا كان حجم الجسم السابق يساوي وحدة سعرية واحدة، فإن سماحية 10% تسمح بدخول الافتتاح داخل الجسم السابق بمقدار 0.10 وحدة سعرية.
مع ذلك، يجب:
أن يغلق الابتلاع الصاعد أعلى جسم الشمعة السابقة.
أن يغلق الابتلاع الهابط أسفل جسم الشمعة السابقة.
أن يظل الجسم الحالي أكبر من الجسم السابق.
عند تعطيل السماح بالافتتاح داخل الجسم السابق، تصبح السماحية صفرًا.
3. اختراق وكسر مستويات الشموع الابتلاعية
لا يحفظ المؤشر الشمعة الابتلاعية كمرجع إلا بعد إغلاقها.
يوفر المؤشر وضعين لاختيار المرجع:
آخر شمعة ابتلاعية، بصرف النظر عن اتجاهها
تُستخدم قمة وقاع آخر شمعة ابتلاعية مؤكدة:
يحدث الاختراق الصاعد عند تجاوز قمتها.
يحدث الكسر الهابط عند النزول أسفل قاعها.
عند ظهور ابتلاعية مؤكدة جديدة، تُستبدل القمة والقاع المرجعيان بمستوياتها.
حسب الاتجاه: قمة الصاعدة وقاع الهابطة
تُتابع المراجع بصورة منفصلة:
الاختراق الصاعد يُقاس على قمة آخر ابتلاعية صاعدة مؤكدة.
الكسر الهابط يُقاس على قاع آخر ابتلاعية هابطة مؤكدة.
تحديث مرجع أحد الاتجاهين لا يستبدل مرجع الاتجاه الآخر.
ترتيب الفحص ومنع تكرار الإشارات
يفحص المؤشر الشمعة الحالية مقابل المرجع المحفوظ سابقًا، ثم يحدّث المرجع إذا أغلقت الشمعة الحالية كابتلاعية جديدة.
يمنع ذلك قياس الشمعة على مستوياتها التي حُفظت للتو. ومع ذلك، يمكن أن تكون شمعة الإشارة ابتلاعية أيضًا إذا اخترقت أو كسرت مرجعًا سابقًا بالفعل.
يسمح كل مرجع بإشارة اختراق واحدة لقمته، وإشارة كسر واحدة لقاعه. ويُتابع كل جانب بصورة مستقلة.
يوفر خيار «اشتراط عبور المستوى في الشمعة الحالية» شرطًا إضافيًا:
للاختراق: يكون الإغلاق السابق عند القمة المرجعية أو أسفلها.
للكسر: يكون الإغلاق السابق عند القاع المرجعي أو أعلاه.
ملامسة المستوى أو الإغلاق عنده تمامًا لا تكفي؛ يجب أن يكون السعر أعلى القمة أو أسفل القاع.
4. سحب سيولة الشمعة السابقة
يعتمد هذا الجزء على قمة أو قاع الشمعة السابقة مباشرةً. ولا يبحث عن القمم والقيعان الهيكلية، أو القمم والقيعان المتساوية، أو مستويات الجلسات، أو مستويات الفواصل الزمنية الأعلى.
يشترط سحب السيولة الصاعد:
تسجيل قاع أقل من قاع الشمعة السابقة.
أن تكون الشمعة الحالية صاعدة.
تحقق شرط الإغلاق المختار.
ويشترط سحب السيولة الهابط:
تسجيل قمة أعلى من قمة الشمعة السابقة.
أن تكون الشمعة الحالية هابطة.
تحقق شرط الإغلاق المختار.
يتوفر خياران للإغلاق:
خارج جسم الشمعة السابقة: يغلق السحب الصاعد فوق جسم السابقة، ويغلق السحب الهابط تحته.
العودة خلف المستوى المسحوب: يغلق السحب الصاعد فوق القاع السابق، ويغلق السحب الهابط تحت القمة السابقة.
كما يمكن اشتراط أن يكون تجاوز المستوى بالذيل فقط، بحيث يبقى جسم الشمعة على الجانب الذي استعادته من المستوى.
تصف هذه الإشارات نمطًا سعريًا فقط، ولا تثبت وجود أو تنفيذ أوامر وقف، أو نشاط مؤسسي، أو معاملات سيولة فعلية.
5. المتوسطات المتحركة
يتضمن المؤشر ثلاثة متوسطات متحركة اختيارية لتوفير سياق بصري إضافي.
يمكن اختيار أحد الأنواع التالية لكل متوسط:
المتوسط البسيط SMA.
المتوسط الأسي EMA.
المتوسط المرجح WMA.
المتوسط الأسي المزدوج DEMA.
المتوسط الأسي الثلاثي TEMA.
متوسط هال HMA.
المتوسط المرجح بالحجم VWMA.
الإعدادات الافتراضية:
المتوسط الأول: SMA بطول 8.
المتوسط الثاني: EMA بطول 20.
المتوسط الثالث: HMA بطول 50.
المتوسطات للعرض فقط؛ لا تُستخدم كفلاتر لشروط الابتلاع أو الاختراق أو الكسر أو سحب السيولة.
6. خيارات العرض
يوفر المؤشر:
علامة صغيرة لشموع البيس.
ألوانًا قابلة للتخصيص للشموع الابتلاعية.
علامات مستويات على قمم الابتلاع الصاعد وقيعان الابتلاع الهابط المعروضة.
أسهمًا اختيارية لسحب السيولة.
مثلثات للاختراق والكسر.
خطّين مرجعيين قصيرين اختياريين بجانب آخر شمعة.
يعرض الخطّان القصيران أحدث المستويات المرجعية المحفوظة، دون رسم مسار تاريخي لهذه الخطوط. ويستمران حتى يتغير المرجع، حتى لو سبق صدور إشارة على المستوى.
إخفاء ألوان الابتلاع لا يمنع اكتشافه أو حفظه كمرجع.
وإخفاء أسهم سحب السيولة لا يعطّل شروط تنبيهاته.
7. تأكيد الإغلاق وسلوك الشمعة الحالية
تتوفر إعدادات مستقلة لتأكيد:
عرض الشموع الابتلاعية.
إشارات الاختراق والكسر.
إشارات سحب السيولة.
تكون إعدادات التأكيد الثلاثة مفعّلة افتراضيًا.
عند تعطيل التأكيد، قد تظهر الشروط وتختفي أثناء تكوّن الشمعة الحالية. لذلك تُعد الإشارات اللحظية مؤقتة، وقد لا تبقى بعد إغلاق الشمعة أو إعادة تحميل الشارت.
تُحدّث مستويات الابتلاع المرجعية بعد الإغلاق فقط، بصرف النظر عن إعداد تأكيد عرض الابتلاع.
أما علامات البيس فلا تخضع لإعدادات التأكيد السابقة، وقد تتغير أثناء تكوّن الشمعة.
يستخدم المؤشر بيانات الفاصل الزمني الحالي للشارت، ولا يطلب بيانات من فواصل أخرى، ولا يستخدم اكتشاف قمم وقيعان يتطلب شموعًا مستقبلية للتأكيد.
8. التنبيهات
يوفر المؤشر أربعة شروط للتنبيه:
اختراق قمة الشمعة الابتلاعية المرجعية.
كسر قاع الشمعة الابتلاعية المرجعية.
سحب سيولة صاعد.
سحب سيولة هابط.
يجب إنشاء التنبيهات يدويًا من واجهة تنبيهات TradingView.
للاستخدام المؤكد بالإغلاق، يُترك خيار التأكيد المرتبط بالإشارة مفعّلًا، ويُختار «مرة واحدة عند إغلاق الشمعة» عند إنشاء التنبيه.
يتحكم خيارا تفعيل الاختراق والكسر في إشاراتهما وشروط تنبيهاتهما.
طريقة استخدام مقترحة
اختيار وضع الابتلاع الصارم أو المرن.
تحديد ما إذا كان اختلاف اتجاه الشمعتين مطلوبًا.
اختيار وضع المرجع المستخدم للاختراق والكسر.
متابعة حركة السعر اللاحقة حول المستويات المرجعية المحفوظة.
استخدام علامات سحب السيولة والمتوسطات اختياريًا كسياق إضافي.
علامات البيس وشروط سحب السيولة ملاحظات مستقلة، وليست فلاتر إلزامية لإشارات اختراق أو كسر الابتلاع.
فكرة التصميم
يعتمد المؤشر على مفاهيم معروفة في تحليل الشموع وصيغ المتوسطات المتحركة. ويجمعها في تسلسل محدد يبدأ بالنمط وينتهي بمتابعة مستوياته:
اكتشاف الابتلاع وفق شروط قابلة للتخصيص.
حفظ المرجع بعد الإغلاق لفصل تكوّن النمط عن اختبار مستوياته لاحقًا.
متابعة القمة والقاع بصورة مستقلة لتقليل تكرار الإشارات لكل مرجع.
فصل خيارات العرض عن الحساب للمحافظة على وضوح الشارت.
تقديم سحب قمة أو قاع الشمعة السابقة كملاحظة منفصلة، وليس باعتباره مطابقًا للابتلاع.
الغرض هو جعل هذه الفروق واضحة وقابلة للتحكم، وليس الادعاء بأن أنماط الشموع المعروفة تمثل نظرية سوق جديدة.
الحدود والتنبيهات المهمة
هذا مؤشر تحليلي، وليس استراتيجية تداول آلية أو نظامًا خضع لاختبار تاريخي للأداء.
لا يقوم المؤشر بما يلي:
تحديد مناطق العرض والطلب أو كتل الأوامر تلقائيًا.
إثبات تنفيذ أوامر الوقف الفعلية.
تحديد حجم الصفقة أو وقف الخسارة أو الأهداف.
إثبات الربحية أو تحديد نسبة نجاح للإشارات.
قد تفشل الإشارات، وتعتمد فائدتها على الأصل المالي والفاصل الزمني والإعدادات والسياق العام للسوق.
يُفضّل تقييم الأنماط على شارت الشموع العادية. وقد تختلف النتائج على أنواع الشارت الاصطناعية أو غير التقليدية بسبب اختلاف طريقة بناء أسعار شموعها.
هذه الأداة مخصصة للأغراض التعليمية والتحليلية، ولا تمثل توصية بالشراء أو البيع.
Base Candles, Engulfing and Liquidity Sweeps is a chart-overlay indicator for reviewing candle structure and subsequent price movement around confirmed engulfing candles.
The indicator brings together three related observations:
Small-body candles, labeled as base candles under a configurable body-to-range definition.
Bullish and bearish engulfing patterns with strict or tolerance-based opening requirements.
Subsequent breakouts and breakdowns of saved engulfing-candle reference levels.
An optional previous-bar liquidity sweep detector and three configurable moving averages provide additional visual context.
The purpose of this combination is to separate pattern identification from subsequent level confirmation. An engulfing candle establishes a reference; later candles are evaluated against that reference rather than against their own high or low.
1. Base Candle Detection
A candle qualifies as a base candle when its absolute body size is no greater than the selected percentage of its full high-low range.
The default threshold is 15%.
A small marker is placed at the midpoint of the candle body. Its color is configurable.
In this indicator, “base candle” is a small-body classification only. It does not automatically identify a supply or demand base, consolidation zone, or order block. Candles with a zero high-low range are excluded.
2. Engulfing Candle Detection
Both bullish and bearish engulfing patterns require the current candle body to be larger than the previous candle body.
By default, the previous candle must have the opposite direction:
A bullish engulfing candle must follow a bearish candle.
A bearish engulfing candle must follow a bullish candle.
The “Allow Same-Direction Candles” setting removes this direction requirement. When enabled, a previous candle with equal open and close is also eligible if the remaining conditions are satisfied.
Strict Mode
A bullish pattern requires:
A bullish current candle.
An open at or below the lower edge of the previous body.
A close at or above the upper edge of the previous body.
A body larger than the previous body.
A bearish pattern applies the opposite conditions.
Strict mode does not use the opening tolerance.
Flexible Mode
Flexible mode allows the current candle to open slightly inside the previous candle body.
The allowed penetration is calculated as a percentage of the previous body size. The default allowance is 10%.
For example, if the previous body size is 1.00, a 10% allowance permits an opening penetration of up to 0.10.
A bullish pattern must still close strictly above the previous body. A bearish pattern must close strictly below it. The current body must remain larger than the previous body.
Disabling opening penetration sets the allowance to zero.
3. Engulfing Reference Breakouts and Breakdowns
The indicator saves reference levels only after an engulfing candle has closed.
Two reference modes are available:
Latest Engulfing Candle — Either Direction
The high and low of the most recent confirmed engulfing candle are used for both directions:
A bullish breakout occurs above its high.
A bearish breakdown occurs below its low.
A new confirmed engulfing candle replaces both reference levels.
By Direction — Bullish High / Bearish Low
The references are tracked separately:
Bullish breakouts use the high of the latest confirmed bullish engulfing candle.
Bearish breakdowns use the low of the latest confirmed bearish engulfing candle.
Updating one direction does not replace the other direction’s reference.
Reference Handling and Signal Repetition
The current bar is checked against the previously saved reference before any new engulfing reference is stored.
This prevents a candle from being evaluated against its own newly saved levels. A candle that is itself engulfing may still produce a valid signal against an earlier reference.
Each reference allows one breakout signal above its high and one breakdown signal below its low. The two sides are tracked independently.
The optional fresh-cross requirement adds the following conditions:
For a breakout, the previous close must be at or below the reference high.
For a breakdown, the previous close must be at or above the reference low.
An exact touch of the reference level is not sufficient. Price must be strictly above the high or below the low.
4. Previous-Bar Liquidity Sweeps
The sweep detector uses the immediately preceding candle’s high or low. It does not search for swing points, equal highs or lows, session levels, or higher-timeframe liquidity.
A bullish sweep requires:
A low below the previous candle’s low.
A bullish current candle.
A qualifying recovery close.
A bearish sweep requires:
A high above the previous candle’s high.
A bearish current candle.
A qualifying rejection close.
Two closing requirements are available:
Beyond Previous Candle Body: a bullish sweep closes above the previous body; a bearish sweep closes below it.
Back Across Swept Level: a bullish sweep closes above the previous low; a bearish sweep closes below the previous high.
The optional wick-only requirement keeps the candle body on the reclaimed side of the swept level.
These signals describe a price pattern. They do not verify the presence or execution of stop orders, institutional activity, or actual liquidity transactions.
5. Moving Averages
Three moving averages are included for optional visual context.
Each supports:
SMA
EMA
WMA
DEMA
TEMA
HMA
VWMA
The default configuration is:
MA 1: SMA, length 8.
MA 2: EMA, length 20.
MA 3: HMA, length 50.
The moving averages do not filter or modify the engulfing, breakout, breakdown, or sweep conditions.
6. Visual Controls
The indicator provides:
A small base-candle marker.
Configurable engulfing candle colors.
Level marks on displayed bullish and bearish engulfing candles.
Optional liquidity sweep arrows.
Breakout and breakdown triangles.
Two optional short reference lines beside the latest bar.
The short reference lines show the latest saved levels, without drawing a historical reference-line trail. They remain visible until the reference changes, even if a signal has already occurred at that level.
Hiding engulfing candle colors does not stop those patterns from being detected or saved as references.
Hiding liquidity sweep arrows does not disable their alert conditions.
7. Bar-Close Confirmation and Live-Bar Behavior
Separate confirmation settings are provided for:
Engulfing candle display.
Breakout and breakdown signals.
Liquidity sweep signals.
All three confirmation settings are enabled by default.
When confirmation is disabled, qualifying conditions may appear and disappear while the current bar is forming. Intrabar signals are provisional and may not remain after the bar closes or the chart is reloaded.
Engulfing reference levels are always updated only at bar close, regardless of the display confirmation setting.
Base-candle markers are not controlled by these confirmation options and may change while the current candle is forming.
The script uses chart-timeframe data and does not request other timeframes or use future-confirmed pivot detection.
8. Alerts
Four alert conditions are available:
Engulfing Reference High Breakout.
Engulfing Reference Low Breakdown.
Bullish Liquidity Sweep.
Bearish Liquidity Sweep.
Alerts must be created manually using TradingView’s alert interface.
For close-confirmed use, keep the relevant confirmation option enabled and select “Once Per Bar Close” when creating the alert.
The breakout and breakdown enable switches control their respective signals and alert conditions.
Suggested Workflow
Choose strict or flexible engulfing detection.
Select whether opposite-direction candles are required.
Choose the engulfing reference mode.
Observe subsequent price movement relative to the saved reference levels.
Use optional sweep markers and moving averages as additional context.
Base markers and sweep conditions are separate observations. They are not mandatory filters for engulfing breakouts or breakdowns.
Design Rationale
The candle concepts and moving-average formulas used here are established techniques. The implementation combines them into a specific pattern-to-reference workflow:
Configurable engulfing detection establishes the reference.
Confirmed reference storage separates pattern formation from later level testing.
Independent high and low tracking limits repeated signals for each reference.
Display controls allow a cleaner chart without changing the underlying pattern calculations.
Optional sweeps provide a separate view of previous-bar level rejection, rather than being treated as identical to engulfing patterns.
The indicator is intended to make these distinctions explicit and configurable, not to claim that familiar candle patterns constitute a new market theory.
Limitations
This is an indicator, not an automated trading strategy or a backtested trading system.
It does not:
Automatically identify supply and demand zones or order blocks.
Confirm actual stop-order execution.
Provide position sizing, stop-loss placement, or profit targets.
Establish profitability or a signal win rate.
Signals can fail, and their usefulness depends on the instrument, timeframe, settings, and broader market context.
Use standard candlestick charts when evaluating the patterns. Results on synthetic or non-standard chart types may differ because their candle values are constructed differently.
This tool is provided for educational and analytical purposes and does not constitute a recommendation to buy or sell.
نظرة عامة
مؤشر «شموع البيس والابتلاع وسحب السيولة» هو أداة تُعرض على الشارت الرئيسي، وتهدف إلى مراجعة بنية الشموع ومتابعة حركة السعر حول مستويات الشموع الابتلاعية المؤكدة.
يجمع المؤشر بين ثلاث ملاحظات مترابطة:
تحديد الشموع صغيرة الجسم، وتسميتها «شموع البيس» وفق نسبة قابلة للتعديل بين الجسم والمدى الكامل للشمعة.
اكتشاف الابتلاع الصاعد والهابط، بشروط صارمة أو بشروط مرنة تسمح بسماحية محددة لمكان الافتتاح.
متابعة اختراق أو كسر المستويات المرجعية المحفوظة للشموع الابتلاعية.
كما يتضمن رصدًا اختياريًا لسحب قمة أو قاع الشمعة السابقة، وثلاثة متوسطات متحركة قابلة للتخصيص لتوفير سياق بصري إضافي.
الهدف من هذا الجمع هو فصل اكتشاف النمط عن تأكيد حركة السعر اللاحقة: تُنشئ الشمعة الابتلاعية مستوى مرجعيًا، ثم تُقاس الشموع التالية عليه، بدل مقارنة الشمعة بقمتها أو قاعها هي نفسها.
1. تحديد شمعة البيس
تُصنّف الشمعة على أنها شمعة بيس عندما لا يتجاوز حجم جسمها النسبة المحددة من مداها الكامل بين أعلى وأدنى سعر.
النسبة الافتراضية هي 15%.
تظهر علامة صغيرة عند منتصف جسم الشمعة، ويمكن تغيير لونها من الإعدادات.
مصطلح «البيس» في هذا المؤشر يعني تصنيفًا للشموع صغيرة الجسم فقط. ولا يعني أن المؤشر يحدد تلقائيًا مناطق العرض والطلب أو مناطق التجميع أو كتل الأوامر. تُستبعد الشموع التي يتساوى فيها أعلى وأدنى سعر.
2. اكتشاف الشموع الابتلاعية
يشترط المؤشر في الابتلاع الصاعد والهابط أن يكون جسم الشمعة الحالية أكبر من جسم الشمعة السابقة.
افتراضيًا، يجب أن تكون الشمعة السابقة معاكسة لاتجاه الشمعة الحالية:
الابتلاع الصاعد تسبقه شمعة هابطة.
الابتلاع الهابط تسبقه شمعة صاعدة.
يمكن إلغاء هذا الشرط بتفعيل خيار «السماح بأن تكون الشمعتان من الاتجاه نفسه». وعند تفعيله، يمكن أيضًا قبول شمعة سابقة يتساوى افتتاحها وإغلاقها إذا تحققت بقية الشروط.
الوضع الصارم
يشترط الابتلاع الصاعد:
أن تكون الشمعة الحالية صاعدة.
أن يكون افتتاحها عند الحد السفلي لجسم الشمعة السابقة أو أسفله.
أن يكون إغلاقها عند الحد العلوي لجسم الشمعة السابقة أو أعلاه.
أن يكون جسمها أكبر من جسم الشمعة السابقة.
تُعكس هذه الشروط للابتلاع الهابط.
لا تُستخدم سماحية الافتتاح في الوضع الصارم.
الوضع المرن
يسمح الوضع المرن بافتتاح الشمعة الحالية داخل جسم الشمعة السابقة بمقدار محدد.
تُحسب السماحية كنسبة من حجم جسم الشمعة السابقة، والقيمة الافتراضية هي 10%.
مثلًا: إذا كان حجم الجسم السابق يساوي وحدة سعرية واحدة، فإن سماحية 10% تسمح بدخول الافتتاح داخل الجسم السابق بمقدار 0.10 وحدة سعرية.
مع ذلك، يجب:
أن يغلق الابتلاع الصاعد أعلى جسم الشمعة السابقة.
أن يغلق الابتلاع الهابط أسفل جسم الشمعة السابقة.
أن يظل الجسم الحالي أكبر من الجسم السابق.
عند تعطيل السماح بالافتتاح داخل الجسم السابق، تصبح السماحية صفرًا.
3. اختراق وكسر مستويات الشموع الابتلاعية
لا يحفظ المؤشر الشمعة الابتلاعية كمرجع إلا بعد إغلاقها.
يوفر المؤشر وضعين لاختيار المرجع:
آخر شمعة ابتلاعية، بصرف النظر عن اتجاهها
تُستخدم قمة وقاع آخر شمعة ابتلاعية مؤكدة:
يحدث الاختراق الصاعد عند تجاوز قمتها.
يحدث الكسر الهابط عند النزول أسفل قاعها.
عند ظهور ابتلاعية مؤكدة جديدة، تُستبدل القمة والقاع المرجعيان بمستوياتها.
حسب الاتجاه: قمة الصاعدة وقاع الهابطة
تُتابع المراجع بصورة منفصلة:
الاختراق الصاعد يُقاس على قمة آخر ابتلاعية صاعدة مؤكدة.
الكسر الهابط يُقاس على قاع آخر ابتلاعية هابطة مؤكدة.
تحديث مرجع أحد الاتجاهين لا يستبدل مرجع الاتجاه الآخر.
ترتيب الفحص ومنع تكرار الإشارات
يفحص المؤشر الشمعة الحالية مقابل المرجع المحفوظ سابقًا، ثم يحدّث المرجع إذا أغلقت الشمعة الحالية كابتلاعية جديدة.
يمنع ذلك قياس الشمعة على مستوياتها التي حُفظت للتو. ومع ذلك، يمكن أن تكون شمعة الإشارة ابتلاعية أيضًا إذا اخترقت أو كسرت مرجعًا سابقًا بالفعل.
يسمح كل مرجع بإشارة اختراق واحدة لقمته، وإشارة كسر واحدة لقاعه. ويُتابع كل جانب بصورة مستقلة.
يوفر خيار «اشتراط عبور المستوى في الشمعة الحالية» شرطًا إضافيًا:
للاختراق: يكون الإغلاق السابق عند القمة المرجعية أو أسفلها.
للكسر: يكون الإغلاق السابق عند القاع المرجعي أو أعلاه.
ملامسة المستوى أو الإغلاق عنده تمامًا لا تكفي؛ يجب أن يكون السعر أعلى القمة أو أسفل القاع.
4. سحب سيولة الشمعة السابقة
يعتمد هذا الجزء على قمة أو قاع الشمعة السابقة مباشرةً. ولا يبحث عن القمم والقيعان الهيكلية، أو القمم والقيعان المتساوية، أو مستويات الجلسات، أو مستويات الفواصل الزمنية الأعلى.
يشترط سحب السيولة الصاعد:
تسجيل قاع أقل من قاع الشمعة السابقة.
أن تكون الشمعة الحالية صاعدة.
تحقق شرط الإغلاق المختار.
ويشترط سحب السيولة الهابط:
تسجيل قمة أعلى من قمة الشمعة السابقة.
أن تكون الشمعة الحالية هابطة.
تحقق شرط الإغلاق المختار.
يتوفر خياران للإغلاق:
خارج جسم الشمعة السابقة: يغلق السحب الصاعد فوق جسم السابقة، ويغلق السحب الهابط تحته.
العودة خلف المستوى المسحوب: يغلق السحب الصاعد فوق القاع السابق، ويغلق السحب الهابط تحت القمة السابقة.
كما يمكن اشتراط أن يكون تجاوز المستوى بالذيل فقط، بحيث يبقى جسم الشمعة على الجانب الذي استعادته من المستوى.
تصف هذه الإشارات نمطًا سعريًا فقط، ولا تثبت وجود أو تنفيذ أوامر وقف، أو نشاط مؤسسي، أو معاملات سيولة فعلية.
5. المتوسطات المتحركة
يتضمن المؤشر ثلاثة متوسطات متحركة اختيارية لتوفير سياق بصري إضافي.
يمكن اختيار أحد الأنواع التالية لكل متوسط:
المتوسط البسيط SMA.
المتوسط الأسي EMA.
المتوسط المرجح WMA.
المتوسط الأسي المزدوج DEMA.
المتوسط الأسي الثلاثي TEMA.
متوسط هال HMA.
المتوسط المرجح بالحجم VWMA.
الإعدادات الافتراضية:
المتوسط الأول: SMA بطول 8.
المتوسط الثاني: EMA بطول 20.
المتوسط الثالث: HMA بطول 50.
المتوسطات للعرض فقط؛ لا تُستخدم كفلاتر لشروط الابتلاع أو الاختراق أو الكسر أو سحب السيولة.
6. خيارات العرض
يوفر المؤشر:
علامة صغيرة لشموع البيس.
ألوانًا قابلة للتخصيص للشموع الابتلاعية.
علامات مستويات على قمم الابتلاع الصاعد وقيعان الابتلاع الهابط المعروضة.
أسهمًا اختيارية لسحب السيولة.
مثلثات للاختراق والكسر.
خطّين مرجعيين قصيرين اختياريين بجانب آخر شمعة.
يعرض الخطّان القصيران أحدث المستويات المرجعية المحفوظة، دون رسم مسار تاريخي لهذه الخطوط. ويستمران حتى يتغير المرجع، حتى لو سبق صدور إشارة على المستوى.
إخفاء ألوان الابتلاع لا يمنع اكتشافه أو حفظه كمرجع.
وإخفاء أسهم سحب السيولة لا يعطّل شروط تنبيهاته.
7. تأكيد الإغلاق وسلوك الشمعة الحالية
تتوفر إعدادات مستقلة لتأكيد:
عرض الشموع الابتلاعية.
إشارات الاختراق والكسر.
إشارات سحب السيولة.
تكون إعدادات التأكيد الثلاثة مفعّلة افتراضيًا.
عند تعطيل التأكيد، قد تظهر الشروط وتختفي أثناء تكوّن الشمعة الحالية. لذلك تُعد الإشارات اللحظية مؤقتة، وقد لا تبقى بعد إغلاق الشمعة أو إعادة تحميل الشارت.
تُحدّث مستويات الابتلاع المرجعية بعد الإغلاق فقط، بصرف النظر عن إعداد تأكيد عرض الابتلاع.
أما علامات البيس فلا تخضع لإعدادات التأكيد السابقة، وقد تتغير أثناء تكوّن الشمعة.
يستخدم المؤشر بيانات الفاصل الزمني الحالي للشارت، ولا يطلب بيانات من فواصل أخرى، ولا يستخدم اكتشاف قمم وقيعان يتطلب شموعًا مستقبلية للتأكيد.
8. التنبيهات
يوفر المؤشر أربعة شروط للتنبيه:
اختراق قمة الشمعة الابتلاعية المرجعية.
كسر قاع الشمعة الابتلاعية المرجعية.
سحب سيولة صاعد.
سحب سيولة هابط.
يجب إنشاء التنبيهات يدويًا من واجهة تنبيهات TradingView.
للاستخدام المؤكد بالإغلاق، يُترك خيار التأكيد المرتبط بالإشارة مفعّلًا، ويُختار «مرة واحدة عند إغلاق الشمعة» عند إنشاء التنبيه.
يتحكم خيارا تفعيل الاختراق والكسر في إشاراتهما وشروط تنبيهاتهما.
طريقة استخدام مقترحة
اختيار وضع الابتلاع الصارم أو المرن.
تحديد ما إذا كان اختلاف اتجاه الشمعتين مطلوبًا.
اختيار وضع المرجع المستخدم للاختراق والكسر.
متابعة حركة السعر اللاحقة حول المستويات المرجعية المحفوظة.
استخدام علامات سحب السيولة والمتوسطات اختياريًا كسياق إضافي.
علامات البيس وشروط سحب السيولة ملاحظات مستقلة، وليست فلاتر إلزامية لإشارات اختراق أو كسر الابتلاع.
فكرة التصميم
يعتمد المؤشر على مفاهيم معروفة في تحليل الشموع وصيغ المتوسطات المتحركة. ويجمعها في تسلسل محدد يبدأ بالنمط وينتهي بمتابعة مستوياته:
اكتشاف الابتلاع وفق شروط قابلة للتخصيص.
حفظ المرجع بعد الإغلاق لفصل تكوّن النمط عن اختبار مستوياته لاحقًا.
متابعة القمة والقاع بصورة مستقلة لتقليل تكرار الإشارات لكل مرجع.
فصل خيارات العرض عن الحساب للمحافظة على وضوح الشارت.
تقديم سحب قمة أو قاع الشمعة السابقة كملاحظة منفصلة، وليس باعتباره مطابقًا للابتلاع.
الغرض هو جعل هذه الفروق واضحة وقابلة للتحكم، وليس الادعاء بأن أنماط الشموع المعروفة تمثل نظرية سوق جديدة.
الحدود والتنبيهات المهمة
هذا مؤشر تحليلي، وليس استراتيجية تداول آلية أو نظامًا خضع لاختبار تاريخي للأداء.
لا يقوم المؤشر بما يلي:
تحديد مناطق العرض والطلب أو كتل الأوامر تلقائيًا.
إثبات تنفيذ أوامر الوقف الفعلية.
تحديد حجم الصفقة أو وقف الخسارة أو الأهداف.
إثبات الربحية أو تحديد نسبة نجاح للإشارات.
قد تفشل الإشارات، وتعتمد فائدتها على الأصل المالي والفاصل الزمني والإعدادات والسياق العام للسوق.
يُفضّل تقييم الأنماط على شارت الشموع العادية. وقد تختلف النتائج على أنواع الشارت الاصطناعية أو غير التقليدية بسبب اختلاف طريقة بناء أسعار شموعها.
هذه الأداة مخصصة للأغراض التعليمية والتحليلية، ولا تمثل توصية بالشراء أو البيع.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.