Indicator

Strategy

LDO-Magnet [1.1]LDO-Magnet — Naked POCs, Value Areas & Vector Candle Zones
WHAT IT DOES
Plots the two kinds of unfinished business that pull price back like a magnet, and tells you when they stack on top of each other.
NAKED POINTS OF CONTROL (NPOCs). Each UTC day, week and month gets a volume profile built from lower-timeframe data. The price with the most traded volume is that period's POC. Once the period closes, an untouched POC is "naked" — a magnet that price tends to return to. Levels are removed the moment price finally trades through them. Previous Value Areas (VAH/VAL — the range holding 70% of the period's volume) are also drawn.
VECTOR CANDLE ZONES. Candles with unusually high volume — 200%+ of the recent average (red/green vectors) or 150%+ (violet/blue vectors) — mark where market makers left a footprint. The candle body becomes a zone that stays on the chart until price trades fully back through it.
CONFLUENCE ★. When a Naked POC sits inside an active vector zone, two independent reasons for price to react coincide at one level. The NPOC's label gains a star and its line brightens: ★ — the NPOC is anywhere inside the zone ★★ — the NPOC is near the zone's 50% midpoint (strong confluence) Stars appear and disappear live as zones are created and cleared.
READING THE CHART
Levels are labelled on the right edge: dNPOC / wNPOC / mNPOC are daily, weekly and monthly Naked POCs (dotted, dashed and solid lines); pdVAH, pwVAL etc. are the previous period's Value Area edges. A star in front of any NPOC means it currently sits inside a vector zone. When two NPOCs from different timeframes nearly overlap, only the higher-timeframe one is drawn — the hidden one is still tracked and still fires alerts.
SETTINGS
Timeframes — which profile periods to plot. Daily and weekly are on by default; monthly suits higher-timeframe charts.
Levels — toggle Naked POCs, previous Value Areas and developing (live, still-forming) profiles, and cap how many levels of each timeframe stay on the chart. "Keep Touched Levels" leaves a faded line where a level was hit instead of deleting it.
Vector Zones — toggle the zones, colour them with one colour or by vector type, and set their transparency. "Highlight NPOC + zone confluence" controls the stars; the "Strong confluence band" sets how close to the zone's 50% level an NPOC must be to earn ★★ (default 15% of the zone's height).
Display — labels, prices, text size, and the overlap distance below which lower-timeframe levels are hidden.
Alerts — enables the dynamic alerts and sets the approach distance.
Appearance — colours and transparency per level family. Transparency runs 0–100: LOWER is brighter, higher is fainter. If a label seems hard to read, check you are adjusting the slider for that family (Naked POC, Value Area or developing profile) — each has its own.
ALERTS
Add an alert on the indicator and choose a condition: approach/touch per NPOC timeframe, previous VAH/VAL crosses, Value Area entries, vector zone approach/entry, and Approaching/Touching Confluence. Or select "Any alert() function call" to receive everything as detailed messages, e.g.:
ZECUSDT.P | STRONG CONFLUENCE touch | Daily NPOC 466.60 inside vector zone | current 466.85
HOW TO USE THE CONFLUENCE
The stars mark where a reaction is likely — they do not predict its direction. In practice:
Treat ★★ levels as the highest-priority magnets on the chart. Price reaching one usually does something: a rejection back the way it came, or a decisive push straight through.
Read direction from the approach. Into confluence against the prevailing trend, favour the reversal; with the trend and on strong volume, a clean break often accelerates.
First touches are the most reliable. Once a level has been tested the magnet is spent — the script removes filled NPOCs automatically.
Higher timeframe beats lower: a starred wNPOC or mNPOC outranks a starred dNPOC.
Set the Approaching Confluence alert and let the chart come to you.
NOTES
Levels are computed from lower-timeframe volume distributed across price, with UTC period boundaries, so they will not exactly match profiles drawn in your chart's local timezone. Use standard candles. Works on any symbol and timeframe with volume data.
Vector zone logic is adapted from the open-source Vector Candle Zones code by infernix and peshocore (MPL 2.0) via the public Traders_Reality_Lib library — credit to them for the PVSRA methodology. The volume-profile engine, UTC framework, overlap suppression, confluence detection and alert system are original to this script.
Indicator

Indicator

Liquidity Sweep Reversal | M. BedaiwiLiquidity Sweep Reversal | M. Bedaiwi
Overview
Liquidity Sweep Reversal is a price-action indicator designed to identify potential market reversals following liquidity sweeps above previous highs or below previous lows.
The indicator monitors a higher-period liquidity range. When price moves beyond one side of that range, it waits for a subsequent Market Structure Shift (MSS) before generating a potential Buy or Sell signal.
A liquidity sweep alone does not generate an entry. Market structure confirmation is an essential part of the setup.
How It Works
• A sweep below the previous liquidity low prepares a potential long setup.
• A sweep above the previous liquidity high prepares a potential short setup.
• Entry confirmation is based on a Market Structure Shift using the selected MSS Swing Length.
• Liquidity sweeps can be detected using candle wicks or closing prices.
• Classic and Adaptive entry methods are available.
• If the selected Higher Timeframe is equal to or lower than the chart timeframe, the indicator automatically uses a reference period equivalent to four chart bars.
The indicator calculates a rolling liquidity range on the current chart equivalent to the selected reference period. It does not request independent higher-timeframe candles through `request.security()`.
Features
• Liquidity sweep detection
• Market structure confirmation
• Potential long and short signals
• Classic and Adaptive entry methods
• Higher-timeframe safety handling
• Automatic four-bar fallback
• Fixed or ATR-based TP/SL levels
• Entry, take-profit and stop-loss alerts
• Optional liquidity zones and sweep markers
• Historical performance dashboard
• Pine Script v6 compatibility
How to Use
1. Select the Chart Timeframe
Choose the chart timeframe according to your trading style:
• 5–15 minutes: Intraday trading
• 1–4 hours: Short-term or swing trading
• Daily: Medium-term trading
Standard candlestick charts are recommended.
2. Select the Higher Timeframe
The Higher Timeframe setting defines the reference period used to calculate liquidity highs and lows.
Suggested combinations:
• 5-minute chart → 30 or 60 minutes
• 15-minute chart → 60 or 240 minutes
• 1-hour chart → 4 hours
• 4-hour chart → Daily
• Daily chart → Weekly
The selected Higher Timeframe should normally be higher than the chart timeframe.
If it is equal to or lower than the chart timeframe, the indicator automatically uses a period equivalent to four chart bars. The liquidity label displays “Auto x4” when this fallback is active.
3. Configure Liquidity Sweep Detection
Breakout Method provides two options:
Wick
Detects a sweep when the candle wick crosses the liquidity level.
• Earlier detection
• More frequent signals
• Greater sensitivity to temporary price spikes
Close
Requires the candle to close beyond the liquidity level.
• Stronger confirmation
• Fewer signals
• Filters some wick-only sweeps
4. Configure Market Structure Confirmation
MSS Swing Length controls the number of candles used to calculate the swing high and swing low for Market Structure Shift confirmation.
• Lower values generate faster and more frequent signals.
• Higher values generate slower and more selective signals.
The default value is 10. A range between 5 and 15 may be used as a starting point, depending on the asset and timeframe.
5. Select the Entry Method
Classic
Uses the traditional reversal approach:
• A sweep below the previous liquidity low prepares a potential long setup.
• A sweep above the previous liquidity high prepares a potential short setup.
Classic mode is generally easier to understand and evaluate.
Adaptive
Uses the indicator’s internal historical behavior to adjust the potential trade direction.
Depending on its internal long and short performance counters, Adaptive mode may occasionally select a continuation direction instead of the traditional reversal direction.
Adaptive mode is experimental, and its behavior may vary between assets and timeframes.
6. Interpret the Signals
Potential Long Setup
• Price sweeps below the previous liquidity low.
• The indicator detects a bullish Market Structure Shift on a later candle.
• A Buy label appears after confirmation.
• Entry, take-profit and stop-loss levels are calculated.
Potential Short Setup
• Price sweeps above the previous liquidity high.
• The indicator detects a bearish Market Structure Shift on a later candle.
• A Sell label appears after confirmation.
• Entry, take-profit and stop-loss levels are calculated.
Liquidity sweep markers show where price crossed a previous liquidity level. Do not enter solely because a sweep marker appears. Wait for the subsequent structure confirmation and Buy or Sell label.
7. Configure Take Profit and Stop Loss
The indicator provides two TP/SL calculation methods:
Dynamic Method
Uses:
• A five-bar ATR
• The selected Risk setting
• The MSS swing high or low
• An internal reward-to-risk multiplier of approximately 0.9
For long trades, the stop-loss is placed below the MSS swing low with an additional ATR-based distance. The target is calculated above the entry using the entry-to-stop distance.
For short trades, the stop-loss is placed above the MSS swing high with an additional ATR-based distance. The target is calculated below the entry using the entry-to-stop distance.
Fixed Method
Uses user-defined percentages from the entry price.
Default values:
• Take Profit: 0.3%
• Stop Loss: 0.4%
These values should be adjusted according to the asset’s volatility and the selected timeframe.
Risk Setting
The Risk setting controls the ATR multiplier used to determine the Dynamic stop-loss distance:
• Highest: 10
• High: 6.5
• Normal: 5.5
• Low: 3.5
• Lowest: 1.15
This setting controls the distance of the stop-loss. It does not calculate position size or the monetary amount at risk.
A wider stop-loss should normally be combined with a smaller position size.
8. Select the TP/SL Layout
Default
Displays dashed lines with TP and SL labels.
Alternative
Displays take-profit and stop-loss areas as colored boxes.
This setting changes only the visual layout and does not change the calculated prices.
9. Enable Visual Elements
• Show Liquidity Zones: Displays the reference liquidity areas.
• Liq Grabs: Displays detected liquidity sweep markers.
• TP / SL: Displays entry, take-profit and stop-loss levels.
• Buy and Sell Colors: Controls the signal and zone colors.
• Text Color: Controls the color of labels and displayed values.
10. Create Alerts
Alerts are available for:
• Buy Signal
• Sell Signal
• Take-Profit Signal
• Stop-Loss Signal
To create an alert:
1. Open PulseWire’s alert menu.
2. Select Liquidity Sweep Reversal.
3. Choose the required alert condition.
4. Select the notification method.
5. Consider using “Once Per Bar Close” to reduce intrabar signals.
6. Apply Practical Confirmation
For more selective setups, consider confirming signals with:
• Higher-timeframe trend direction
• Support and resistance levels
• Trading volume
• Market session and available liquidity
• Supply and demand zones
• Candle-close confirmation
Always review the displayed entry, target and stop-loss levels before taking a trade. Calculate position size independently according to the stop-loss distance.
Example Starting Configuration
For a 15-minute chart:
• Higher Timeframe: 60 minutes
• MSS Swing Length: 10
• Breakout Method: Close
• Entry Method: Classic
• TP / SL Method: Dynamic
• Risk: Low
These settings are only a starting point and are not universally optimal.
Historical Dashboard
The Liquidity Sweep Backtest dashboard displays:
• Total Entries
• Wins
• Losses
• Win Rate
• Average Profit
• Total Profit
The dashboard is intended for approximate comparison between settings. The script is an indicator, not a strategy, and the dashboard is not equivalent to PulseWire’s Strategy Tester.
The calculations do not include:
• Brokerage commissions
• Slippage
• Bid-ask spread
• Position sizing
• Price gaps
• Actual order execution
• Taxes or financing costs
Historical results do not guarantee future performance.
Practical Limitations
The indicator may be less effective during:
• Strong one-directional trends
• Low-liquidity market conditions
• Major news releases
• Large price gaps
• Narrow or random consolidation
• Highly volatile intrabar movement
• Non-standard chart types
• Poorly matched timeframe settings
The indicator processes approximately the most recent 4,900 bars to maintain performance. Results may change when the symbol, timeframe or settings are changed.
Attribution and Modifications
Original open-source code by fluxchart.
Modified by Mohammed Bedaiwi (mbedaiwi2).
Modifications include:
• Conversion to Pine Script v6
• Safer higher-timeframe handling
• Automatic four-bar fallback when the selected timeframe is not higher than the chart timeframe
• Dashboard calculation safeguards
• Independent indicator naming and presentation
The modified source code remains available under the Mozilla Public License 2.0.
Important Notice
This indicator is provided for educational and analytical purposes only. It does not constitute financial advice, an investment recommendation or a guarantee of profitable results.
Trading and investing involve substantial risk. Users should perform independent analysis, apply appropriate position sizing and risk management, and avoid risking funds they cannot afford to lose.
────────────────────────────
الوصف العربي
نظرة عامة
مؤشر Liquidity Sweep Reversal هو مؤشر لتحليل حركة السعر، صُمم لاكتشاف فرص الانعكاس المحتملة بعد سحب السيولة أعلى القمم السابقة أو أسفل القيعان السابقة.
يراقب المؤشر نطاقًا مرجعيًا للسيولة. عندما يتحرك السعر خارج أحد طرفي هذا النطاق، ينتظر المؤشر تغيرًا لاحقًا في هيكل السوق قبل إصدار إشارة شراء أو بيع محتملة.
لا يؤدي سحب السيولة وحده إلى إصدار إشارة دخول، بل يجب ظهور تأكيد لاحق من هيكل السوق.
طريقة العمل
• سحب السيولة أسفل القاع السابق يجهز فرصة شراء محتملة.
• سحب السيولة أعلى القمة السابقة يجهز فرصة بيع محتملة.
• يتم تأكيد الدخول بواسطة تغير هيكل السوق وفق إعداد MSS Swing Length.
• يمكن اكتشاف سحب السيولة بواسطة ظلال الشموع أو أسعار الإغلاق.
• يتوفر أسلوبا دخول Classic وAdaptive.
• إذا كان الإطار المرجعي مساويًا أو أقل من إطار الرسم، يستخدم المؤشر تلقائيًا فترة تعادل أربع شمعات.
الميزات
• اكتشاف سحب السيولة
• تأكيد تغير هيكل السوق
• إشارات شراء وبيع محتملة
• أسلوبا دخول Classic وAdaptive
• معالجة آمنة للإطار الزمني
• أهداف ووقف خسارة ثابتة أو مبنية على ATR
• تنبيهات الشراء والبيع والهدف ووقف الخسارة
• مناطق سيولة وعلامات سحب اختيارية
• لوحة نتائج تاريخية
• التوافق مع Pine Script v6
طريقة الاستخدام
1. اختر إطار الرسم
• 5–15 دقيقة: للتداول اليومي
• ساعة إلى 4 ساعات: للتداول قصير أو متوسط الأجل
• يومي: للتداول متوسط الأجل
يفضل استخدام رسم الشموع العادي.
2. اختر الإطار المرجعي الأعلى
إعدادات مقترحة:
• رسم 5 دقائق ← 30 أو 60 دقيقة
• رسم 15 دقيقة ← 60 أو 240 دقيقة
• رسم ساعة ← 4 ساعات
• رسم 4 ساعات ← يومي
• رسم يومي ← أسبوعي
إذا كان الإطار المختار مساويًا أو أقل من إطار الرسم، يستخدم المؤشر فترة تلقائية تعادل أربع شمعات، وتظهر عبارة `Auto x4`.
3. اختر طريقة اكتشاف سحب السيولة
Wick
يعتمد على اختراق ظل الشمعة:
• اكتشاف أسرع
• إشارات أكثر
• حساسية أعلى للحركات اللحظية
Close
يشترط إغلاق الشمعة بعد مستوى السيولة:
• تأكيد أقوى
• إشارات أقل
• تصفية بعض اختراقات الظلال
4. اضبط MSS Swing Length
يحدد عدد الشمعات المستخدمة لتأكيد تغير هيكل السوق.
• القيمة المنخفضة تعطي إشارات أسرع وأكثر عددًا.
• القيمة المرتفعة تعطي إشارات أقل وأكثر انتقائية.
القيمة الافتراضية هي 10، ويمكن البدء بنطاق بين 5 و15.
5. اختر أسلوب الدخول
Classic
• سحب سيولة القاع يؤدي إلى البحث عن شراء.
• سحب سيولة القمة يؤدي إلى البحث عن بيع.
Adaptive
يستخدم السلوك التاريخي الداخلي للمؤشر لتعديل اتجاه الصفقة المحتمل، وقد يختار أحيانًا اتجاهًا استمراريًا بدل الانعكاس التقليدي.
يفضل البدء بوضع Classic لأنه أسهل في الفهم والتقييم.
6. قراءة الإشارات
إشارة شراء محتملة:
• يسحب السعر السيولة أسفل القاع السابق.
• يظهر تغير صاعد في هيكل السوق على شمعة لاحقة.
• تظهر علامة Buy.
• يتم حساب الدخول والهدف ووقف الخسارة.
إشارة بيع محتملة:
• يسحب السعر السيولة أعلى القمة السابقة.
• يظهر تغير هابط في هيكل السوق على شمعة لاحقة.
• تظهر علامة Sell.
• يتم حساب الدخول والهدف ووقف الخسارة.
لا تدخل اعتمادًا على علامة سحب السيولة وحدها، بل انتظر تأكيد هيكل السوق وظهور Buy أو Sell.
7. إعداد الهدف ووقف الخسارة
Dynamic
يستخدم:
• ATR بطول خمس شمعات
• مستوى Risk المختار
• قمة أو قاع MSS
• نسبة عائد إلى مخاطرة داخلية تقارب 0.9
Fixed
يستخدم نسبًا ثابتة من سعر الدخول.
القيم الافتراضية:
• الهدف: 0.3%
• وقف الخسارة: 0.4%
يجب تعديل هذه القيم وفق تذبذب الأصل والإطار الزمني.
إعداد Risk يتحكم في المسافة بين الدخول ووقف الخسارة، ولا يحسب حجم الصفقة أو المبلغ المالي المعرض للخسارة.
8. العناصر المرئية
• Show Liquidity Zones: إظهار مناطق السيولة
• Liq Grabs: إظهار علامات سحب السيولة
• TP / SL: إظهار الدخول والهدف ووقف الخسارة
• Default Layout: عرض المستويات على شكل خطوط
• Alternative Layout: عرض المستويات على شكل مناطق ملونة
9. التنبيهات
يدعم المؤشر تنبيهات:
• الشراء
• البيع
• الوصول إلى الهدف
• الوصول إلى وقف الخسارة
يفضل ضبط التنبيه على مرة واحدة عند إغلاق الشمعة لتقليل الإشارات اللحظية.
10. التأكيد العملي
يمكن تحسين انتقائية الإشارات باستخدام:
• اتجاه الإطار الزمني الأعلى
• الدعم والمقاومة
• حجم التداول
• جلسة السوق والسيولة
• مناطق العرض والطلب
• تأكيد إغلاق الشمعة
يجب مراجعة الهدف ووقف الخسارة وحساب حجم الصفقة بصورة مستقلة قبل الدخول.
لوحة النتائج التاريخية
تعرض لوحة Liquidity Sweep Backtest:
• إجمالي الصفقات
• الصفقات الرابحة
• الصفقات الخاسرة
• نسبة النجاح
• متوسط النتيجة
• إجمالي النتيجة
اللوحة مخصصة للمقارنة التقريبية بين الإعدادات. السكريبت مؤشر وليس استراتيجية، ولذلك لا تعادل اللوحة Strategy Tester في PulseWire.
لا تتضمن النتائج العمولات أو الانزلاق السعري أو فرق العرض والطلب أو حجم الصفقة أو إمكانية التنفيذ الفعلي.
حقوق الكود والتعديلات
الكود الأصلي مفتوح المصدر من تطوير fluxchart.
تم تعديله بواسطة Mohammed Bedaiwi (mbedaiwi2).
تشمل التعديلات:
• التحويل إلى Pine Script v6
• تحسين معالجة الإطار الزمني
• استخدام فترة تلقائية تعادل أربع شمعات عند الحاجة
• حماية حسابات لوحة النتائج
• تغيير اسم وهوية المؤشر بصورة مستقلة
يظل الكود المعدل خاضعًا لترخيص Mozilla Public License 2.0.
إخلاء المسؤولية
هذا المؤشر أداة تعليمية وتحليلية فقط، ولا يمثل توصية مالية أو ضمانًا للربح.
ينطوي التداول والاستثمار على مخاطر. يجب على المستخدم إجراء تحليله المستقل، واستخدام حجم صفقة مناسب، وتطبيق إدارة المخاطر وعدم المخاطرة بأموال لا يستطيع تحمل خسارتها.
Indicator

Indicator

Indicator

Indicator

Indicator

Indicator

Multi-Engine Strategy (Green Optimized + Candlestick Breakout)Multi-Engine Quantitative Strategy (Trend, Dip & Candlestick Breakouts)
Overview
This strategy is an optimized multi-engine quantitative trading system designed for active momentum traders. It combines dynamic trend filtering with three distinct entry engines—allowing it to adapt to changing market structures, whether buying pullbacks in an established trend or capturing high-momentum breakout expansions.
Key Strategy Features
1. Trend & Macro Alignment
Macro Filter: Ensures trades are only taken in favorable environments by requiring price to trade above both the 50 EMA and the VWAP.
Support Validation: Uses a 21 EMA fast line to define dynamic dynamic support levels for pullback entries.
2. Multi-Engine Entry Logic
Engine A: Buy the Dip (Pullback Engine)
Identifies oversold opportunities within a macro uptrend.
Triggers when price touches or dips near the 21 EMA buffer zone and prints a strong green reversal candle while remaining above the 50 EMA.
Engine B: Structural High Breakout
Targets apex breakout consolidations.
Triggers when price crosses above the highest high of the lookback period (N bars) accompanied by an institutional volume spike.
Engine C: First Green Over Prior Red (Candlestick Breakout)
Captures immediate micro-momentum shifts at potential pivot points.
Triggers when a green candle (close > open) breaks cleanly above the high of the immediately preceding red candle (close < open ), validated by volume expansion.
3. Institutional Risk & Execution Rules
Volume Filter: Requires a customizable volume multiplier (default: 1.2x 5-period SMA) on breakouts to filter out low-volume bull traps.
Dynamic Stop-Loss: Sets stop-losses at key dynamic swing levels (e.g., recent 5-bar low or prior candle's low) to adapt to market volatility.
Risk/Reward Framing: Uses a default 1:2 Risk-to-Reward ratio on all entries.
Macro Guardrail Exit: Closes open positions immediately if price breaks below the 50 EMA, preserving capital during structural reversals.
Input Settings & Customization
Strategy Engine Toggles: Enable or disable any of the 3 entry engines independently to isolate performance per asset class.
Moving Averages: Adjust Fast EMA (21) and Slow EMA (50) lengths to fit higher or lower timeframes.
Breakout Lookback: Fine-tune structural high lookbacks (default: 5 bars).
Volume Multiplier: Adjust breakout volume threshold requirements.
Backtest Lookback Window: Define strict date ranges for targeted backtesting.
Recommended Usage
Asset Classes: Tech Stocks, Crypto (BTC/ETH), High-Beta Equities, Forex Pairs.
Timeframes: Best tuned for intraday (5m, 15m) and lower swing timeframes (1H, 4H). Strategy

Indicator

Indicator

Indicator

Indicator

Leg Anatomy - Measured Retracement and ExtensionEvery trader draws the same three numbers on every chart: 38.2, 50 and 61.8. Those numbers were not derived from this market, this timeframe, or this instrument. They were not derived from any market. They are a convention that spread because it spread.
This script measures the real thing instead.
WHAT IT MEASURES
Price is broken into confirmed swing legs. A running extreme is tracked, and when price closes back from that extreme by more than a configurable multiple of ATR, the extreme is confirmed as a swing and a new leg begins.
Every completed leg is measured as a ratio of the leg immediately before it. A leg that travelled 60 percent of the previous leg records 0.60. A leg that went 140 percent past it records 1.40. That single number, the leg-to-leg ratio, is the entire dataset.
From the last N legs on the chart you have open, the panel reports:
The median leg, expressed as a multiple of the one before it.
The interquartile range, the middle half of the distribution.
The share of legs that were shallow, under 0.62.
The share that were deep, between 0.62 and 1.00.
The share that were extensions, past 1.00.
On some symbols and timeframes the conventional levels sit close to the measured centre. On many they do not, and the gap between what a chart actually does and what the convention assumes is visible in one row of the panel.
THE PROJECTION
The distribution is not left as a table. It is applied forward.
The leg currently forming starts from the last confirmed swing, and the leg before it has a known size. Multiplying that size by the measured median, upper quartile and ninetieth percentile gives three projected endpoints, drawn as a shaded zone in front of price with a dashed median line and a price label.
The panel shows how far the forming leg has travelled as a percentage of its median expectation. Below 100 percent the leg is still inside its normal range. Above it, the leg has already outrun the typical case for this chart, which is information whether you are holding it or fading it.
The zone is not a forecast. It is where the middle of the distribution sits, and roughly half of past legs fell short of it.
THE SKELETON
Confirmed legs are drawn as a thick zigzag across the chart, each one labelled with its own ratio, so the distribution in the panel can be read directly off the price action that produced it. Candles are tinted by the direction of the leg currently forming.
Because swings only confirm on closed bars and a confirmed swing is never revisited, the skeleton behind price is final. Only the leg at the right edge is still forming, and the projection zone updates only when a new leg is confirmed.
SETUPS
When a swing confirms, a new leg begins, and the script produces a complete setup at that close.
The stop sits just beyond the swing that was just confirmed, plus an ATR buffer. That swing is the level the leg depends on. If it goes, the leg reading was wrong.
The three targets are the lower quartile, the median and the upper quartile of the measured distribution, projected from the swing. They are not multiples of risk and they are not conventional ratios. They are the shape of this chart's own legs.
Only one setup is tracked at a time. The panel records whether the first target or the stop was reached first, and prints collecting until the sample is large enough to mean anything. That number measures one mechanical rule and is not a backtest.
SETTINGS
Reversal Threshold is the only structural dial. It decides what counts as a leg. A low value produces many small legs and a distribution dominated by noise. A high value produces few large legs and a distribution with a small sample. The default sits between the two, and changing it changes the entire analysis, which is the point: a leg on a scalping horizon is not a leg on a swing horizon, and the measured distribution should differ between them.
Volatility Length sets the ATR lookback used for the reversal threshold and the stop buffer.
Legs Kept In Sample bounds the history, so the distribution tracks the current regime instead of averaging in a market from years ago.
REPAINTING
Swing confirmation, leg measurement, the distribution, setups and alerts all evaluate on confirmed bars. A confirmed swing is never moved and a drawn leg is never redrawn. The projection zone in front of price is recomputed only when a new leg begins. The script requests no higher timeframe data.
HOW TO READ IT
Start with the three share rows. If a chart shows most of its legs under 0.62, it is a market that retraces shallowly and continuation is the base case. If most legs sit between 0.62 and 1.00, it is a market that gives deep pullbacks and entering early is expensive. A high share above 1.00 is a trending regime where each leg outruns the last.
Then look at the forming leg's progress. A leg at 40 percent of median with a distribution that favours extension is a different situation from a leg at 130 percent in a market that rarely extends.
The ratios printed on the skeleton let you check the panel against your own eyes rather than trusting it.
This is an analysis tool, not financial advice, and not a trading system. A measured distribution describes what happened, not what will. Sample sizes are small by the standards of statistics and regimes change. Use it with your own risk management and position sizing. Indicator

TheStrat Suite [Open Source] Entries, Targets, and Stop LossTheStrat Suite automates the detection, visualization, and alerting of price action setups based on TheStrat methodology (developed by Rob Smith) across up to six configurable timeframes simultaneously.
The guiding principle: show only the most valuable information. Rather than cluttering charts with every possible level and signal, the indicator uses logic based on user settings to determine what's relevant and worth displaying at any given moment.
WHAT IT DOES
The indicator identifies candle combinations (combos), actionable signals (inside bars, hammers, shooters), Failed 2s (range reclaims), and calculates magnitude and exhaustion targets — then draws entries, targets, stop losses, and take action windows directly on your chart. A real-time data table displays combo status, bar types, and Full Timeframe Continuity (FTFC) across all enabled timeframes. Candles themselves can be colored by Strat classification or by FTFC. Alerts can be filtered by timeframe continuity, signal type, specific timeframes, or Domino setups.
HOW IT WORKS
Multi-Timeframe Data Architecture
The indicator requests OHLC data from up to six user-configured timeframes in a single pass, then processes each timeframe's candle relationships independently. This allows the 5-minute, 60-minute, daily, and weekly structure to coexist on one chart without switching views.
Candle Classification Logic
Each closed candle is classified by comparing its high and low to the prior candle's range. A candle entirely within the prior range is type 1 (inside). A candle that exceeds one side is type 2 (directional). A candle that exceeds both sides is type 3 (outside). Directional bias (u/d) is determined by comparing close to open. A Failed 2 (also known as a Range Reclaim, 2d Green, or 2u Red) occurs when a directional candle breaks one side of an inside bar but fails to continue.
Hammer and Shooter Detection
The indicator offers three detection methods. Classic requires the candle to breach the prior candle's high or low but close back inside the prior range. Pin Bar adds a wick-to-body ratio requirement, filtering for candles where the rejecting wick is significantly longer than the body. Broad relaxes the close requirement, allowing the close to be near (not strictly inside) the prior range. Users select which method matches their trading style.
Failed 2 / Range Reclaim Detection
A Failed 2 occurs when price breaks one side of an inside bar (type 1) but reverses through the opposite side. The indicator provides four detection methods. Open flags the setup when the reversal candle opens beyond the broken level. Reclaim flags when price closes back through the opposite side of the inside bar's range. Both requires both conditions (open beyond AND close reclaim). Either flags when either condition is met. This configurability lets traders match detection to their preferred confirmation style.
Stop Loss Levels
When a signal fires with stops enabled, the indicator places a stop loss level on the opposite side of the trigger and locks it for the duration of the signal. The stop reference is selectable — the current candle for tighter risk, or C1 for wider invalidation — and an optional Break Even mode moves the stop to entry once magnitude or exhaustion is hit. A Smallest Timeframe Only mode draws just the tightest active stop when several timeframes are in force. Stop prices can be appended to alert messages.
Level Hierarchy and Consolidation
When multiple timeframes produce levels at similar prices, the indicator intelligently consolidates them into combined labels rather than hiding important information. Higher timeframes take display priority over lower timeframes — a weekly level takes precedence over a daily level at the same price — but both are represented in the consolidated label. Actionable signals (inside bars, hammers, shooters with defined triggers) take priority over static reference levels. This prevents chart clutter while preserving all relevant information in a readable format.
Intelligent Label Adaptation
Labels dynamically update as market structure changes. When a magnitude target from one timeframe coincides with a trigger level from another, the label consolidates to reflect both roles (e.g., "W MAG + D Trigger"). When levels are hit, invalidated, or superseded, labels update color and text to reflect current status rather than disappearing — preserving context for the trader.
Full Timeframe Continuity (FTFC) Filtering
FTFC status is calculated by evaluating directional bias across all enabled timeframes. When all timeframes show bullish bias (closing up relative to open), FTFC is bullish. When all show bearish bias, FTFC is bearish. Mixed bias means no continuity. Users can filter signals to only appear when FTFC aligns with the signal direction, reducing noise during consolidation.
Take Action Windows
When a signal forms on a higher timeframe, the indicator highlights the period during which that timeframe's candle remains open. This visual window reminds traders when a setup is "in force," providing a frame of reference for seeking entries on smaller timeframes.
Domino Detection
A Domino setup occurs when a signal on one timeframe can trigger another signal on an adjacent timeframe. The indicator detects and alerts on these conditions.
Bar Coloring
New in v3. Chart candles can be painted by their Strat classification or by the current Full Timeframe Continuity state, with optional highlighting when a bar flips to a Failing 2. One mode is active at a time, and coloring is off by default.
Preview Mode
When the market is closed, the indicator shifts to the next period's levels so setups can be planned before the open. The Auto default detects the instrument type and activates during off-hours — weekends for futures, pre/post-market for equities, even holidays — and turns itself off when trading resumes.
IMPLEMENTATION DETAILS
This implementation addresses several practical challenges traders face.
Multi-timeframe consolidation: Rather than constantly switching chart timeframes or mentally tracking multiple structures, all analysis exists in one view with intelligent deduplication when levels overlap.
Configurable detection methods: Hammer/shooter and Failed 2 detection aren't one-size-fits-all. The four Failed 2 methods and three hammer/shooter definitions let traders match the indicator to their specific confirmation requirements rather than accepting a single rigid definition.
Dynamic level management: Levels don't just appear and disappear — they adapt. A target becoming a trigger, a level being hit, or a setup invalidating all produce specific visual feedback rather than simply removing information. This preserves market context as price develops.
Alert filtering depth: Alerts can be filtered by FTFC alignment, signal type, specific timeframes, or Domino conditions — and the consolidated alert can append trigger, magnitude, exhaustion, and stop prices plus the FTFC state to each message — allowing traders to specify exactly which conditions warrant notification without building complex alert logic manually.
Performance optimization: Multi-timeframe analysis can be computationally expensive. This implementation consolidates data requests and limits historical depth on intensive calculations to maintain fast load times without sacrificing real-time functionality.
HOW TO USE IT
Setup
Pick a timeframe preset — TheStrat Classic, Scalp, Day Trade, Futures/Crypto, Swing Trade, or Investing — or set Custom to configure all six timeframe slots manually. Enable or disable specific bar combinations you want to see (e.g., 2-1, 3-2, etc.). Configure your preferred hammer/shooter and Failed 2 detection methods. Toggle FTFC filtering on/off based on your strategy.
Reading the Display
Solid lines represent reference levels (prior high/low). Dashed lines represent actionable triggers. Stop loss levels sit on the opposite side of the trigger. Color indicates direction (configurable) and status (hit, failed, active). Labels show timeframe, level type, and price — in Strat notation (2d-1-2u HAM) or a plain-language Universal style (REVERSAL, CONTINUATION, INSIDE, OUTSIDE, EXPANSION, FAILING). The data table shows current combo, bar type, and FTFC status per timeframe, in a Full layout or a Compact color-coded row.
Alerts
Set your chart timeframe equal to or lower than your lowest configured indicator timeframe, and set the alert interval accordingly. One consolidated alert covers every enabled timeframe with per-timeframe filtering, or use the individual alert conditions. Use alert filters to specify which conditions trigger notifications.
DOES IT REPAINT?
No. Completed-bar signals are built from confirmed higher-timeframe data and do not change on reload. The forming candle updates in real time by design — that is the live trigger you are watching — and the engineering rules that enforce this are documented in the repository.
DEFINITIONS
Combo: Two or more numbers representing the relationship between consecutive candles (e.g., 2-1, 3-2, 2-1-2). Each number indicates the candle type in sequence.
Candle Types: 1 = Inside, 2 = Directional, 3 = Outside.
Directional Bias: u = price above open, d = price below open.
C1/C2: C1 is the most recent closed candle, C2 is two bars back.
Magnitude: The measured move target, typically the C2 high or low.
Exhaustion: Extended targets beyond magnitude, indicating potential reversal zones.
FTFC: Full Timeframe Continuity — all timeframes aligned in the same direction.
Domino: A setup where one signal triggering can cascade into triggering adjacent timeframe signals.
KNOWN LIMITATIONS
PulseWire cannot request data from timeframes lower than your chart. Set chart timeframe accordingly.
Bar replay performance is unreliable with small timeframes and can produce runtime errors with certain low-timeframe combinations (PulseWire limitation).
Exhaustion calculations are limited to recent bars for performance.
Label overlap at similar price levels is a PulseWire rendering limitation.
OPEN SOURCE
The complete source is published under the Mozilla Public License 2.0, together with the engineering documentation (the no-repaint contract, the multi-timeframe correctness rules), a full changelog, and a settings reference. The repository and setup-guide links are in my signature and on my profile. This publication open-sources my earlier invite-only listing of the same name; that listing stays up for its existing users, and updates continue here.
Trading involves risk. This is a charting tool, not financial advice. Past performance does not guarantee future results. Indicator

Indicator

Zone Flow S/R StrategyZone Flow S/R Strategy
📌 Strategy Overview
Zone Flow is a multi‑timeframe support/resistance strategy that uses dynamic pivot‑derived zones to identify high‑probability reversal and breakout setups.
Unlike static support/resistance lines, this 9‑level zone system (R4–R1, P, S1–S4) automatically adapts to market structure changes at each new period (Daily/Weekly/Monthly). Each zone has a configurable width (Percentage, ATR, or Fixed) to account for volatility, and a breakout threshold to filter out minor wicks.
# Unique Synergy
Most pivot strategies treat levels as static lines, leading to false breakouts. Most engulfing strategies ignore the bigger picture, catching falling knives. This strategy solves both problems by combining these components in a specific sequence:
1- Dynamic Zones + Gap State Machine (The Context)
Instead of just drawing lines, we create zones (R1-R4, P, S1-S4) with adaptive width. More importantly, the Gap State Machine tracks which gap price sits in (e.g., between R1 and Pivot). This tells us exactly where we are in the market structure. If price moves from upper Gap to lower Gap, the strategy instantly switches sentiment from Bullish to Bearish.
- Why this matters: It prevents the strategy from trading blindly; it only trades when price is transitioning between structural levels, and price retrace to the zone drastically reducing false signals in the middle of nowhere.
2- Pin Bar Sweep + Engulfing Combo (The Momentum Trigger)
A standard pin bar alone is a weak reversal signal. A standard engulfing pattern alone is common. However, when a Pin Bar sweeps the N-bar high/low (proving a breakout attempt failed) and is immediately followed by an Engulfing pattern on the next candle, this combo represents a "double confirmation" of exhaustion.
Crucially, this specific combo overrides the EMA confirmation.
- Why this matters: Strong momentum sweeps often happen against the short-term EMA trend. By allowing this specific combo to bypass the EMA, the strategy captures powerful reversals that pure trend-following strategies miss.
3- Dynamic Zone Width (The Volatility Adaptation)
Instead of using fixed support/resistance, the zone width changes based on the selected Period's ATR or Percentage.
- Why this matters: This ensures the strategy scales perfectly across any asset (Gold, Crypto, Forex) without manual width adjustments, making it robust across different volatility regimes.
4- Selective Zone Activation (The Manual Override)
Unlike standard pivot systems that force trades on every level, the Zone Selection inputs allow users to disable specific zones (e.g., turn off R3 if price often fakes out there or turn off S4 market is always get exhausted lower probability trade).
- Why this matters: This turns the strategy from a rigid algorithm into a customizable framework where the user can apply their own discretion based on historical price behavior.
5. Hierarchical EMA Architecture (The Structural Governor)
This strategy does not treat all EMAs equally. It uses a two-tier EMA system with a strict hierarchy:
Lower TF EMA (Optional & Overrideable): The Lower TF EMA on the current timeframe acts as a micro-trend filter. However, as explained above, the Pin Bar Sweep + Engulfing Combo can override this filter. Why? Because strong institutional reversals often happen against the short-term trend, and we want to capture them.
Higher TF EMA (Absolute & Non-Negotiable): Higher TF EMA on the selected Higher Timeframe acts as an "Absolute Structural Governor." Unlike the lower EMA, this filter cannot be overridden by any pattern.
For Long entries: Price must be above this HTF EMA.
For Short entries: Price must be below this HTF EMA.
Most strategies either ignore the HTF entirely. By making the HTF EMA absolute and the LTF EMA overrideable, this strategy achieves the perfect balance:
The HTF EMA prevents catastrophic drawdowns by keeping you on the right side of the bigger trend.
The LTF EMA override allows you to catch sharp, high-probability reversals within that trend without being delayed by a slow-moving micro-filter.
6. Optional Risk Architecture (The Management Layer)
The strategy includes a built-in partial-take-profit and breakeven module. By default, this module is disabled to provide a clean, straightforward 1:3 risk-reward backtest without the complexity of multiple exit orders.
This default setting allows users to evaluate the core entry logic (zones + patterns) without interference from partial exits.
However, for traders who want to reduce psychological pressure or manage Gold's notorious retracements, they can enable Allow Breakeven and Allow Partial TP. When activated, the strategy closes a percentage of the position (e.g., 50%) at a lower R:R threshold (TP1) and moves the remaining position to breakeven—locking in early profits while letting the rest of the trade run.
# Zone Calculation
The strategy calculates 9 zones using a modified pivot point formula from the selected period (Daily, Weekly, Monthly, Quarterly, Yearly):
The pivot formula can be one of 5 methods: Classic, Fibonacci, Woodie, Camarilla, or DM.
The Classic Pivot (shown below) is the most widely used and serves as the default:
Pivot (P) = (H + L + C) / 3
R1 = (2 × P) – L
S1 = (2 × P) – H
R2 = P + (H – L)
S2 = P – (H – L)
(R3, R4, S3, S4 are logical extensions of this same principle)
Additional Methods (Briefly Explained):
Fibonacci: Uses the golden ratio multipliers (0.382, 0.618, 1.000, 1.618) to place support/resistance levels between the pivot and the high/low range.
Woodie: Gives extra weight to the closing price (Formula: P = (H + L + 2C) / 4), making it more sensitive to the current session's momentum.
Camarilla: Uses multipliers based on the previous range to place levels very close to the current price, ideal for range-bound trading and scalping.
DM: Adjusts the pivot formula conditionally based on whether the close was higher or lower than the open, making it adaptive to daily sentiment.
From these, the strategy derives:
- 4 Resistance Zones (R4, R3, R2, R1) – above the pivot
- 1 Pivot Zone (P)
- 4 Support Zones (S1, S2, S3, S4) – below the pivot
Each zone is expanded by a Zone Width to create a buffer, making the levels more practical.
# Zone Width Calculation
Three modes:
- Percentage – zone width as a percentage of current price
- ATR Multiplier – width = ATR × Multiplier
- Fixed – fixed price distance
# Gap Index Mapping (0–9):
Gap 0 – Above R4 → Aggressive (no trades)
Gap 1 – Between R4 and R3 → Bearish near R4, Bullish near R3
Gap 2 – Between R3 and R2 → Bearish near R3, Bullish near R2
Gap 3 – Between R2 and R1 → Bearish near R2, Bullish near R1
Gap 4 – Between R1 and Pivot → Bearish near R1, Bullish near Pivot
Gap 5 – Between Pivot and S1 → Bearish near Pivot, Bullish near S1
Gap 6 – Between S1 and S2 → Bearish near S1, Bullish near S2
Gap 7 – Between S2 and S3 → Bearish near S2, Bullish near S3
Gap 8 – Between S3 and S4 → Bearish near S3, Bullish near S4
Gap 9 – Below S4 → Aggressive (no trades)
Based on the gap index and price action, the strategy sets allowLong or allowShort – and displays the status on the info table.
Market Status Displayed:
- Bullish – near support zones; long trades allowed
- Bearish – near resistance zones; short trades allowed
- Waiting – new period started; zones recalculating; no trades
- Aggressive – above R4 or below S4; no trades
- Zone disabled – manually disabled zone; no trades
# Entry Signals
1. Engulfing Patterns
Detects bullish and bearish engulfing with filters:
- Body Only – if true, only bodies must engulf (not full range)
- Min/Max Range – can be Percentage, ATR Multiplier, or Fixed
- Gap Allowance – max price gap between previous close and current open
- Previous or Prior Candle – at least one of the last two candles must be the opposite. color (bearish for bullish engulf; bullish for bearish engulf).
This is not a random condition. The strategy only considers trades when price is near a strong structural zone (support/resistance). Because the zone itself provides the primary context for a potential reversal, the immediate previous candle does not need to be strictly opposite in color.By relaxing the requirement to "at least one of the last two," the strategy captures valid reversals at key levels that a strict, textbook rule would miss—while remaining highly selective because it only trades near strong zones.
2. Pin Bar + Engulfing Combo (EMA Override)
Identifies hammers/shooting stars with:
- Wick/Body Ratio (Wick 3× body)Requires a clearly defined pin bar with a very small body.
- Max Body/Range (Body is at most 20% of range) Ensures the body is genuinely small relative to the total range. This is the textbook definition of a pin bar/hammer. Captures true rejection candles.
- Min Wick/Range (70% of range) This is the classic pin bar definition. A 70%+ wick means price aggressively rejected the level and reversed.
- Sweep Lookback – bullish pinbar must break the lowest low of the previous N bars;
bearish must break the highest high
a pin bar that sweeps a recent extreme (lookback) and the very next candle forms an engulfing pattern in the same direction. This combo overrides the Lower TF EMA confirmation – a unique feature that captures strong momentum after a sweep.
Combined Entry Requirements
All of the following must be true:
1. Valid engulfing or pin+engulf combo
2. Pattern occurs near a zone (open inside zone boundaries or crossing it)
3. Market status aligns with trade direction
4. Daily trade limit not exceeded (default: 2)
5. Relevant zone is enabled
6. Price is on the correct side of EMAs (unless overridden by combo)
7. HTF EMA confirms (if enabled)
8. RSI not overbought/oversold (if enabled)
9. Not within the no‑trade window (if enabled)
-----------------------------------------------------
# Confirmation Filters
Current TF EMA – ensures micro‑trend alignment. Overridden by pin+engulf combo.
Higher TF EMA (default 150 on 1H) – filters out counter‑trend moves in the bigger picture.
RSI – prevents buying above 70 and selling below 30.
Bollinger Bands – blocks trades when volatility is too low (BB width below threshold).This filter is specifically designed for assets that range heavily—choppy, sideways markets.
No‑Trade Window – avoids end‑of‑day volatility (active only for timeframes ≤15min).
# Risk & Position Management
1- Position Sizing:
- Risk per trade – percentage of equity for first trade, separate for second
- Position size = (Account Risk) / (Entry – SL distance).
- Second trade does not increment the daily trade counter:
This is a deliberate design choice. The daily trade counter tracks new trade initiations, not total positions. The second trade (pyramiding) is considered a continuation of the existing position, not a new independent decision. This ensures the strategy can scale into strong trends without consuming the daily limit, while still respecting the maximum number of new entries per session.
2-Stop Loss Options:
- Low-High – entry bar low/high ± buffer Tight, reactive stops. Best for scalping or when you want the SL to follow the immediate price action of the entry candle.
- Swing high/low – N-bar low/high ± buffer Broader, structural stops. Ideal for swing trading or when you want the SL to respect recent market structure rather than a single bar.
- Zone – zone boundary ± buffer Structural stops aligned with pivot levels. Best when you want the SL to be placed exactly at the structural support/resistance level that defines the trade.
- Fixed distance – fixed price distance Simple, static stops. Useful when you know your exact risk tolerance in dollar/pip terms and want a consistent SL distance regardless of volatility.
- ATR Multiplier – entry ± (ATR × multiplier) Volatility-adaptive stops. Best for Gold's changing volatility—widens during news/high volatility, tightens during calm periods.
3- Take Profit:
- Main R:R ratio – main R:R ratio (default 1:3), plus optional partial TP and breakeven at a lower R:R ratio.
- Partial TP – close a percentage of position at a lower R:R (TP1)
- Breakeven – optionally move stop to entry at TP1
4- Trade Counter Reset:
- For TF ≤ 15m: resets at NY (9:30 AM) and London (3:30 AM) starts (configurable)
This aligns with Gold's session-specific volatility and allows fresh participation in each session while preventing over-trading within a single session.
- For TF > 15m: resets once per day at session start (Every new day) Session-specific behavior is less relevant on higher timeframes, and a simple daily cap is more appropriate for swing trading.
5- No‑Trade Window:
- Avoids high‑volatility periods (e.g., end of day)
- Active only for TF ≤ 15m (16:00 PM – 18:30 PM NY time, configurable) End-of-day volatility spikes can cause excessive slippage and erratic price action on short timeframes. on TF > 15 The window is too short to be meaningful; higher timeframe traders are less affected by brief volatility spikes.
6- Session Close:
- TF ≤ 15m: can close at day end and/or week end (configurable). Scalping trades on 1m–15m charts typically last minutes to a few hours. These trades are highly sensitive to Overnight gaps, Weekend gaps
- 15m < TF ≤ 10h: only week end. Swing trading on 30m–4H charts typically lasts hours to several days.
- TF > 10h: feature disabled. Position trading on daily+ charts lasts days to weeks. These trades aim to capture large macro moves.
# Chart Display
- Zone boxes – semi‑transparent red/pink with labels (R4…S4), auto‑cleanup (max 55 periods)
- Trade management lines – entry (white), SL (red), TP (green), TP1/breakeven (dashed),
with green/red fills; auto‑cleanup ((4) * max 125)
- Info table (top‑right) :
1. shows Market Status(Bullish/Bearish/Aggressive/Waiting).
2. EMA confirmations.
3. Zone Width, Breakout threshold.
4. Engulf range max min.
5. SL settings(SL refrence, sL bufer)
- EMA plots – light blue (lower TF) and light red (higher TF)
- Signal shapes – hidden by default (can be enabled via style settings)
- arrowdown shapes - "Reset trade counter"
- Background 1 color – yellow during no‑trade window
- Background 2 color – white close all position on week/day end.
UI Note: Inputs are hidden from the status line to keep your chart clean. All settings (zones, EMAs, risk, patterns) remain fully adjustable in Settings → Inputs.
# Default Settings – Optimized for XAUUSD (Gold)
All default values have been calibrated specifically for Gold's typical volatility and intraday structure.
(Setting : Default : Why This Works for Gold)
----------------------------------------------------------------------------------------
Period : Daily : Gold respects daily highs/lows as key structural levels.
-----------------------------------------------------------------------------------------
Pivot Type : Classic : Most widely used and reliable for Gold.
-----------------------------------------------------------------------------------------
Zone Width : ATR (0.053× ATR(14)) : ATR(14) provides a stable, week-to-week view of Gold's volatility (roughly two trading weeks of data).Adapts to Gold's daily volatility (Zone Width often $4–$10 range).
-----------------------------------------------------------------------------------------
Breakout Threshold : 7% of zone width : Zone width ≈ $3.00–$10.00 (Daily ATR × 0.053). 7% ≈ $0.21–$0.70 (21–70 ticks)—filters noise wicks, captures genuine breaks.Prevents false transitions caused by standard stop-hunting wicks
-----------------------------------------------------------------------------------------
Engulfing Range : ATR(14) (0.375× – 2.5×) : ATR(14) sits in the "sweet spot"—responsive enough to capture shifts in Gold's volatility relatively quickly, yet long enough to smooth out the daily noise and provide a reliable, consistent measure. Captures meaningful moves $3–$15—ensures candle has enough size to be meaningful, rejecting tiny $0.30–$0.50 noise patterns, while filtering out massive blow-off spikes (> $20–$25 on 15m).
-----------------------------------------------------------------------------------------
Pin Bar Sweep : 12 bars : 12 bars – Calibrated for Gold's 3-hour intraday cycle and session transitions. Long enough to capture genuine liquidity grabs, short enough to avoid outdated levels.
-----------------------------------------------------------------------------------------
Risk per trade : 2% (1st), 1% (2nd) : Balances risk with Gold's occasional false breakouts. For Gold's volatile nature, 2%-1% provides the best balance between survival and growth.
-----------------------------------------------------------------------------------------
Risk:Reward : 1:3 : Gold routinely moves 1.5–2× its ATR in a single directional push. A 1:3 target is well within Gold's typical daily range.
-----------------------------------------------------------------------------------------
Stop-Loss Reference : ATR Multiplier : For Gold's volatile nature, a static stop-loss (Fixed or Low-High) cannot adapt to changing volatility. ATR-based SL scales with market conditions—widening during high volatility (news, session opens) and tightening during calm periods. This ensures the stop-loss is always "fair" relative to current market conditions, preventing premature stops during normal volatility spikes
-----------------------------------------------------------------------------------------
Stop-Loss Multiplier : 1.8× ATR(14) : A 1.8× ATR(14) stop-loss represents 1.8 times Gold's average 14-period range. Why 1.8× and not 2.0× or 1.5×? Backtesting revealed that 1.8× is the "sweet spot"—wide enough to survive Gold's normal volatility spikes without being stopped out by noise, yet tight enough to limit losses
-----------------------------------------------------------------------------------------
Current TF EMA : 21 (Enabled, Overrideable) : On 15m chart = 5.25 hours—perfectly captures Gold's average intraday move length. Can be overridden by Pin Bar + Engulfing Combo to catch institutional reversals that occur against the short-term trend.
-----------------------------------------------------------------------------------------
Higher TF EMA : 150 on 1H : On Gold, a 150-period EMA on a 1H chart represents roughly 6.5 days (one full trading week) of data. By making this filter absolute, the strategy guarantees it will never take a counter-trend trade against the weekly macro-structure.trend.
-----------------------------------------------------------------------------------------
Filter (RSI) : length 12 : Most traders default to RSI(14), but RSI(12) is intentionally faster for Gold's volatile intraday moves. Gold often spikes into overbought/oversold territory and reverses quickly. A 12-period RSI reacts ~15% faster than RSI(14), catching these reversals earlier while remaining smooth enough to avoid excessive whipsaws.
-----------------------------------------------------------------------------------------
Filter (Bollinger Bands) : Disabled by default : Gold is historically a trending asset with strong directional moves. A low-volatility filter would unnecessarily block valid entries during these trends. Designed for range-bound assets (choppy crypto, certain forex crosses)—enable it only if your market consolidates heavily.
-----------------------------------------------------------------------------------------
These values are a starting point – you may adjust them for other assets or personal risk tolerance.
# Important Notes on Backtest Realism
- Commission – Most ECN/raw-spread brokers charge $3.00–$3.50 per side (round-turn commission of $6.00- $7.00) for 1 standard lot (100 oz) of XAUUSD. Standard accounts usually build the fee into a wider spread instead of charging a separate cash. This strategy deducts $3.50 per entry and $3.50 per exit ($0.035 × 100 oz)round-turn commission of $7.00. Adjust this to match your broker's exact fees.
- 4 ticks Slippage - For XAUUSD, 1 tick = $0.01 per ounce. 4 ticks = **$0.04 per ounce (unit)**. Accounts for real-world price . Prevents overly optimistic backtest equity curves.
Always adjust the commission value to your broker's exact fee structure before relying on the results.
"A backtest without realistic commission and slippage is a fantasy. A backtest with realistic commission and slippage is a truthful reflection of what you can expect when trading live."
- Intra-Bar Execution: The strategy uses calc_on_every_tick = true, meaning it recalculates on every price tick during real-time trading. This allows the breakeven and partial TP logic to trigger immediately when price hits TP1, protecting the trade from intra-bar reversals.
Note: Backtests use OHLC data only, so intra-bar fills and breakeven triggers cannot be perfectly simulated. Real-time performance may differ from backtest results due to this limitation
# The Core Innovation (Why This Isn't Just a Mashup)
This strategy is built on a three-layer validation system. Each layer solves a specific problem that the other layers cannot solve alone.
Layer 1 (The Structure): Dynamic Pivot Zones
Layer 2 (The Trigger): Pin-Bar Sweep + Engulfing Combo
Layer 3 (The Execution): Gap State Machine
Here is how they interdepend to create a unique edge:
1. Adaptive Pivot Mathematics (The "Regime Matching" Logic)
Instead of offering multiple pivot types just for the sake of it, this strategy provides them so the trader can match the mathematical formula to the market's current behavioral regime:
Why this matters: Most strategies lock you into one formula. This strategy acknowledges that price dynamics change, and it gives you the mathematical weapon to adapt without rewriting the entire code.
2. The "Liquidity Grab" Trigger (Sweep + Engulfing Combo)
This is the most critical edge of the strategy. A standard Engulfing pattern is common. A standard Pin Bar is common. But when they occur sequentially—a Pin Bar that sweeps the 12-bar extreme, immediately followed by an Engulfing candle—it represents a textbook institutional "liquidity grab."
- The Logic: Large players often push price to sweep obvious stop-losses (above highs or below lows) before reversing the trend.
- The Override: Crucially, this specific combo overrides the Lower TF EMA confirmation.
- Why this is a breakthrough: Standard trend-following strategies with a hard EMA filter will miss these reversals because price is moving against the EMA in the short term. By programming this specific override, the strategy captures the exact moment of institutional reversal—catching the move before the EMA flips and the trend-followers finally enter.
3. The Gap State Machine (Dynamic Sentiment Tracking)
Unlike static support/resistance scripts that just plot lines and wait for touches, this strategy features a state machine that tracks which of the 9 gaps (between R4-R1, Pivot, S1-S4) the price currently occupies.
- The Mechanism: A Breakout Threshold (default 7% of zone width) acts as a "dead-zone" filter. Price must exceed this threshold to officially transition from one gap to another.
- The Alpha: This prevents the strategy from whipsawing during minor noise. When price crosses from Gap 4 (between R1 and Pivot) into Gap 3 (between R2 and R1), the strategy instantly and autonomously switches market status from "Bearish" to "Bullish" or vice versa.
4. Selective Zone Activation (Strategic Discretion)
- This strategy allows the user to completely disable specific zones (e.g., turn off R3).
- The Value: By disabling a weak level, the user forces the strategy to wait for the next stronger level, instantly increasing the win rate and filtering out historically weak signals without altering any other code.
5. Non-Invasive Risk Architecture (Clean Defaults)
For traders who want to reduce psychological pressure or optimize for Gold's notorious retracements, they can enable these modules. When activated, the strategy closes % of the position at a lower R:R threshold and moves the remaining position to breakeven—locking in profits while letting the rest run.
In Summary: The "Mashup" Justification
This is not a random collection of indicators.
1. The State Machine provides the structural context.
2. The Pin+Engulf combo provides the high-conviction trigger that overrides slow-moving filters.
3. The Selectable Pivot Types provide the mathematical adaptability to different assets.
4. The Selectable Zones provide the manual discretion to avoid historical losing levels.
5. The Disabled TP/BE by default provides a clean baseline for evaluating the core logic.
Author: Awab_Hassan
Strategy

Indicator

Indicator

Indicator

ICT Session Toolkit - Killzones, Macros, True Opens and SessionThe only ICT indicators you will need in one script. CME_MINI:NQ1! CME_MINI:ES1!
This toolkit combines the intraday session tools an ICT-style trader needs into a single indicator, so a full session read — killzones, macro windows, true opens, session-open markers and equal highs/lows — comes from one script instead of five separate ones sharing chart space and settings panels.
Why a mashup? These tools are designed to be read together: killzone pivots mark session liquidity, macro windows show when algorithms are most likely to seek that liquidity, true opens give the premium/discount reference for the day and week, and equal highs/lows mark the resting liquidity that macros often target. Running them as one script means one timezone setting drives every session calculation, the drawings share one visual style, and each module can be switched on or off from a single master toggle section — something impossible when the tools live in separate indicators.
What's included and how each part works
Killzones and pivots — Boxes and high/low pivot lines for the Asia, London, NY AM, NY Lunch and NY PM sessions. Pivot lines extend until price mitigates them and can alert when broken. Day/week/month opens, highs/lows and separators are also available.
ICT macro windows — The known macro times (London 02:33 and 04:03; New York 08:50, 09:50, 10:50, 11:50, 13:10 and 15:15) are boxed and classified as Accumulation, Manipulation or Expansion by comparing the macro's open/close position within its range against the most recent lower-timeframe swing points. By default only the text classification is shown to keep charts clean; lines and boxes can be re-enabled per macro. Macros require a 1, 3 or 5 minute chart.
True opens — Dotted horizontal lines at the True Day Open (00:00), True Week Open (Monday 18:00) and the 10:00 open, each anchored to its opening price and running until the next open of the same type (the 10:00 line is limited to a configurable 60 minutes). These serve as premium/discount dividers for their respective periods.
Session-open markers — Original addition: a dotted pre-session box tracking the 07:00-09:00 high/low, plus short vertical markers at the NY (09:30), Asia (20:00) and London (02:00) opens sized in points around the opening price, so the open is visible without a full-height line cluttering the chart.
Equal highs and lows — Detects untested equal highs/lows as liquidity levels and removes them once traded through, with an optional realtime mode.
How to use it Set your timezone once in the killzone settings (defaults to New York). Each module has its own settings group prefixed KZ, MACRO, TO or EQ, and every module can be disabled from the Master Toggles section. For alerts (broken killzone pivots, daily/weekly high-low breaks), create an alert on the indicator and choose "Any alert() function call".
Limitations to be aware of All modules share the script's drawing limits, so on long lookbacks the oldest drawings are removed first. Macro classification uses 1-minute lower-timeframe data and only draws on charts of 5 minutes or less. The vertical open markers are sized in raw points and default to values suited to index futures — adjust for other instruments. This indicator draws session context only; it does not generate buy/sell signals and no performance is implied.
Credits The killzone/pivot engine is based on open-source code by tradeforopp (ICT Killzones & Pivots), the macro detection and classification on open-source code by LuxAlgo (ICT Macros), and the equal highs/lows detection on open-source code by OutofOptions, whose helper library this script imports. Significant modifications include conversion to Pine v6, a unified settings and toggle architecture, restyled macro display, a bounded 10:00 open line, and the original pre-session box and session-open marker module. Indicator
