Ayoub SMC AnalystAyoub SMC Analyst is a market-structure and price-action analysis indicator designed to help traders study market structure, liquidity behavior, Fair Value Gaps (FVGs), premium/discount areas, trend direction, and potential price targets from a single chart.
WHY THIS SCRIPT WAS CREATED
The purpose of Ayoub SMC Analyst is to organize important market-structure information directly on the chart without requiring multiple separate indicators.
The script focuses on structured market analysis rather than presenting guaranteed buy or sell signals. Its objective is to help traders identify important areas and build their own trading scenarios.
CORE FEATURES
• Higher High (HH)
• Higher Low (HL)
• Lower High (LH)
• Lower Low (LL)
• Bullish and Bearish Break of Structure (BOS)
• Buy-side and sell-side liquidity sweep detection
• Bullish and bearish Fair Value Gap (FVG) identification
• Premium and Discount areas
• Equilibrium level
• Major support and resistance levels
• Short-term and long-term trend direction
• Conditional bullish and bearish target levels
• Projected market scenarios
• Configurable structure sensitivity
• Optional labels and target visibility
HOW IT WORKS
The indicator uses confirmed swing highs and swing lows to evaluate market structure. It compares recent structural points to identify HH, HL, LH and LL formations.
Break of Structure conditions are detected when price crosses important structural levels.
Liquidity sweep conditions are identified when price temporarily moves beyond a structural high or low and closes back across that level.
Fair Value Gaps are identified using a three-candle price imbalance condition.
Premium and Discount areas are calculated from the most recent valid structural range, with the midpoint used as equilibrium.
Potential target levels are calculated from the current structural range. These levels are scenario-based reference points and are not guaranteed future price destinations.
HOW TO USE
1. Add the indicator to a standard candlestick chart.
2. Adjust Structure Sensitivity according to the timeframe and market.
3. Use HH, HL, LH and LL to understand the current market structure.
4. Monitor BOS and liquidity sweep markers around important structural levels.
5. Use FVG and Premium/Discount information as additional confluence.
6. Treat projected targets as analytical reference levels rather than guaranteed outcomes.
7. Combine the indicator with your own risk management and market analysis.
ORIGINALITY AND PURPOSE
Ayoub SMC Analyst is designed as a unified market-structure analysis tool with a specific focus on organizing structural levels, liquidity events, imbalance conditions, trend direction and scenario-based targets in one visual framework.
The goal is to reduce unnecessary chart clutter while keeping the main structural information visible and understandable.
LIMITATIONS
This indicator does not predict the future with certainty and does not guarantee profitable trades.
Market structure can change as new price information develops. Swing-based calculations can also change as new confirmed pivots appear.
The indicator is an analytical tool and should not be considered financial advice. Traders should independently evaluate market conditions, position sizing and risk before making any trading decision.
CHART EXAMPLES
TradingView chart examples:
Indikator

Fade Setup OverlaysWHAT IT IS
Fade Setup Overlays is a chart readout for crypto perpetual futures. It tracks one specific pattern: a "fade" setup that can form after a strong momentum leg. It shows the current state of that pattern in a small table, plus three context flags, and can raise an alert when the state changes. It runs on either side of the market: fade highs (short-side setup) or fade lows (long-side setup).
It is an execution aid for reading the chart. It is not a signal service, not a strategy, and not an edge. Nothing here predicts price. "Short-side" and "long-side" name the direction of the setup being tracked; they are descriptions of chart state, not recommendations to trade.
HOW IT WORKS
The indicator runs a small state machine. The first condition that matches sets the mode:
- CHOP: ADX(14) on the last completed regime-timeframe bar is below the unlock threshold (default 25). The setup is not tracked.
- IMPULSE LEG: the regime ADX is unlocked and the swing extreme was set very recently, with no reversal bar.
- FADE ARMED: the swing extreme is fresh (default: within 4 reference hours), price is still within a set % of it (default 2.5%), and no reversal bar has printed.
- FADE WINDOW: a reversal bar printed while the extreme is fresh and price is within 3% of it.
- EXTENDED: price has already moved more than 2.5% away from the extreme.
- COOLING: none of the above.
The Side input picks the direction. Short (fade highs) tracks the highest high of the window and a reversal-down bar (a lower high that closes below the previous bar's low). Long (fade lows) mirrors everything: the lowest low of the window and a reversal-up bar (a higher low that closes above the previous bar's high). The three flags mirror too.
Each mode label comes with a short neutral description. On the chart, the script plots the swing-extreme watermark and a small triangle on reversal bars that print inside the fresh-extreme window.
TIMEFRAMES
The setup is defined in "reference hours" on a 15m chart: a 12h extreme, a 2h CVD window, a 24h premium z-score window, and a 1h ADX regime gate. With Auto-scale on (the default) every window is multiplied by chart-minutes / 15 and the regime timeframe moves one rung above the chart, so the readout keeps the same proportions on any chart from 1m to 1D:
- 15m chart: 12h extreme, 2h CVD, 24h z-score, 1h regime ADX, 1m intrabars
- 1h chart: 48h extreme, 8h CVD, 4d z-score, 4h regime ADX, 5m intrabars
- 4h chart: 8d extreme, 32h CVD, 16d z-score, 1D regime ADX, 15m intrabars
- 1D chart: 48d extreme, 8d CVD, 96d z-score, 1W regime ADX, 1h intrabars
Turn Auto-scale off to use the literal hour values on every chart. The table labels show the actual windows in use (for example "1D ADX" and "8d hi" on a 4h chart).
THE THREE OVERLAY FLAGS (ALL PROXIES)
Each flag is shown as ✓ (condition present), · (absent) or ? (data unavailable).
1. CVD-div (proxy): net signed volume over the CVD window leading into the extreme bar. The script pulls lower-timeframe bars with request.security_lower_tf and signs each bar's volume by its candle direction. Short side: ✓ when the net is flat or negative into the high. Long side: ✓ when the net is flat or positive into the low.
2. prem-z (proxy): the perp-vs-spot close spread, (perp - spot) / spot, z-scored against its trailing window. Short side: ✓ when the z-score went above +1.5 inside the CVD window. Long side: ✓ when it went below -1.5.
3. OI-stall (proxy): TradingView's open-interest symbol for the perp. ✓ when current open interest is below open interest at the extreme bar, on either side.
Honesty note: exchange-native CVD, perp premium and open-interest feeds are built from data TradingView cannot load. These proxies are directionally similar to those feeds but numerically different. Treat them as context, not ground truth.
The flags use a tri-state int (-1 unknown / 0 no / 1 yes) because a Pine v6 bool cannot hold na. That keeps missing data visible as "?" instead of turning it into a silent "no".
ALERTS
Alerts fire only when the state changes, not on every bar the state is true. They describe a chart state and nothing more.
Option A, one alert for everything: create a single alert on this indicator with the event "Any alert() function call" and the trigger "Once per bar close". The script formats the message itself. In "Readable text" mode the message carries the side, the state, the close, the extreme with its age and distance, the regime ADX, and the three flags. In "JSON (webhook)" mode each event is one JSON object ("action" = open on FADE WINDOW, close_all on INVALIDATED, and optionally info on FADE ARMED) with the same fields, for people who already run their own webhook receiver. The position_size_pct, leverage and secret fields in JSON mode are plain inputs passed through verbatim; the script never sizes, places, or sends anything itself. TradingView delivers whatever the alert is pointed at.
Option B, one alert per event: six alertcondition() events (Short/Long × FADE ARMED, FADE WINDOW opened, INVALIDATED) for anyone who prefers separate alerts.
INPUTS
Setup
- Side: Short (fade highs) or Long (fade lows).
- Regime ADX unlock threshold (25): below this, the mode is CHOP.
- Extreme freshness, hours at 15m (4): how recent the extreme must be for FADE ARMED / FADE WINDOW. Auto-scales.
- Max % from extreme to stay armed (2.5): the distance limit for FADE ARMED. Not auto-scaled; widen it by hand on 4h/1D if needed.
Scale
- Auto-scale windows to chart timeframe (on).
- Extreme lookback, CVD window, premium z window, all in hours at 15m (12 / 2 / 24).
- Regime ADX timeframe: leave on "Chart" for automatic (one rung above the chart), or set it by hand. It must be higher than the chart timeframe.
Overlays
- Spot symbol: leave blank to derive it from the chart (BINANCE:SOLUSDT.P becomes BINANCE:SOLUSDT), or type the spot pair by hand.
- Open-interest symbol: leave blank to derive it from the chart (BINANCE:SOLUSDT.P_OI), or type it by hand.
- CVD lower timeframe: leave on "Chart" for automatic (1m / 5m / 15m / 1h by chart timeframe), or set it by hand.
Alerts
- Combined alert() on/off, include INVALIDATED events, an optional personal note appended to text alerts, message format (Readable text / JSON), and the JSON pass-through fields.
Visuals
- Table position, text sizes, cell padding, compact labels, and a credit row toggle.
SETUP
1. Open a crypto perpetual chart on any timeframe from 1m to 1D. Example: BINANCE:SOLUSDT.P on 15m or 4h.
2. Add the indicator and pick the Side.
3. If a flag stays at "?", open the inputs and set the spot symbol and open-interest symbol by hand. Use Symbol Search: the spot pair from the same exchange as your perp, and " open interest" for OI.
4. Optional: create one alert on "Any alert() function call", trigger "Once per bar close".
LIMITATIONS
- Timeframes: 1m to 1D only. Multi-day, weekly and monthly charts stop with an error message, because the windows are computed from minutes per bar.
- Intrabar depth: TradingView keeps limited lower-timeframe history and caps intrabar requests at 100,000 bars, so CVD-div reads "?" on older bars. The automatic CVD timeframe is chosen to keep that history usable on each chart timeframe.
- OI availability: not every perp has a TradingView open-interest symbol. Where none loads, OI-stall reads "?".
- Proxies: all three flags approximate exchange-native data and will differ from it.
- Regime ADX: requested from the higher timeframe as an offset expression (value ) with lookahead on, which is the non-repainting form recommended by PineCoders. It returns only completed higher-timeframe bars and carries no lookahead bias.
- Repainting: the reversal bar, flags and mode are computed on the chart's bars, so on the live bar they can change until that bar closes. That is why alerts use "Once per bar close". Nothing beyond this is guaranteed.
- The percentage thresholds (2.5% and 3%) are not auto-scaled with the timeframe.
- The table shows the last bar only. It is not a backtest and makes no statement about outcomes.
DISCLAIMER
Educational use only. Not financial advice. Do your own research. This script is a chart readout and makes no performance claims. Crypto perpetual futures are high risk, and leverage can lose more than the initial margin. The author may hold positions in the assets discussed.
LICENSE
Open-source under the Mozilla Public License 2.0. Free to use, study and fork; attribution is appreciated. Indikator

HTF 3-Candle System (Zeiierman)█ Overview
HTF 3-Candle System (Zeiierman) is a higher-timeframe market structure indicator designed to analyze the relationship between three consecutive HTF candles and identify the price pattern that currently best describes the developing structure.
Instead of looking for a single fixed candlestick formation, the indicator evaluates multiple bullish and bearish three-candle structures simultaneously. Each pattern receives a dynamic quality score based on factors such as candle direction, range, body strength, liquidity sweeps, displacement, imbalance, compression, expansion, and the developing behavior of the live third candle.
The three higher-timeframe candles are defined as:
• C1 = the completed HTF candle two periods back
• C2 = the previous completed HTF candle
• C3 = the current live HTF candle
C3 updates continuously while the higher-timeframe candle is forming, allowing the pattern ranking and projected levels to evolve with current price action.
The System evaluates 12 three-candle structures:
• Bullish Sweep Reversal
• Bearish Sweep Reversal
• Bullish FVG Displacement
• Bearish FVG Displacement
• Bullish PO3 Sequence
• Bearish PO3 Sequence
• Bullish Expansion
• Bearish Expansion
• Bullish Compression Break
• Bearish Compression Break
• Morning Star Reversal
• Evening Star Reversal
The three highest-ranked structures are displayed in the 3-CANDLE SYSTEM table together with their current scores. The highest-ranked pattern also controls the live state message and the projected structural levels.
█ How It Works
⚪ 3-Candle HTF Structure
The indicator analyzes three candles from the selected higher timeframe:
• C1 = two HTF candles back
• C2 = previous HTF candle
• C3 = current live HTF candle
C1 = HTF
C2 = HTF
C3 = current HTF
C1 and C2 are completed candles, while C3 updates live until the current higher-timeframe candle closes.
⚪ Pattern Quality Scoring
The System evaluates 12 bullish and bearish three-candle structures and assigns each one a quality score.
The score combines structural conditions with softer proximity measurements, so a setup can begin ranking before every condition is fully completed.
Factors include liquidity sweeps, candle direction, body strength, range, displacement, FVGs, compression, expansion, and recovery or rejection around key levels.
score = structure + proximity + candle strength
⚪ Top 3 Pattern Ranking
All pattern scores are ranked from highest to lowest.
The strongest structure becomes the active pattern, while the second and third highest scores remain visible for additional context.
patterns.sort(order.descending, sort_field="qualityScore")
⚪ Live Pattern State
The top-ranked structure also shows its current stage, such as:
• sweep or reclaim developing
• FVG live
• breakout or breakdown developing
• compression
• PO3 distribution
• reversal developing
⚪ Projected Pattern Levels
The active pattern projects the levels most relevant to that structure, including sweep levels, breakout levels, FVG boundaries, CE 50%, equilibrium, recovery levels, and invalidation.
Nearby levels can automatically merge to reduce visual clutter.
⚪ Projected HTF Candles
C1, C2 and C3 are reconstructed to the right of price using their actual higher-timeframe OHLC values. C3 updates live as the current HTF candle develops.
⚪ HTF Mapping
The System can map C1, C2 and C3 directly over the lower-timeframe candles that formed them.
High and low dots identify the exact lower-timeframe candles that created each HTF extreme. Completed C1 and C2 levels can also change from Active to Mitigated after being traded through.
█ How to Use
The examples below show how the System behaves across different three-candle structures. The table identifies the highest-ranked pattern, while the bottom row shows the pattern's current live state.
⚪ Bearish Expansion
Here, Bearish Expansion is the highest-ranked pattern at 85.0%, and the state reads BEARISH EXPANSION LIVE.
C1, C2, and C3 progressively shift lower, with C3 extending strongly through the previous structure. The projected levels identify the Breakdown, the level price should Hold Below, and the Invalidation level above.
⚪ Bearish FVG Displacement
In this example, Bearish FVG Displacement reaches a 100.0% score and the state reads BEARISH FVG LIVE.
The strong downside movement leaves C3 separated below C1, creating the bearish imbalance. The System projects the FVG Upper, CE 50%, C3 High, and Invalidation levels around the active structure.
⚪ Bearish FVG With Merged Levels
This is another Bearish FVG Displacement, ranked at 98.1%.
Here, the FVG Upper and CE 50% are close enough to be merged into a single projected level. This demonstrates how the System combines nearby structural references when they overlap.
⚪ Bullish FVG Displacement
This example shows a Bullish FVG Displacement with a 100.0% score and BULLISH FVG LIVE state.
Strong upside displacement leaves the C3 low above the earlier C1 structure. The projected FVG Lower, CE 50%, C3 Low, and Invalidation levels define the active bullish imbalance.
⚪ Bearish Compression Setup
Here, Bearish Compression Break ranks first at 91.2%, but the state still reads COMPRESSION - WATCH RANGE LOW.
This is important because the bearish break has not yet confirmed. C2 is contained within the C1 range and C3 is pressing toward the lower boundary. The Range Low / Breakdown level shows where bearish confirmation would occur, while Equilibrium and Range High define the rest of the compression structure.
⚪ Bullish Power of 3
In this example, Bullish PO3 Sequence ranks first at 85.0%, with the state PO3 DISTRIBUTION LIVE.
The sequence shows a downside manipulation followed by a strong bullish C3 expansion. The System highlights the Manipulation Low, the Distribution level above, and the structural Invalidation level.
⚪ Bearish Sweep Reversal
Here, Bearish Sweep Reversal is ranked first, but the state reads HIGH SWEPT - NEED RECLAIM.
Price has already swept above the C1 high, but the reversal is not yet fully confirmed. The next requirement is for C3 to move back below the projected C3 Close < level. The swept high and invalidation have merged into one structural level.
⚪ Bullish Sweep Reversal
This example shows Bullish Sweep Reversal ranked first at 82.0%, but the state is still WATCHING C1 LOW.
This is an earlier-stage setup. The System is identifying the bullish sweep structure as the best current match, but the C1 low has not yet been swept. The projected Sweep Low + Invalidation level shows the liquidity area being watched, while C3 Close > marks the bullish confirmation level.
⚪ Evening Star Reversal
Here, Evening Star Reversal ranks first at 80.6%, with the state AWAITING REJECTION BELOW C1 MID.
The reversal structure is developing, but C3 has not yet moved far enough below the C1 midpoint to confirm stronger rejection. The projected levels show 50% Rejection, Full Rejection, and Invalidation.
⚪ Bullish Compression Setup
In the final example, Bullish Compression Break ranks first at 84.3%, while the live state reads COMPRESSION - WATCH RANGE HIGH.
C2 remains compressed inside the C1 structure and C3 is moving toward the upper boundary. The bullish breakout is not confirmed until price pushes through the projected Range High / Breakout level. Equilibrium and Range Low provide the remaining structural references.
█ Settings
Higher Timeframe: Selects the higher timeframe used to construct C1, C2 and live C3. The selected timeframe must be higher than the chart timeframe.
Strong Match Threshold: Sets the minimum quality score required for the highest-ranked pattern to be treated as a strong match.
Show Projected HTF Candles: Shows or hides the reconstructed C1, C2 and C3 candles to the right of current price.
Offset: Controls how far the projected candle structure appears from current price.
Candle Spacing: Controls the horizontal spacing between projected C1, C2 and C3.
Merge: Controls how close two projected levels can be before they are combined.
Spacing: Controls horizontal spacing between pattern level labels.
-----------------
Disclaimer
The content provided in my scripts, indicators, ideas, algorithms, and systems is for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a solicitation to buy or sell any financial instruments. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
Indikator

Swing High Low - Definition and SequenceSwing High Low - Definition and Sequence marks confirmed swing highs and lows and studies how their interpretation changes with confirmation time and price definition.
Its central question is practical: does a swing identified from a wick also exist at the same candle when using body edges or closes, and how does price behave after that first confirmation?
The script connects three observations: the same origin across progressively longer confirmation windows, its dependence on wick/body/close definitions, and the subsequent sequence of outside excursions, consecutive outside closes and inside returns. Comparison groups are fixed using information available at Stage I, rather than defined by which origins later survive Stage III.
The chart stays compact. Detailed measurements are available through table tooltips and the Data Window. This is an open-source research indicator, not an automatic entry system, a best-parameter selector or a strategy backtest.
Quick start
Use standard candles and begin with the default Confirmation bars placement. Magenta downward triangles mark high confirmations; mint upward triangles mark low confirmations. A triangle identifies the candle that confirmed an earlier extreme, not necessarily the extreme candle itself.
For the detailed research, open settings group 07, Definition and ordered-path study. Set Inspect record (0 = latest origin, 1 = latest completed) to 1. Then hover over the numeric cells on the relevant HIGH or LOW side:
Origin price: the selected origin's wick/body/close definition tests.
Origin age: its ordered post-confirmation path.
Depth / ATR: signed isolation margins and first-confirmation group statistics.
N / open: sample admission, completion, pending observations and exclusions.
An inspection offset of 0 follows the latest accepted origin, which may still be unfinished. Offsets 1, 2 and higher select successively older completed admitted records. Each inspected record identifies its own time and price. Inspection changes only these tooltip sections: the printed latest-origin values and chart markers retain their usual meanings. An unavailable offset displays no record rather than substituting another one.
Three confirmation stages
The defaults use six left-context bars and right-side windows of 3, 8 and 21 bars. Stage II is entered as five additional bars after Stage I; Stage III adds another thirteen bars. The left context remains fixed. These are not three independent symmetric pivot detectors.
Stage I accepts an origin only when its initial right window has closed and the configured conditions are satisfied. Stages II and III test that same origin after their longer right windows have elapsed. Later stages do not replace it with a nearby, more convenient extreme. Failure to reach a later stage does not retrospectively remove the Stage-I event from the observation population.
Highs and lows are processed separately. Alternating highs and lows are not forced, and no order is inferred when both sides qualify from the same candle.
Price definition selects Wicks, Bodies or Close. Wicks uses high/low; Bodies uses max(open, close) for highs and min(open, close) for lows; Close uses closing prices for both sides.
Equal-extreme selection controls ties within the specified windows. Rightmost allows equal older extremes but no equal newer extreme. Leftmost allows equal newer extremes but no equal older extreme. Strict allows no equality on either side. These rules do not merge equal prices across unlimited history.
The optional two-sided shoulder-depth filter excludes the origin candle, measures the selected-source retreat on each side, and takes the smaller retreat divided by origin ATR. Its default minimum is 0.20 ATR; zero disables this filter. Minimum same-side spacing defaults to three bars between accepted origins. ATR length defaults to 14, and research normalization uses ATR frozen at the origin rather than a later volatility value.
HH, LH and EH compare each accepted high with the preceding accepted high. HL, LL and EL do the corresponding comparison for lows. EH and EL use the configurable equality tolerance, initially one tick. This tolerance affects the classification labels, not the pivot tie rule. With no preceding accepted same-side origin, the initial classification is H or L.
Chart symbols and timing
Triangles represent Stage I, circles Stage II, and diamonds Stage III. The default presentation limits primary markers to 30 per side, later-stage symbols to six per side within the most recent 100 visible closed bars, and primary text captions to one per side. Colors, sizes, transparency, pins, captions and limits are configurable.
Hovering over a symbol provides its origin price and time, confirmation time, stage, delay, depth and normalized drift. Use the origin timestamp to associate different confirmation symbols with the same swing.
Confirmation bars is the default placement. Origin bars (backdated) places only Stage I on its earlier origin after confirmation, with a dotted trace to the confirmation candle. This is delayed historical annotation: the marker was not available on the origin candle. Later-stage symbols, event outputs and alerts are not shifted backward.
Adaptive density selects chart symbols using visible-bar spacing, not subsequent success or failure. Zooming, panning or adding bars can change which symbols are displayed and their vertical clearance. Fixed spacing and All within limits are alternatives; count, age and finite-cache limits still apply. Each of the two presentation caches holds up to 2,400 events for the selected viewport.
These display controls do not change detection, research samples or alerts. Consequently, a label can compare against an accepted origin that is not currently visible. Chart marks are not an exhaustive event ledger, and presentation recalculation should not be confused with a claim that every historical drawing remains permanently visible.
Same-origin definition tests
For every accepted origin, the definition study asks whether that exact candle is also an extreme under wick, body-edge and closing-price representations. Each representation uses its own price on the same origin candle; the study does not search for replacement pivots.
Each of the three scheduled stages tests all three price definitions against Rightmost, Leftmost and Strict: up to 27 geometry checks. These are related conditions, not 27 independent models. Strict implies both other tie rules; without relevant ties, those rules can give identical answers.
The Origin price tooltip displays W for wick, B for body edge and C for close. Within each bracket, R/L/S indicates the tie rules that pass; a dash indicates failure and a question mark indicates unavailable data. A pending stage has not reached its scheduled confirmation close.
For example, W B C describes an origin that is strictly isolated as a wick extreme, but not as a body-edge or closing-price extreme. The accompanying 0-3 count is the number of source definitions passing the currently selected tie rule, not a confidence score or reversal probability.
Later definition rows are evaluated even when the main selected-source origin fails Stage II or III. They do not promote the main detector's marker. Alternative depth filters and accepted-origin spacing are not rerun, so this is a fixed-candle geometry comparison, not three complete alternative detector histories.
Signed isolation margins
The Depth / ATR tooltip includes a separate margin for each price definition and stage:
High margin = (origin source price - highest competing source price) / origin ATR.
Low margin = (lowest competing source price - origin source price) / origin ATR.
Competitors are the fixed left context and the relevant right window, excluding the origin candle. Positive means strictly isolated, zero means tied, and negative means exceeded by another candle. Missing or nonpositive origin ATR leaves the margin unavailable.
These margins measure separation from the strongest competing extreme. They differ from the shoulder-depth filter, which measures retreat on both sides. The visible Depth / ATR number remains shoulder depth; margins are not summed into a quality score.
Ordered path after Stage I
This study observes the next 24 closed candles after Stage I by default. Its horizon is adjustable from 1 to 150. The confirmation candle is excluded.
For a high, outside means above the selected origin price and inward means downward. For a low, outside means below the origin and inward means upward. Wick excursions always use chart highs and lows, even when the main detector uses Bodies or Close.
The outside boundary is beyond the origin by max(outside ATR buffer, minimum tick buffer). Defaults are 0.05 origin ATR and one tick. A wick or close must strictly cross that boundary; equality does not qualify. The inside-return clearance defaults to 0.05 origin ATR. These distances remain fixed for the record.
The record identifies the first outside wick; the first inward excursion of the configured size from the Stage-I confirmation close, initially 1.0 origin ATR; the first run of consecutive outside closes, initially two; and the first subsequent run of closes inside the origin by the return clearance, initially one.
A nonqualifying close resets an unfinished run. An inside return must follow completion of the outside-close run on later candles; it cannot be inferred from that acceptance candle's wick. Acceptance is simply the name of a price condition, not evidence of participant intent.
Path codes have the following meanings:
0: No outside wick within the observed window.
1: Outside wick occurred, but the required outside-close run did not complete.
2: Outside-close run completed, but no subsequent required inside-return run completed.
3: Outside-close run completed and was followed by the required inside-return run.
-1 in the Data Window: Unusable path, excluded from path-group statistics.
Code 1 can include isolated outside closes: it does not mean every excursion was wick-only. Code 3 records a return milestone, not a guarantee that the final candle remains inside. Code 0 applies only to the configured observation window.
The tooltip also reports event delays, outside-close count, maximum outward distance, maximum inward movement before the first outside-wick candle, and confirmation-to-horizon close drift. The confirmation candle's own outside wick is reported separately. First means first within this post-confirmation window, not necessarily first since the swing origin.
When the first outward wick and first inward excursion occur on the same candle, their order is recorded as SAME BAR - intrabar order unknown. The complete first outside-wick candle is excluded from the pre-outside inward-movement measurement. No favorable intrabar route or executable trade fill is assumed.
Groups fixed at first confirmation
At Stage I, origins with complete definition data are assigned to either All three definitions at I or Definition-sensitive at I, using the selected tie rule. That membership remains fixed even if later definition results or main-stage retention change.
Completed usable paths are compared by group. The tooltip provides sample counts, outside-wick and outside-close-run counts, inside-return counts, outside acceptance as a percentage of the group, returns as a percentage of completed outside-close acceptances, mean return delay among records that returned, ending close drift and event-order counts.
This answers a specific research question: how did the subsequent paths of definition-consistent and definition-sensitive origins differ in the selected sample? It does not establish that either group is a profitable filter. Initial price shapes differ, the main detector already conditions the sample, and observations may be dependent. Late outside acceptance leaves less time for a return before the horizon ends. No observed return means none within that window, not none forever.
Confirmation-retention readout
Latest shows the most recent accepted origin's classification and attained stage. A clock or ellipsis indicates observation in progress; a square means the observation window ended, not that all stages passed. An attained stage is a historical fact, not a statement that the level remains unbroken now.
Origin price, Origin age and the printed Depth / ATR refer to that latest accepted origin. Age is measured in chart bars.
II / I and III / I use the same rolling sample of initial origins that completed the full Stage-III observation horizon with usable source data. The default capacity is 100 per side. Pending observations do not enter either denominator. These percentages are extreme-retention frequencies, not win rates or forecasts.
Extra III / ATR measures additional origin-to-close drift while waiting from Stage I to Stage III, restricted to origins that attained III with usable ATR. Positive means downward additional close movement for a high, or upward for a low. It can be negative. This is distinct from movement after confirmation.
N / open shows the retention sample size and its pending observations. Detailed studies have separate populations and completion times; their counts are available in the tooltip, not substituted into this visible value.
Equal-length windows after each confirmation
The post-confirmation study measures the next H closed candles after each attained stage, with H = 12 by default. Each measurement starts from that stage's confirmation close and excludes its confirmation candle.
It records signed close drift, maximum movement away from and toward the confirmation close, and whether the selected source retained the original extreme throughout that window under the selected tie rule. Distances use origin ATR. Maximum excursions use wick highs/lows, are floored at zero and do not imply an order of execution.
All stage measurements for one admitted origin enter the completed sample together at origin + Stage-III right bars + H. This common deadline applies even when later stages are absent. Missing later-stage results are not zero observations.
A separate matched comparison uses the same Stage-III-retained origins for all three stage means and reports their paired III-minus-I difference. It remains conditional on later Stage-III attainment. Earlier measurement windows can overlap the interval required to qualify Stage III. Matching origin identities and waiting for a common deadline do not remove that selection effect or demonstrate a causal benefit of waiting.
Hover HIGH or LOW for Stage-I post-confirmation statistics, II / I and III / I numeric values for later-stage statistics, and Extra III / ATR for the matched comparison. These details do not replace the printed retention values.
Worked timing and interpretation example
Number the swing origin as bar 0. With the defaults, Stage I becomes known after bar 3 closes, Stage II can become known after bar 8, and Stage III after bar 21. Each stage concerns the same origin.
The ordered path uses bars 4 through 27. Its definition/path record becomes complete after bar 27 closes: origin + max(21, 3 + 24).
The equal-length post-confirmation study uses bars 4-15 after Stage I, 9-20 after Stage II when attained, and 22-33 after Stage III when attained. Its entire record becomes available after bar 33 closes. The retention readout, definition/path record and equal-length study therefore have different deadlines: +21, +27 and +33 in this example.
For an illustrative swing-high origin at 100 with origin ATR of 2 and a tick size of 0.01, the default outside boundary is 100.10. Two consecutive post-confirmation closes strictly above 100.10 complete outside acceptance. A later close strictly below 99.90 completes the default inside return. If these events occur within the path horizon, the record reaches code 3, irrespective of whether Stage III was attained.
If that origin had W B C at Stage I, it remains in the definition-sensitive group. The later return does not retroactively improve its initial agreement. This example illustrates the rules, not a measured trading result or a recommended setup.
Sampling, missing data and historical inspection
Both detailed studies default to All accepted origins and offer their own Non-overlapping per side setting. Non-overlap admits an origin only when its Stage-I confirmation is strictly after the preceding admitted origin's common deadline on that side. Admission is decided at Stage I. A later failure or exclusion does not cause retrospective replacement with a skipped origin. Opposite-side windows may overlap; non-overlap does not prove independence.
The equal-length study excludes whole records with missing required OHLC/source data between first confirmation and common maturity, or unusable origin ATR. Its rolling capacity counts usable completed initial origins.
The definition/path study retains completed admitted records, including records whose paths are unusable. Such paths are excluded from path-group statistics, while usable definition tests can remain in their respective denominators. Unknown initial definitions cannot enter either initial-definition group. Missing or malformed required path OHLC and missing or nonpositive origin ATR do not become successful holds. Counts of pending records, exclusions and admission skips are reported separately.
The table shows the latest closed-bar state of the loaded execution, not the historical bar under the cursor. Panning changes chart presentation, not the table's statistical cutoff. Use historical Data Window outputs or Bar Replay to inspect earlier available information. Tooltip timestamps identify bar-open times in the exchange timezone; observations become available only after the relevant bar closes.
Data Window, alerts and controls
The Data Window includes six stage-price event series; optional historical post-confirmation means, held frequencies and sample sizes; individual results on their common completion candle; matched comparisons and sample accounting; and six definition/path event outputs containing origin time, initial agreement and path code for each side. Outcome timestamps identify earlier origins without moving those outcomes backward in time.
Eleven alert conditions cover the six stage confirmations, any stage confirmation, retention-horizon completion, the two side-specific post-confirmation completions, and definition/path completion. Conditions commit at bar close. A completion notification may include an unusable record and is not a successful-outcome notification. Ordered-path completion is not a real-time breach or return alert.
Detection rules, confirmation spans, price sources, depth and spacing filters, ATR length, research horizons, buffers, required close runs, sample capacities, admission policies and record inspection are editable. Presentation has separate controls for placement, density, marker budgets, ages, captions, colors, typography and table position. Research can be enabled or disabled without changing the primary detector. Hiding Data Window outputs does not disable the corresponding study calculations.
Scope and limitations
The contribution is the connected same-origin research workflow: definition sensitivity at first confirmation, progressively longer confirmation records, and subsequent paths compared under explicitly defined observation windows. Pivots, ATR, tie handling and price-path analysis are established building blocks; their number is not evidence of independent confirmation or exclusive novelty.
The script uses chart OHLC without external data requests or imported indicator libraries. It is published as open-source Pine Script v6 under the Mozilla Public License 2.0. It does not identify market participants, infer hidden orders, recommend a best stage or definition, or simulate trades, costs or portfolio returns.
Results depend on settings, available history, feed revisions and chart construction. Non-standard charts describe constructed OHLC. Finite samples, serial dependence, overlapping windows, conditional comparisons and repeated parameter exploration limit interpretation. No significance test, predictive accuracy or trading-performance claim is implied. Drawing caches and platform resource limits are finite; extreme settings can increase processing time.
Use the indicator to inspect swing definitions and confirmation behavior, with clear separation between what was known at confirmation and what was observed afterward. Indikator

CME Institutional Order Flow & AMT Lens📜 Attribution & Open-Source Lineage
Mandatory Lineage Notice: This script is an open-source technical derivative and mathematical expansion building upon the continuous Gaussian volume-at-price decomposition architecture created by @ata_sabanci.
Original Script: Volume Footprint: Measuring Classical Indicators by Math & Geometry, Introduction by @ata_sabanci (Licensed under Mozilla Public License 2.0).
We gratefully attribute and cite the foundational works underpinning this suite:
• 🏛️ J. Peter Steidlmayer (CBOT, 1985) & James Dalton (Mind Over Markets, 1990; Markets in Profile, 2007): Pioneers of Market Profile and modern Auction Market Theory (AMT), establishing the classical profile distribution archetypes ( Balanced, Buying Drive, Liquidation Drive, and Double Distribution), the 80% Rule, and Value Area boundary analysis.
• 📐 @ata_sabanci (Ata Sabanci): Author of the open-source continuous Gaussian kernel density decomposition on TradingView under MPL 2.0. His dual-curve probability density function framework is integrated to project smooth buyer/seller volume distributions cleanly on the right chart margin.
• 🔬 Richard D. Wyckoff: The Law of Effort vs. Result, Volume Spread Analysis (VSA), stopping volume, and institutional limit order absorption of aggressive market sweeps at key structural boundaries.
• 🧮 Milton Abramowitz & Irene Stegun (Handbook of Mathematical Functions, National Bureau of Standards Applied Mathematics Series 55, 1964, Formula 7.1.26): High-precision rational Chebyshev polynomial approximation of the complementary error function erfc(x) (|ε(x)| ≤ 1.5 × 10⁻⁷), enabling O(1) constant-time calculation of the Normal Cumulative Distribution Function (CDF) without iterative series loops.
• 🌐 CME Group (Chicago Mercantile Exchange): Level 3 Market-By-Order (MBO) futures microstructure specifications, standardized tick sizes, and 24-hour session conventions across E-mini and Micro index futures (NQ, ES, YM, RTY, MBT, GC).
1. The Core Problem & Philosophy
Retail trading charts are overwhelmingly burdened by lagging moving averages, unpartitioned 24-hour volume histograms, and noisy retail footprint price ladders.
Squinting at hundreds of tiny numbers across individual candle bars creates cognitive fatigue and obscures what institutional algorithms are doing in real time. Furthermore, conventional volume indicators suffer from the "Candle Color Fallacy": if a bar closes green, 100% of its volume is labeled "buying", completely blinding the trader to passive institutional absorption (e.g. smart money absorbing aggressive market sellers on limit bids during a down bar).
The CME Institutional Order Flow & AMT Lens replaces this fragmentation with an integrated, high-performance visual cockpit:
• ⚡ Tick-Precision Footprint Tape Delta (request.footprint): Directly accesses exchange trade tape execution at tick granularity to separate actual ask-lifted buys from bid-hit sells.
• 🧱 True Stacked Imbalance Shelves with Native Footprint Parity: Automatically scans consecutive price tiers for 300%+ diagonal order flow imbalances, with strict zero-ignoring parity matching TradingView's native footprint engine.
• 📈 Right-Margin Continuous Gaussian Volume Profiles: Decomposes buyer and seller volume curves into smooth, continuous mathematical distributions projected cleanly on the right margin with zero price obstruction.
• 🏛️ Dalton Auction Market Theory Archetypes: Automatically classifies auctions into D-Shape, P-Shape, b-Shape, and B-Shape profiles with live Value Area High/Low (VAH/VAL) and Virgin Point of Control (VPOC) tracking.
• ⚖️ Structural Macro Pivots: Visualizes the Overnight Half-Back (50% midpoint equilibrium), Prior Day Cash Value Area, and Multi-Session Confluent Iron POC zones.
2. Order Flow & Auction Engine Pipeline
│ Pine Script v6 Native Footprint (request.footprint)
├── 🟢 True Ask-Lifted Buy Volume (Aggressive Market Buyers)
└── 🔴 True Bid-Hit Sell Volume (Aggressive Market Sellers)
│
▼
│ Ata Sabanci Dual-Curve Analytical Mathematics
├── 🧮 Rational Chebyshev Error Function Integration (Abramowitz & Stegun 7.1.26)
└── 📈 Right-Margin Continuous Volume Decomposition (Buyer Curve vs. Seller Curve)
│
▼
├── 🏛️ Dalton Profile Archetype Classification ( , , , )
├── 🧱 300% Stacked Imbalance Shelves with Native Footprint Parity ("Ignore Zeroes")
├── 🌌 Low Volume Node (LVN) Liquidity Vacuum Corridors & Forward Retests
├── ⚖️ Overnight Half-Back (50% Range) & Multi-Session Confluent Iron POCs
└── 🕯️ Wyckoff Effort vs. Reward Candlesticks (Buyer/Seller Absorption vs. Drives)
3. Visual Anatomy & Signal Guide
Quick reference for identifying real-time order flow and auction structures on your chart:
• 🟡 Buyer Absorption (Demand Exhaustion):
Color / Style: Gold Candle & Outer Glow
Order Flow Meaning: Aggressive market sellers absorbed by passive institutional limit bids at swing lows.
Tactical Interpretation: Trapped sellers; look for bullish reversal or long defense.
• 🟣 Seller Absorption (Supply Exhaustion):
Color / Style: Purple Candle & Outer Glow
Order Flow Meaning: Aggressive market buyers absorbed by passive institutional limit asks at swing highs.
Tactical Interpretation: Trapped buyers; look for bearish reversal or short defense.
• 🟢 Initiative Bull Drive:
Color / Style: Neon Green Bar
Order Flow Meaning: High-volume directional expansion (RVOL ≥ 1.50, Body ≥ 70%).
Tactical Interpretation: Active institutional buyers driving price; align with trend.
• 🔴 Initiative Bear Drive:
Color / Style: Vivid Red Bar
Order Flow Meaning: High-volume directional liquidation (RVOL ≥ 1.50, Body ≥ 70%).
Tactical Interpretation: Active institutional sellers pressing tape; align with trend.
• 🌫️ Dead Volume / Chop:
Color / Style: Dark Slate Candle
Order Flow Meaning: Low relative volume (RVOL < 0.70) or micro-range consolidation.
Tactical Interpretation: Low-liquidity chop; avoid initiating new breakout trades.
• 🧱 Bullish Imbalance Shelf:
Color / Style: Gold Horizontal Ribbon
Order Flow Meaning: 300%+ stacked aggressive buying across ≥ 2 consecutive tiers.
Tactical Interpretation: Institutional demand shelf; serves as high-probability support retest.
• 🧱 Bearish Imbalance Shelf:
Color / Style: Purple Horizontal Ribbon
Order Flow Meaning: 300%+ stacked aggressive selling across ≥ 2 consecutive tiers.
Tactical Interpretation: Institutional supply shelf; serves as high-probability resistance retest.
• ⚪ Prior Cash VPOC:
Color / Style: White Horizontal Ray
Order Flow Meaning: Highest volume price node of prior Regular Trading Hours (09:30–16:00 EST).
Tactical Interpretation: Primary mean-reversion gravity target (revisited in >70% of sessions).
• 🧊 Cash VAH / VAL (Value Area):
Color / Style: Ice Cyan Solid Lines
Order Flow Meaning: Value Area High and Low containing 70% of prior cash session volume.
Tactical Interpretation: Key institutional auction boundaries. Fade in range; follow on breakout.
• ⚖️ Overnight Half-Back (50% Range):
Color / Style: Cyan Dashed Ray
Order Flow Meaning: Exact 50% midpoint of the Overnight Globex range (18:00–09:30 EST).
Tactical Interpretation: Master equilibrium line; early directional bias barometer at cash open.
• ⚡ Confluent Iron POC Cluster:
Color / Style: Soft Orchid Line / Zone
Order Flow Meaning: Prior Day Cash VPOC and Overnight VPOC clustering within tight tolerance.
Tactical Interpretation: Powerful multi-session institutional price agreement and heavy defense wall.
• 🌌 LVN Vacuum Corridor (B-Shape):
Color / Style: Magenta Shaded Corridor
Order Flow Meaning: Low Volume Node valley separating twin distributions in B-Shape profiles.
Tactical Interpretation: Liquidity void; price accelerates rapidly through the corridor.
• 🎯 Unfinished Auction Magnets:
Color / Style: Dotted Horizontal Ray
Order Flow Meaning: Poor High or Poor Low where non-zero volume traded at the outer tick.
Tactical Interpretation: Incomplete auction magnet; high probability of future sweep and repair.
4. Mathematical & Algorithmic Foundations
A. Continuous Gaussian Kernel Density Estimation (Right-Margin Curves)
Rather than discretizing volume into arbitrary rectangular histogram bars that jump abruptly between price levels, volume at price is treated as a continuous probability density function:
text
f(p) = (1 / (σ * √(2π))) * exp(-(p - μ)² / (2σ²))
To calculate cumulative volume integrals in constant O(1) time without performance-draining numerical loops, the cumulative distribution function is solved via Abramowitz & Stegun Formula 7.1.26:
text
P(Z ≤ z) = 1 - (1 / √(2π)) * exp(-z² / 2) * (a1*t + a2*t² + a3*t³ + a4*t⁴ + a5*t⁵) + ε(z)
where t = 1 / (1 + p*z) and |ε(z)| ≤ 1.5 × 10⁻⁷. This enables the indicator to project smooth, mathematically rigorous buyer and seller curves on the chart's right margin with zero execution lag.
B. True Footprint Diagonal Imbalance Parity
Institutional order flow imbalances occur when aggressive market orders lifting the ask at price tier P overwhelm passive limit orders on the bid at price tier P by a specified dominance ratio (e.g. 3:1 or 300%):
text
Buy Imbalance: Ask_Volume(P_i+1) >= Ratio * Bid_Volume(P_i)
Sell Imbalance: Bid_Volume(P_i) >= Ratio * Ask_Volume(P_i+1)
• 🎯 Strict "Ignore Zeroes" Parity: In TradingView's native footprint engine, when "Ignore zeroes" is active, any diagonal pair where either side has 0 traded contracts is strictly disqualified from being an imbalance. The indicator enforces this parity rule by default, eliminating false edge-of-candle anomalies at highs and lows.
• 🎯 Calibrated Contract Floors: The volume floor is calibrated to 1.0 contract on CME futures to capture genuine institutional prints on smaller-lot contracts like RTY and YM, and 10.0 shares on US Equities to filter retail odd-lot dust.
• 🎯 Bounded Tier Span Geometry: Caps shelf thickness strictly to the stack depth span imbDepth * tick_group_pts, preventing shelves from expanding into giant monolithic slabs.
C. Dalton Profile Shape Archetypes & Empirical Resolutions
Audited across continuous CME index futures sessions, daily auctions resolve into four distinct structural shapes:
• 🏛️ Rotational Balance (25.1% frequency): Symmetrical bell curve indicating institutional consensus on fair value. High mean-reversion probability between Value Area High (VAH) and Value Area Low (VAL).
• 🚀 Initiative Buying Drive (14.1% frequency): Top-heavy volume distribution with a thin lower tail, signaling aggressive short-covering or institutional buying drives. Reversals into b-shape occur in less than 5% of sessions; edge lies in buying pullbacks to developing VPOC.
• 🩸 Initiative Liquidation Drive (8.5% frequency): Bottom-heavy volume distribution with a thin upper tail, signaling long liquidation or aggressive selling. Reversals into P-shape occur in less than 5% of sessions; edge lies in selling rallies to developing VPOC.
• 🗜️ Double Distribution (52.3% frequency): Two distinct high-volume distributions separated by a Low Volume Node (LVN) liquidity vacuum corridor. Price rapidly traverses the central LVN void (spending < 12% of session time inside it) moving from one balance area to the other.
5. Comprehensive Settings Dictionary (Explaining Every Parameter)
The settings dialog is cleanly divided into 10 structured groups matching the on-screen hierarchy:
⚙️ Group 0: Execution Performance & Replay Mode
• ⚡ Fast Replay / Lightweight Mode:
Purpose: Optimizes the indicator for TradingView Bar Replay and lower-memory systems.
How it works: Switches the calculation from tick-precision native footprint sampling to instantaneous Geometric Proxy delta (zero network/memory latency), reduces profile lookback to 300 bars, and streamlines profile bins to 30.
Default: false (keep unchecked for live charts with sub-bar tick precision).
🎨 Group 1: Candle Display & Visual Palette
• Candle Display Style:
Purpose: Selects the visual presentation of candlesticks on the chart.
Options:
Ghost Glow (Semi-Transparent Body + Solid Wicks): 75% body transparency allows underlying native TradingView footprint numbers and delta grids to remain 100% visible while keeping solid wicks for price action analysis.
Full Solid HD Candlestick: Opaque, vibrant institutional candles for standard charting.
Hollow (Wicks & Solid Borders Only): Outlined borders with 100% transparent centers.
Direct Native Barcolor: Applies colors directly to TradingView's default candle series.
Disabled: Hides custom candle rendering completely.
Default: Ghost Glow.
• Color Effort vs. Reward Candles:
Purpose: Toggles Wyckoff-based candle coloring (Demand, Supply, Initiative, Muted).
Default: true.
• Buyer Absorption (Demand) Color:
Purpose: Highlights bullish buyer absorption at lows (aggressive sellers absorbed on limit bids). Also styles bullish imbalance shelves and buyer volume profiles.
Default: Gold (#FFD700).
• Seller Absorption (Supply) Color:
Purpose: Highlights bearish seller absorption at highs (aggressive buyers absorbed on limit asks). Also styles bearish imbalance shelves and seller volume profiles.
Default: Purple (#AB47BC).
• Initiative Bull & Bear Colors:
Purpose: Highlights high-volume directional expansion drives (body ≥ 70%, RVOL ≥ 1.50).
Defaults: Neon Green (#00E676) and Vivid Red (#FF1744).
• Standard Bull & Bear Bar Colors:
Purpose: Colors standard non-absorption bars.
Defaults: Green (#00E676) and Red (#FF1744).
• Dead Volume / Chop Color:
Purpose: Colors candles that occur during micro-range consolidation or low relative volume (RVOL < 0.70). Gated strictly to confirmed bars to prevent premature shading on live candles.
Default: Slate (#373C4B).
• Show Unfinished Auction Magnets (Poor Highs / Lows):
Purpose: Projects horizontal dotted rays from candle extremes where volume executed at the outer tick with zero excess, representing unfinished inventory magnets.
Default: true.
• Auto-Suppress Intraday Overlays on Macro/HTF:
Purpose: Automatically cleans Daily and Weekly charts by hiding intraday rays, overnight boxes, and micro-shelves, preventing WebGL stutter.
Default: true.
🧱 Group 2: Stacked Imbalance Shelves
• Project Stacked Imbalance Shelves:
Purpose: Projects forward-extending support/demand shelves from stacked order flow imbalances until price retests or penetrates the zone.
Default: true.
• Ratio Multiplier:
Purpose: Diagonal volume dominance ratio required to trigger an imbalance.
Default: 3.0 (300% dominance, matching standard institutional footprint configurations).
• Stack Depth:
Purpose: Number of consecutive price tiers required to confirm an institutional shelf.
Default: 2 tiers.
• Ticks Per Row (Tier Size, 0 = Auto):
Purpose: Price tier bucket size in ticks. Set to 0 for Auto-Adaptive (automatically matches optimal row density across all assets and timeframes). Set to any positive integer (e.g. 8 for 2.00 pt on NQ, 4 for 4.00 pt on YM, 2 for 0.20 pt on RTY, 20 for 20 cents on NVDA) to force a fixed tier size.
Default: 0 (Auto).
• Ignore Zeroes (Native Footprint Parity):
Purpose: When enabled, price tiers with 0 volume on the opposite side are ignored, strictly matching TradingView native footprint behavior. Disable to allow trades against 0 to trigger imbalances.
Default: true.
• Shelf Line Width & Line Transp (%):
Purpose: Controls the thickness (1–4px) and opacity of the shelf baseline price ray.
Default: Width 1, Transp 100% (hides the harsh line for an ultra-clean ribbon).
• Shelf Box Transp (%):
Purpose: Controls background opacity of the shelf rectangle.
Default: 84% (soft background ribbon).
• Max Active Retest Shelves:
Purpose: Caps the maximum number of unmitigated imbalance shelves preserved across historical peaks, guaranteeing peak chart performance.
Default: 30.
🏛️ Group 3: Key Institutional Levels & Styling
• Show Prior Cash Levels (VAH / VAL / VPOC):
Purpose: Displays Prior Day RTH Cash (09:30–16:00 EST) Value Area High, Value Area Low, and Point of Control.
Default: true.
• VPOC Color, Width, Style, and Transp (%):
Purpose: Full visual customization of the Point of Control line.
Default: White (#FFFFFF), Width 2, Style Solid, Transp 0%.
• VAH & VAL Color, Width, Style, and Transp (%):
Purpose: Full visual customization of Value Area boundary lines.
Default: Ice Cyan (#00E5FF), Width 1, Style Solid, Transp 35%.
• Prior Level Origin Anchoring:
Purpose: Controls where historical levels start. Cash Open (New Day Only) starts cleanly at the 09:30 cash open; Session Origin (Full Span) anchors back to historical bars.
Default: Cash Open (New Day Only).
• Show Overnight Half-Back (50% Midpoint):
Purpose: Projects the exact 50% midpoint of the overnight range (18:00 to 09:30 EST), serving as a primary structural equilibrium balance line during the Cash Open.
Default: true, Cerulean Cyan (#00E5FF), Width 2, Dashed.
• Highlight Confluent Iron POC Cluster:
Purpose: Automatically detects when Prior Day Cash VPOC and Overnight VPOC cluster closely together, indicating powerful multi-session institutional price agreement.
Default: true, Soft Orchid (#CE93D8), Width 2, Solid.
• Show Overnight Shaded Box (18:00 - 07:00 EST):
Purpose: Renders a muted box preserving overnight inventory territory.
Default: false.
• Extend to 08:30 Pre-Market:
Purpose: Extends the overnight box cutoff from 07:00 EST to 08:30 EST to capture pre-market macroeconomic releases.
Default: false.
🔬 Group 4: Volume Delta Engine & Lower Timeframe
• Tick Grouping Mode:
Purpose: Enforces the Row-Density Invariance Law across all timeframes and assets, dynamically targeting 11–16 rows per candle.
Options: Auto-Adaptive (Row-Density Invariance) or Manual Ticks.
Default: Auto-Adaptive.
• Manual Ticks (if Selected):
Purpose: Fixed tick count when Manual Ticks mode is active.
Default: 4.
• Use Time-of-Day RVOL on 1-Hour Charts:
Purpose: Normalizes 1h volume against the historical average for that specific hour (0–23 EST), eliminating diurnal bias where morning bars appear artificially high and overnight bars appear low.
Default: true.
• Volume Engine (when Replay Mode is Off):
Purpose: Selects volume delta calculation when Fast Replay is unchecked:
Native Footprint (Tick Precision): Pine Script v6 native request.footprint() for true tick-level trade tape execution without lower-timeframe interpolation.
Geometric Proxy: Instant mathematical proxy for Bar Replay.
Intrabar (1m Low Memory): Fast 1-minute sub-bar sampling.
Intrabar (Sub-Minute): Sub-minute granularity for live intraday trading.
Default: Native Footprint (Tick Precision).
• Intrabar Lower Timeframe:
Purpose: Sub-bar resolution when Intrabar mode is active (Auto, 1S, 5S, 15S, 30S, 1, 5).
Default: Auto.
🌐 Group 5: Session Volume Profiles & AMT Scope
• Show Session Volume Profiles (Right Margin & Anchor):
Purpose: Enables the developing volume profile on the right margin and completed historical profile succession.
Default: true.
• Profile Scope Horizon:
Purpose: Controls the institutional auction cycle:
Auto-Adaptive: Sub-Session (<= 15m), Daily Full Cycle (30m–4h), Weekly (Daily charts), Monthly (Weekly charts).
Or force fixed Sub-Session, Daily Full Cycle, Weekly, or Monthly.
Default: Auto-Adaptive.
• Completed Sessions to Display:
Purpose: Number of completed historical session profiles to render across the chart (e.g. 10 sessions = 5 Full Trading Days of Cash + Overnight).
Default: 15.
• Show Session VAH / VAL Lines:
Purpose: Toggles session Value Area High and Value Area Low boundary lines.
Default: true.
• Show Dalton Profile Shape Badges ( , , , ):
Purpose: Identifies and stamps Dalton profile shape badges at session extremes.
Default: true.
• Extend Completed Virgin POC to Live Bar:
Purpose: Extends unvisited Virgin POCs forward as horizontal attractor lines until retested.
Default: true.
• Wait for 1 Bar Close on Session Open:
Purpose: Waits for the opening candle of a new session to fully close before initiating the developing profile on the right margin. Prevents opening-tick jitter, zero-range artifacts, and profile flashing.
Default: true.
📐 Group 6: Profile Curve Geometry & Shading
• Profile Width Scaling:
Purpose: Controls how far volume profiles expand horizontally into the session.
Options: Expressive (50% Span), Balanced (35% Span), Wide (65% Span), Compact (20% Span), or Fixed Bars.
Default: Expressive (50% Span).
• Fixed Width (Bars) & Offset off Candle:
Purpose: Fine-tunes profile width in fixed-bar mode and right-margin clearance off the live candle.
Defaults: 36 bars and 3 bars offset.
• Profile Shading Style:
Purpose: Selects visual color treatment for volume profile curves (Bid/Ask Dual-Tone, Monochrome Slate, Monochrome Gold, Monochrome Cyan).
Default: Bid/Ask Dual-Tone.
• Buy Vol Curve & Sell Vol Curve Colors:
Purpose: Independent palette selectors for buyer and seller curves.
Defaults: Gold (#FFD700) and Purple (#AB47BC).
• Fill Transp (%) & Outline Transp (%):
Purpose: Controls background fill opacity (default 92% provides a soft watermark) and contour outline opacity (default 5% gives a crisp border).
Defaults: Fill 92%, Outline 5%.
• Profile Label Size:
Purpose: Scales font size of session shape badges and POC price labels (Tiny, Small, Normal, Large).
Default: Small.
🏷️ Group 7: Level Labels & Dark Knockout Shield
• Level Labels Style:
Purpose: Visual presentation of VAH, VAL, and POC text:
Subtle Acronym (On Line): Clean, transparent floating text (POC 29484.75, VAH 29550.00) sitting directly on the line without bulky background badges.
Session Acronym (C-POC / ON-POC): Prepends session identifier.
Compact Acronym Only: Shows only the letters (POC, VAH, VAL) without price.
Bulky Badges: Legacy high-contrast opaque pill badges.
Hidden: Suppresses text for pure minimalist lines.
Default: Subtle Acronym (On Line).
• Level Labels Position:
Purpose: Horizontal placement along the level line (Right Edge Inside Box, Right Edge Outside Box, Center of Session, Left Edge Inside Box).
Default: Right Edge (Inside Box).
• Dark Knockout Shield Pill:
Purpose: Wraps acronym labels in a dark cutout container (#0C0F18) to shield text from candle wicks passing through the level.
Default: true.
• Shield Opacity (%):
Purpose: Background shield opacity (0% = solid dark container, 15% = subtle dark glass).
Default: 15%.
🔲 Group 8: Session Framing Outlines & LVN Corridors
• Show Session Framing Outlines:
Purpose: Frames each completed and developing Cash RTH and Overnight auction in a clean, high-contrast outline that connects seamlessly to the next session.
Default: true.
• Frame Border Style & Width:
Purpose: Border style (Solid/Dashed/Dotted) and width (1–3px).
Default: Dotted, Width 1.
• Cash Frame & ON Frame Colors:
Purpose: Distinct frame border colors for Cash RTH (Gold) vs. Overnight Globex (Purple).
• Outline Transp (%) & Fill Transp (%):
Purpose: Opacity of outer frame border (30%) and internal session shading (98% = transparent wireframe with zero candle tinting).
Defaults: Outline 30%, Fill 98%.
• Show LVN Vacuum Corridor (B-Shape):
Purpose: Displays the Low Volume Node (LVN) liquidity vacuum corridor for B-Shape (Double Distribution) profiles.
Default: true.
• LVN Presentation:
Purpose: Visual style (Both Corridor Box + Centerline, Shaded Corridor Box, or Inflection Line Only).
Default: Inflection Line Only.
• LVN Forward Extension:
Purpose: Extend Until Mitigated projects the corridor forward until retested or penetrated; Session Span Only confines it within session boundaries.
Default: Extend Until Mitigated.
• LVN Color, Style, and Box Fill Transp (%):
Purpose: Visual customization of the LVN corridor.
Defaults: Magenta (#E040FB), Dotted, 92% box fill transparency.
📊 Group 9: Institutional Heads-Up Display & Educational Table
• HUD Display Mode:
Purpose: Selects dashboard presentation (Full Educational Dashboard, Compact Status Pill, or Disabled).
Default: Full Educational Dashboard.
• Dashboard Position:
Purpose: Screen corner placement (Bottom Right, Bottom Left, Top Right, Top Left).
Default: Bottom Right.
• Detect Imbalances at Key Levels:
Purpose: Real-time audio/visual alert scanning active order flow imbalance shelves and alerting when stacked absorption coincides with key levels (VAH, VAL, VPOC, or Overnight Half-Back).
Default: true.
6. Tactical Execution Playbook
1. Pre-Market Balance Orientation (08:30 – 09:30 EST)
• ⚖️ Identify the position of price relative to the Overnight Half-Back (50%).
• ⚡ Scan for Confluent Iron POC alignments between yesterday's Cash VPOC and the Overnight VPOC.
• 🏛️ Check the prior session's Dalton archetype badge: Is the market balanced ( ) or trending ( or )?
2. Opening Drive & Judas Swing Mitigation (09:30 – 10:00 EST)
• 🛑 Stand aside during the opening 15 minutes to protect capital from opening whipsaws and liquidity gaps.
• 🪤 Watch for a false opening drive (Judas Swing) sweeping overnight extremes into an unmitigated Stacked Imbalance Shelf.
• 🟡🟣 Confirm absorption via Effort vs. Reward Candle Colors (Gold for Buyer Absorption, Purple for Seller Absorption).
3. High-Confluence Setups by Dalton Archetype
• 🔄 Rotational Days: Fade Value Area boundaries (VAH and VAL) targeting the VPOC mean.
• 🌌 Double Distribution Days: Trade the breakout through the LVN Vacuum Corridor, capturing rapid price displacement toward the secondary distribution's POC.
• 🚀 Initiative Days: Never fade the morning drive. Align with trend pullbacks into the developing right-margin VPOC and stacked imbalance shelves.
7. Educational & Compliance Disclaimer
This indicator is published under the Mozilla Public License 2.0 (MPL 2.0) strictly for educational, research, and analytical purposes. It does not provide trade recommendations, signals, or financial advice. Trading futures, equities, and options carries substantial risk of capital loss. Past performance and quantitative models do not guarantee future market outcomes. Always exercise rigorous risk management. Indikator

Rob Hoffman IRB + MA Trend OVERVIEW
This indicator combines Rob Hoffman's Inventory Retracement Bar (IRB) setup with his moving average overlay set and "No-Trend Zone", and adds a trend gate so IRB signals only fire when the market is actually trending. The idea is simple: trade continuation in a clean trend, and stay out when price is chopping around the averages.
Everything runs on the price chart — no separate pane.
THE INVENTORY RETRACEMENT BAR (IRB)
An IRB is a bar that pushes against the prevailing trend and then closes back in a way that shows the counter-trend move is running out of steam.
- Long IRB: the bar's open AND close are both at least 45% below its high (a long upper wick in an uptrend).
- Short IRB: the bar's open AND close are both at least 45% above its low (a long lower wick in a downtrend).
IRB bars are marked with small triangles. The IRB itself is not the entry — it's the setup.
ENTRY TRIGGER
After an IRB forms, the indicator waits up to 20 bars (adjustable) for price to confirm:
- "Extreme high/low break" (default): entry when price breaks one tick beyond the IRB's high (long) or low (short). This is the classic rule.
- "Close past retracement level": an earlier, more aggressive entry that triggers when a bar closes back through the IRB's 45% retracement level.
If price instead breaks the opposite side of the IRB before triggering, the setup is cancelled. Confirmed entries are labeled "IRB L" / "IRB S".
IRBs with an unusually large range (more than 2x ATR by default) are ignored, since oversized retracement bars tend to fail more often.
MOVING AVERAGE OVERLAY
The full MA set is plotted for context:
- SMA 3 and 5 (fast speed lines)
- EMA 18 and 20 (primary trend lines — the 20 EMA is highlighted in gold)
- SMA 50, SMA 89, EMA 144, SMA 200 (longer-term trend lines)
The ribbon can be hidden if you only want the core lines.
NO-TREND ZONE
The blood-red cloud is the No-Trend Zone: a Keltner-style channel built from a 34-period EMA with a band of 0.45x the EMA-smoothed true range. When price is inside or hugging this zone, the market isn't trending and IRB signals are suppressed.
The band smoothing can be switched to RMA (Wilder ATR). If you want to match the original overlay set exactly, use length 35, multiplier 0.5, and RMA smoothing.
TREND GATE
An IRB only counts when all of these agree:
1. Price has closed outside the No-Trend Zone in the direction of the trade.
2. Price is on the correct side of the 20 EMA — or, optionally, still on the correct side of the 89 EMA anchor, so a deep pullback through the 20 doesn't cancel an otherwise healthy trend.
3. (Optional, on by default) No long IRBs below the 89 EMA anchor and no short IRBs above it.
The gate can be turned off to see every raw IRB bar shape regardless of trend.
Trend angle: Hoffman looks for the 20 EMA sloping at roughly 45 degrees. This is deliberately NOT coded — Pine Script has no access to the chart's pixel scale, so any "degrees" value would change with zoom and wouldn't match what you see. Judge the slope by eye.
TRAILING STOP REFERENCE
A yellow dotted line shows a reference stop: it starts at the IRB's low (long) or high (short) when an entry triggers, then trails at 1.5x ATR while the trend holds, and clears when hit or when the trend is lost. It's a visual guide only and does not manage any position.
ALERTS
Two alert conditions are available: "Hoffman IRB Long Entry" and "Hoffman IRB Short Entry". Signals on the live, unconfirmed bar can change until that bar closes, so "Once Per Bar Close" is recommended when creating alerts.
HOW TO USE IT
- Trade in the direction of the trigger labels only.
- When price is sitting in the red cloud, stand aside — that is the chop the zone exists to keep you out of.
- Look for a clearly sloping 20 EMA; flat averages mean weak continuation.
- Use the IRB's opposite extreme (or the trailing stop line) as a logical stop reference.
CREDITS
The Inventory Retracement Bar setup, the moving average overlay set, and the No-Trend Zone concept are Rob Hoffman's publicly taught methods. The overlay set was cross-referenced against UCSgears' open-source "Rob Hoffman - Overlay Set" script. This script is an independent implementation and is not affiliated with or endorsed by Rob Hoffman.
This indicator is for educational purposes and is not financial advice. Past signals do not guarantee future results.
Indikator

$ - Boxes +$ – Boxes +
A higher timeframe candle tool that outlines each HTF candle directly on your lower timeframe chart. Instead of flipping between timeframes, you can see the range, body and midpoint of the 1H, 4H or daily candle while executing on the 1m or 5m. The previous candle's high and low can also be carried forward as live levels, making it easy to frame reversals and continuations off the last HTF range.
HTF Candle Boxes
Time Interval – choose any higher timeframe to outline (1H by default).
Number of Boxes – show the last 1, 2 or 3 completed HTF candles, or Show All for the full chart history.
Box styling – adjustable border width, style (solid / dashed / dotted) and colour.
Current HTF Candle
The HTF candle still in progress is projected across its full time period, so you can see exactly where it will close. The box expands in real time as new highs and lows print, and the body updates with the live close.
Body & Midline
Include Body – draws the open-to-close body inside each box, coloured bullish or bearish, so each HTF candle reads the same as it would on its own timeframe.
Show MidLine – marks the 50% level of each candle's range, useful for framing premium and discount within the candle.
Line Settings
Hide Side Lines – removes the vertical edges, leaving the high and low as clean horizontal levels. Required for the options below.
Extend Lines to Current Candle – carries the previous HTF candle's high and low forward to price, stopping each line at the candle that closes through it.
Extend Lines 10 Candles Ahead – projects the previous high and low 10 bars past the current candle, keeping the levels visible in the space ahead of price. Takes priority over Extend to Current.
Draw Lines from Exact Candle – starts each high and low line from the exact lower timeframe bar that printed it, rather than the start of the HTF candle.
Range Labels
Show H/L Range Pips – displays each HTF candle's high-to-low range above its box.
Show O/C Pips – adds the body size and the percentage of the range the body makes up, e.g. 12.4 / 30.1 = 41%.
Values are measured in pips on forex pairs and in price points on all other markets.
Box Fill Colours
Separate fill colours for bullish and bearish HTF candles. Fills are transparent by default, so boxes show as outlines only until a colour is chosen.
How to Use
Apply to a chart on a lower timeframe than the one set in Time Interval. For example, set the interval to 1H and view a 5m chart to see each hourly candle outlined over its 5m bars. Indikator

PDH PDL + Key Levels# PDH PDL + Key Levels
A single indicator for the horizontal levels that actually matter intraday: previous day, week and month extremes, custom session highs and lows, and the New York open — with lines that stop where price consumed them instead of running across the whole chart.
## What it plots
**Previous period extremes**
PDH / PDL, PWH / PWL, PMH / PML. Each line is anchored at the bar that printed the extreme and extends to the right, so you see both where the level was made and how far it has travelled untouched.
**Session highs and lows**
Three independent, fully configurable sessions (defaults: New York, Asia, London). While a session is open its high and low develop live and are never cut. Once the session closes they freeze and become eligible for consumption like any other level.
**NY Open**
A fixed reference at 09:30 America/New_York. The price used is the close of the 09:29 one-minute candle, requested from a 1-minute context with lookahead off — it appears only once that candle has closed, so the level never repaints. The timezone is IANA, so daylight saving is handled automatically. Intraday timeframes only.
## Cut when consumed
The core behaviour. A level stops being drawn the moment price reaches it:
- A high acts as resistance and is consumed by any candle whose **high** reaches it — gaps up included.
- A low acts as support and is consumed by any candle whose **low** reaches it — gaps down included.
- The NY Open can be approached from either side, so it is consumed by a candle that straddles it or by a gap that jumps clean through it.
The result is a chart where a long horizontal line means genuinely untested, and a short stub means the level was taken out early. Consumption checks only start after the level's own period begins, so a fresh PDH is never cut by the day that created it. Turn the behaviour off and every line simply extends to the current bar.
## Coincident levels merge
When two or more levels land on the same price — within one tick — they fold into a single line with a combined label, for example `PDH + NY-H`. Hierarchy runs monthly, weekly, daily, sessions, NY open, and the surviving line keeps the **latest** endpoint of the group, so a level that is still alive never inherits an older level's cut.
## Settings
**General** — toggle cut-on-touch, toggle merging, show or hide all labels, label size.
**Line style** — style and width for the previous-period extremes.
**Colors** — separate colors for highs and lows, plus a master override that paints everything one color without erasing your palette underneath. Switch it off and your own colors come straight back.
**Levels** — individual toggles for PDH, PDL, PWH, PWL, PMH, PML. Monthly extremes are off by default.
**NY Open** — enable, label text, color, style, width. The time is not configurable by design.
**Session 1 / 2 / 3** — enable, label prefix, hours, timezone, color, style, width. Timezones accept GMT notation (`GMT-5`) or an IANA name (`America/New_York`); IANA is recommended because it survives daylight saving.
## How to use it
Mark your session before the open: untouched PDH and PDL are the most obvious draws on liquidity for the day, and the ones still extended after several sessions tend to be the ones price eventually goes to fetch. Session extremes give you the boundaries of the Asian and London ranges going into New York. The NY Open acts as the intraday mean many algorithmic systems reference — price reclaiming or rejecting it in the first hour is frequently the cleanest read of the session's direction.
Because a consumed level disappears, what remains on screen is the set of unresolved objectives, which keeps the chart readable without manual cleanup.
## Notes and limitations
- Levels are redrawn on the last bar only. The indicator shows the current state of the chart, not a historical record of every level that ever existed. It is a live map, not a backtest.
- The NY Open needs a 09:29 one-minute candle to exist. On a chart restricted to regular trading hours that begins at 09:30, that candle is absent and the level will not print. Use an extended-hours chart for futures.
- Sessions are evaluated on the chart's own bars, so a window narrower than your timeframe may never trigger. Keep session ranges wider than a single bar.
- Line and label counts are capped at 500 each, which is well above anything this indicator produces.
No alerts, no signals, no repainting. Just the levels. Indikator

TheStrat Command Center v1.5TheStrat Command Center
TheStrat Command Center is a chart-based decision-support tool built for traders who use "The Strat" methodology created by Rob Smith (R.I.P.)
Its purpose is to organize several pieces of TheStrat information that normally have to be monitored separately — current candle structure, possible next directional setups, Full Time Frame Continuity (FTFC), entry and invalidation levels, nearby objectives, and risk-based targets — into one live dashboard.
It is not intended to predict the market or replace the trader's own interpretation of price action. The goal is to make the current Strat structure easier to read and manage.
Strat Structure
The indicator classifies price bars using the standard Strat framework:
1 - Inside bar
2U - Breaks the previous high without breaking the previous low
2D - Breaks the previous low without breaking the previous high
3 - Outside bar that breaks both sides
The prior closed candle is treated as the current setup candle. The developing candle is then evaluated against that completed setup.
The Command Center uses that relationship to identify possible structures such as:
2-2 reversals
2U or 2D continuation
2-1-2 structures
3-to-2 directional resolution
Failed 2 reversals
Both the upside and downside possibilities remain visible so the trader can see what price would need to do in either direction.
Failed 2 Recognition
Failed 2 candles are handled separately from ordinary 2 bars.
A Failed 2U must first be a true 2U and then close below its own open.
A Failed 2D must first be a true 2D and then close above its own open.
If the candle breaks both the previous high and previous low, it is classified as a "3", which overrides the Failed 2 condition.
Failed 2 markers are placed on the actual failed candle after it closes.
Full Time Frame Continuity
The indicator monitors up to six user-selected timeframes for Full Time Frame Continuity.
Each timeframe is evaluated by comparing its current price with its timeframe open:
Green = above the timeframe open
Red = below the timeframe open
Flat = at the timeframe open
Users can choose which of the six timeframes are required for FTFC.
Full bullish FTFC exists only when every required timeframe is bullish. Full bearish FTFC exists only when every required timeframe is bearish. A majority or directional lean is not treated as Full Time Frame Continuity.
An optional setting can restrict new suggested trades to setups that agree with Full FTFC. Timeframes that are displayed but not marked as required remain informational and do not block a setup.
Command Center Dashboard
The dashboard is intended to answer, at a glance:
* What is happening now?
* What was the last completed Strat candle?
* Is a reversal currently available?
* Is Full Time Frame Continuity present?
* What is the best structural play under the selected FTFC rules?
* What are the possible upside and downside plays?
* Where are the applicable entry and stop levels?
* How far is price from the next trigger?
* Where are nearby structural objectives?
* Where is price relative to the trading-session open?
The indicator includes separate Desktop and Mobile layouts. The Desktop dashboard can also hide its lower detail section to conserve chart space.
Entry, Stop and R-Based Target
For standard Strat setups, the indicator calculates a potential entry beyond the setup candle high or low using a user-selected tick offset.
The opposite side of the setup candle is used as the invalidation/stop reference.
Failed 2 reversals use a fixed rule:
* Failed 2D long: entry one minimum tick above the Failed 2D high and stop one tick below its low.
* Failed 2U short: entry one minimum tick below the Failed 2U low and stop one tick above its high.
Once the entry-to-stop distance is known, the indicator calculates a user-selected reward target from 0.5R through 5R, where 1R equals the initial entry-to-stop risk.
These levels are informational chart references and are not brokerage orders.
Waiting and Active Trade Lines
Before a setup triggers, optional dashed entry stubs show the available directional trigger levels.
If one side triggers, the opposite waiting setup is removed and the chart can display:
* Entry
* Stop
* Selected R target
The lines remain while that setup is active.
When the target or stop is reached, the active trade lines are removed automatically. A user may also manually dismiss a waiting setup or cancel the indicator's monitoring of an active setup without recording it as a target or stop result.
If both sides of the setup candle are broken by the same developing bar, the condition is treated structurally as an outside/3 bar rather than assuming a directional entry.
Session Levels and Objectives
The indicator can also display contextual price levels.
For futures, the reference trading session begins at 6:00 PM Eastern Time .
For equities, indexes and other non-futures instruments, the reference session begins at 9:30 AM Eastern Time .
The dashboard can show:
* Reference session open
* Previous session high
* Previous session low
* Recent range high and low
* Distance to the next upside or downside trigger
* Nearby prior-high or prior-low objectives
The recent-range lookback is user-adjustable.
These objective levels are contextual references. They are not predictions that price will reach those levels.
Alerts
Alert conditions are included for:
* Confirmed Failed 2U
* Confirmed Failed 2D
* Confirmed upside trigger
* Confirmed downside trigger
* Target reached
* Stop reached
Developing vs. Confirmed Information
The Command Center intentionally contains both closed-bar structural information and live developing information.
The setup itself is based on the prior completed candle. Failed 2 identification is confirmed on candle close.
The current developing candle type can change before that candle closes as new highs or lows are made.
FTFC also uses the current state of the selected higher-timeframe candles. Because those candles remain open until their respective timeframes close, their green/red state — and therefore live FTFC — can change intrabar.
Users should distinguish these live contextual readings from closed-bar confirmations.
Limitations
This is an indicator, not a TradingView strategy or backtest . It does not provide historical profitability statistics or claim that a displayed setup will be successful.
The indicator does not know the exact sequence of every price movement inside a completed historical candle. If multiple relevant levels are touched within the same bar, OHLC chart data may not reveal which price traded first.
Results and displayed structures can also vary depending on symbol, chart timeframe, market session, selected FTFC timeframes, tick offset, R target, and available chart data.
The tool is designed for standard price charts and should be interpreted alongside the trader's own analysis and risk-management process.
What Makes the Script Different
The Command Center is designed as an integrated Strat workflow rather than simply placing candle numbers on a chart.
It combines the prior closed-bar setup, live directional resolution, exact Failed 2 handling, user-defined FTFC requirements, two-sided structural possibilities, trigger/invalidation levels, R-based trade planning, session context, nearby objectives, active-setup management, alerts, and desktop/mobile presentation into a single decision hierarchy.
Its purpose is to reduce the amount of separate chart information a Strat trader has to mentally assemble while preserving the underlying price-action structure.
Indikator

MTF Supply & Demand (PropFirmGorilla)This indicator detects supply and demand zones across eight timeframes at once — 15m, 30m, 1H, 90m, 2H, 4H, 690m and Daily — and draws them on whatever chart you're viewing, so you don't have to flip timeframes to map higher-timeframe levels.
How a zone is found
Each zone is built from an impulse candle and the basing candle immediately before it:
Demand: a bullish impulse candle that moves up at least a set % (open→close) and closes in the top portion of its range, preceded by a small down-closing basing candle whose body is no larger than a set % of the impulse body. The zone runs from the basing candle's open down to its low.
Supply: the mirror — a bearish impulse that closes near its low, preceded by a small up-closing basing candle. The zone runs from the basing candle's high down to its open.
A zone is removed automatically once price trades back through it (through the zone low for demand, the zone high for supply), so the chart only shows levels that are still unmirrored.
Non-repainting
Higher-timeframe zones are read from closed bars only (confirmed history, no lookahead), so a zone appears after its impulse candle closes and does not repaint on reload.
Features:
8 timeframes, each toggled on/off independently.
Simplify Zones: when same-side zones overlap, merge them into one rectangle labeled with every timeframe involved (e.g. "90m / 30m / 15m") to reduce clutter.
Box or line display: filled zones, or a single line at each zone's origin.
Separate colors and adjustable opacity for demand vs supply.
Each zone is labeled with its timeframe.
Adjustable detection thresholds (impulse move %, close-in-range %, basing body %) and a cap on zones per timeframe.
How to use
Add it to any chart. Zones from all enabled timeframes appear as colored areas extended to the right. Treat demand zones as potential support and supply zones as potential resistance; a zone disappears once price closes through it. Tune the detection inputs to match the instrument's volatility, and enable Simplify Zones on lower timeframes where many zones stack up.
Inputs
Zone Detection: Impulse min move (%), Impulse close in range (%), Basing body max vs impulse (%), Max zones per timeframe.
Timeframes: 15m / 30m / 1H / 90m / 2H / 4H / 690m / Daily.
Appearance: Show demand / Show supply, Demand & Supply colors, Fill opacity, Fill boxes (off = origin line only), Simplify Zones, Show timeframe label.
Notes
90m and 690m are requested as custom minute resolutions; if your plan or symbol doesn't return one, untick that timeframe.
Higher-timeframe zones need that timeframe's history to be available; extend the chart's loaded history if a timeframe looks sparse.
This tool is for chart analysis and education only. It is not financial advice; test any approach before trading it.
Indikator

Accumulation / Distribution Density (VD)A volume indicator for TradingView (Pine Script v6), modeled after Mieczyslaw Siudek's "Accumulation / Distribution Density" (VD) from xStation (XTB). It hunts for candles where a disproportionately large volume produced a disproportionately small price move at a fresh local extreme - a classic footprint of a big player building (accumulation) or unloading (distribution) a position.
█ 🧠 THE IDEA: DENSITY
Density = volume / candle range (high - low) - "how much turnover per unit of movement".
🚚 A lot of volume + a small candle = high density. Someone big is absorbing everything the market throws at them, so price cannot move.
🪶 A lot of volume + a big candle = normal. The volume simply traveled with the price.
normal candle density candle
volume: ██ 2K volume: ████████ 8K
range: │ (big) range: ▮ (small)
│
│ ▮ ← 8K went in, price barely moved:
│ ▲ someone ABSORBED it (marker)
When such a candle also sets a new local low , buyers were absorbing the sell-off → accumulation (marker below the candle). At a new local high , sellers were absorbing the buying → distribution (marker above the candle).
price
│ ▼ ← distribution: new high, huge volume, small candle
│ ┌──┸──┐
│ ─┘ └─┐
│ └──┐ ┌───
│ └─┐ ┌──┘
│ └─┰─┘
│ ▲ ← accumulation: new low, huge volume, small candle
└────────────────────────── time
█ ⚙️ SIGNAL CONDITIONS
A marker appears on a candle only when all of these hold:
📉 New extreme - the candle's low is at or below the lowest low of the previous Max/Min of candles (accumulation), or its high is at or above the highest high of those candles (distribution).
🚚 High density - volume / range >= Density Factor x average density .
🤏 Small candle (optional, Spread condition ) - range <= Spread Factor x average range .
🎯 Close position (optional, Bar close % ) - for accumulation the close must sit at least X% above the low; for distribution at least X% below the high. 0 disables the filter.
🔊 volume > 0 - instruments without volume data never signal.
Both averages (range and density) use a window ending at the previous candle - the signal candle does not inflate its own threshold.
By default the conditions are checked only once the candle closes ( Signal on closed candle only ) - a marker never appears and then disappears on the live candle.
█ 🛠️ PARAMETERS
Parameters (as in xStation)
Max/Min of (bars) (default 5) - how many previous candles the signal candle must out-low / out-high.
Average Spread of (bars) (default 5) - window for the average range.
Average Density of (bars) (default 5) - window for the average density.
Spread condition (default on) - toggle for the "candle must not be too big" filter.
Spread Factor (default 1.4) - how much larger than the average range the signal candle may be.
Density Factor (default 2) - how many times the average density the candle must reach.
Bar close (%) (default 0) - the close-position filter described above.
Signal on closed candle only (default on) - evaluate signals only when a candle closes (no repainting). Turn off to watch signals form in real time on the unclosed candle - such a signal may vanish before the close.
Appearance (Style tab)
Markers are plotshapes, so each signal gets its own row in the Style tab of the indicator settings - with a visibility checkbox, a marker-shape picker, a position dropdown ( Above bar / Below bar ), and a color:
Accumulation (default: triangle below the bar) ,
Distribution (default: triangle above the bar) .
█ 🔔 ALERTS
Accumulation density - potential bullish signal (heavy volume, little movement, new low).
Distribution density - potential bearish signal (heavy volume, little movement, new high).
With Signal on closed candle only on (default) alerts fire at the candle close. If you turn that option off, set the alert trigger to Once Per Bar Close - otherwise an alert can fire on a live-candle signal that later vanishes.
█ 📤 SIGNAL OUTPUT
The script exposes a hidden Signal series: +1 (accumulation), -1 (distribution), 0 (none). It is visible in the Data Window and can be used as an external source in other indicators and strategies (any input.source field) - e.g. to build your own strategy on top of these signals.
█ ✅ CORRECTNESS - VERIFIED
The implementation was verified empirically (2026-08-18): signals recomputed independently (Node.js, same formulas) from OHLCV bars pulled off a live TradingView chart (COMEX:GC1!, 60m, 300 bars) and compared with the markers the Pine script actually drew:
default parameters → 1 signal, exact match (and 299 bars correctly without a marker),
relaxed parameters (Max/Min 3, Spread Factor 2.5, Density Factor 1.2) → 63 signals, exact match , zero missing, zero extra.
The script does exactly what this note describes.
█ ⚠️ WHY MARKERS DIFFER FROM XSTATION
Even with identical parameter values, markers will not land 1:1 on xStation's. This is expected, not a bug:
📊 Different data. xStation runs on XTB's own CFD feed; its volume is XTB tick volume (count of price updates in XTB's book). TradingView shows real exchange volume (futures/stocks) or another provider's feed. Density = volume / range is extremely sensitive to both - different volume and different OHLC (session hours, timezone, weekend CFD candles) shift every threshold in the formula.
🔒 The original algorithm is closed source. XTB only published parameter descriptions, not formulas. Ambiguities the port had to decide (each can move single markers):
averages computed over the window ending at the previous candle (the original may include the signal candle),
new-extreme check uses <= / >= (the original may require a strict break),
a zero-range candle (doji) divides by one tick instead of being skipped,
"Bar close %" measured from the low (accumulation) / from the high (distribution).
⏳ Live-candle behavior. With Signal on closed candle only turned off, conditions are evaluated on live values, so a marker on an unclosed candle can disappear before the close. The default (on) evaluates only closed candles; xStation's behavior here is unknown.
Practical takeaway: compare the two on the same market data type (e.g. gold futures on both), expect agreement in character (markers cluster in the same spots), not in identical candles.
█ ⛔ LIMITATIONS
Requires an instrument with volume data - many TVC CFDs (TVC:GOLD, TVC:USOIL) have zero volume and never signal; the script then shows a warning in the top-right corner of the chart. Check per symbol (e.g. TVC:UKOIL does have volume) or use futures (e.g. COMEX:GC1!).
A signal on an unclosed candle may vanish before the close - only with Signal on closed candle only turned off (see above).
© Piotr Kowalski "piecioshka". License: Mozilla Public License 2.0.
Indikator

PDH PDL PWH PWL Boundary Response RegisterOVERVIEW
PDH PDL PWH PWL Boundary Response Register is an open-source prior-range research tool for time-based intraday charts and the 1D chart.
It plots four raw boundaries from completed higher-timeframe periods:
* PDH: Previous completed daily high
* PDL: Previous completed daily low
* PWH: Previous completed weekly high
* PWL: Previous completed weekly low
The script then records how the current day or week interacts with each boundary.
Its purpose is descriptive research. It does not calculate a conventional pivot ladder, assign support or resistance, predict direction, identify a target, generate entries or exits, or report win rates or profitability.
BOUNDARY LIFECYCLE
Each enabled boundary maintains an independent lifecycle for its active source period:
1. Untested
No confirmed contact has been recorded under the selected contact definition and tolerance.
2. Contacted
The boundary has received its first confirmed contact.
3. Sustained beyond
The configured number of consecutive confirmed closes finished beyond the boundary.
This state is independent of direct wick or body contact, so a price gap can satisfy the confirmed-close condition without first recording a conventional wick or body contact.
4. Re-entered
After Sustained beyond, a confirmed close crossed back through the boundary into the corresponding previous-day or previous-week range.
These states are factual classifications.
Sustained beyond does not mean that a breakout will continue. Re-entered does not mean that a reversal will follow.
CONTACT DEFINITIONS
The Contact definition input provides three research modes:
* Wick range: the confirmed bar's high-low range reaches the boundary.
* Candle body: the confirmed bar's open-close body reaches the boundary.
* Close-to-close span: two consecutive confirmed closes straddle the boundary, including a gap when the closes lie on opposite sides.
Contact tolerance can be configured as:
* Exact
* Ticks
* A fraction of the last completed daily ATR
These settings change the contact measurement rule. They do not change the underlying PDH, PDL, PWH, or PWL price.
POST-CONTACT RESPONSE REGISTER
After the first confirmed contact, the script can record an independent response profile for each boundary.
The measurements include:
* First-contact form: Gap beyond, Close through, Wick through, or Boundary touch.
* Confirmed post-contact observation count.
* Outside-close residency: the percentage of confirmed post-contact observations that closed beyond the boundary.
* Close-side recross count: the number of confirmed changes between the inside and outside sides of the boundary.
* Maximum outside excursion.
* Maximum return into the corresponding prior range.
* Chart bars from first contact to Sustained beyond.
* Chart bars from Sustained beyond to the first Re-entered event.
The register abbreviates two response fields:
OUT/X
* OUT: outside-close residency percentage.
* X: confirmed close-side recross count.
MAX O/I
* O: maximum outside excursion.
* I: maximum return into the corresponding prior range.
Maximum excursions are normalized with a daily ATR value frozen at the relevant daily or weekly reset.
These values describe the currently active source period. They are not historical probabilities, confidence scores, success rates, expectancy measurements, or performance statistics.
CROSS-HORIZON RANGE GEOMETRY
The register also measures how the completed daily and weekly ranges relate to each other.
Its cross-horizon fields include:
* The current confirmed close's coordinate inside the previous-day range.
* The current confirmed close's coordinate inside the previous-week range.
* Daily contact coverage for PDH and PDL.
* Weekly contact coverage for PWH and PWL.
* Bar separation between the two boundaries when both boundaries in a pair have been contacted.
* Daily and weekly range containment or overlap.
* The mathematical intersection of the previous daily and weekly ranges.
* The shared interval as a percentage of each prior range.
* Current day range use relative to the previous completed daily range.
* Current week range use relative to the previous completed weekly range.
* PDH/PWH separation in completed daily ATR units and ticks.
* PDL/PWL separation in completed daily ATR units and ticks.
* Configurable nearby-pair detection.
* A four-level hull formed by the outermost values of PDH, PDL, PWH, and PWL.
* The current close's coordinate inside that hull.
* The hull's upper and lower boundary anchors.
* The hull width in completed daily ATR units.
* State breadth across all enabled boundaries.
State breadth reports how many enabled boundaries have reached:
* C: Contacted
* S: Sustained beyond
* R: Re-entered
The shared corridor, nearby pairs, range relation, and four-level hull are geometric references.
The script does not classify them as support, resistance, liquidity, supply, demand, accumulation, distribution, institutional levels, or trade setups.
VISUAL OUTPUT
The default presentation includes:
* Distinct PDH, PDL, PWH, and PWL lines.
* Different default styling for daily and weekly boundaries.
* Optional prior-day and prior-week range ribbons.
* Optional shared-corridor highlighting.
* Optional nearby-pair highlighting.
* Historical daily and weekly segments with adjustable retention.
* Reduced emphasis for completed historical segments.
* Optional first-contact or full-lifecycle event marks.
* Compact right-edge identification tags.
* Automatic merging of nearby daily and weekly tags.
* Optional dotted leaders when a display tag is displaced from its exact boundary price.
* A fixed Boundary Response Register in the selected chart corner.
The right-edge tags use the currently visible chart range, visible bar count, completed daily ATR, and tick-size floors only to resolve annotation spacing and future-side placement.
The tags can reposition when the chart is scrolled or zoomed.
This visual repositioning does not change:
* The exact PDH, PDL, PWH, or PWL prices.
* Horizontal boundary-line prices.
* Lifecycle states.
* Post-contact response measurements.
* Range geometry.
* Alert conditions.
Exact prices and full state details remain available in the Boundary Response Register and label tooltips.
DATA HANDLING AND REALTIME BEHAVIOR
PDH, PDL, PWH, PWL, and the ATR normalization value are requested from completed higher-timeframe bars.
The expressions used with higher-timeframe lookahead are offset by one completed higher-timeframe bar before being used. The four active boundary prices therefore do not change during their corresponding current day or week.
Lifecycle and response events are committed on confirmed chart bars.
The combined dynamic alert also uses once-per-bar-close frequency.
Some current-context fields can continue changing while the realtime bar is open, including:
* Current close distance from each boundary.
* Current day range use.
* Current week range use.
* Developing current-period high and low values.
Those current-context fields are distinct from confirmed lifecycle history.
SOURCE MODES
Three reference-data modes are available:
Automatic
Uses the chart context on standard charts and standard-symbol candles on non-standard charts.
Chart context
Preserves the current chart's ticker context and modifiers.
Standard candles
Requests standard market candles without non-standard chart construction or other ticker modifiers.
When the selected event source has no usable bar aligned with the current chart timestamp, event evaluation pauses instead of treating an older forward-filled candle as a new observation.
NON-STANDARD CHARTS
Heikin Ashi, Renko, Kagi, Line Break, Point and Figure, Range, and other non-standard charts can contain synthetic OHLC values.
The completed daily and weekly boundaries remain available, but lifecycle events, current-range progress, and related alerts are disabled by default on non-standard charts.
Users can enable non-standard-chart event evaluation only for explicit research.
SUPPORTED TIMEFRAMES
The script supports:
* Time-based intraday charts.
* The 1D chart.
Tick charts and timeframes above 1D are excluded because their relationship with the requested event data would require ambiguous lower-timeframe reconstruction.
An on-chart notice is displayed when the selected timeframe is unsupported.
IMPORTANT 1D LIMITATION
On the 1D chart, the daily boundary lifecycle resets on each new daily bar.
PDH and PDL therefore cannot accumulate more than one daily close before the next daily reset.
When Closes required beyond is set above 1, the multi-close Sustained beyond state for PDH and PDL is primarily meaningful on intraday charts.
PWH and PWL can still accumulate multiple daily closes during the active week.
For full daily-boundary lifecycle and post-contact research, a time-based intraday chart is recommended.
ALERTS
Factual alert conditions are available for:
* First confirmed contact of any enabled boundary.
* First confirmed contact of each individual boundary.
* Sustained beyond for any enabled boundary.
* Sustained beyond for each individual boundary.
* Re-entered for any enabled boundary.
* Re-entered for each individual boundary.
* Formation of a nearby PDH/PWH pair.
* Formation of a nearby PDL/PWL pair.
* Completion of the daily contact pair.
* Completion of the weekly contact pair.
* A configurable outside-close residency threshold.
* A configurable maximum outside-excursion threshold.
* A combined confirmed-bar alert() message that consolidates simultaneous events.
Alerts report observed conditions only.
They do not instruct the user to buy, sell, enter, exit, place a stop, or select a profit target.
HOW TO USE
1. Apply the script to a standard time-based intraday chart or the 1D chart.
2. Select Automatic, Chart context, or Standard candles according to the data context being researched.
3. Enable daily and weekly boundaries and select the amount of historical retention.
4. Choose the contact definition and tolerance.
5. Select the number of confirmed closes required for Sustained beyond.
6. Read each boundary's lifecycle together with OUT/X and MAX O/I rather than interpreting a horizontal line in isolation.
7. Use the lower register rows to compare daily and weekly range geometry, shared overlap, current range use, pair spacing, hull position, and state breadth.
8. Adjust nearby-pair thresholds, historical event-mark density, right-edge tag content, and register size for the symbol and timeframe.
9. Use Market Replay and multiple symbols to verify customized settings before creating alerts.
WHY THIS IS A SEPARATE PUBLICATION
This study is separate from Previous Day Pivot Path - Intraday Support Resistance because the two scripts address different research questions and use different analytical structures.
Previous Day Pivot Path is a previous-day pivot-formula and arrival-order study. It calculates P, R, and S levels, supports pivot formula families, records first-arrival rank, distinguishes reached and unreached levels, and can emphasize the next unreached level. PDH and PDL are optional context references in that study.
Boundary Response Register calculates no:
* P/R/S ladder.
* CPR.
* Pivot formula family.
* Pivot arrival rank.
* Reached-versus-unreached path.
* Next unreached level.
* Next target.
Its four primary objects are the raw completed-period boundaries PDH, PDL, PWH, and PWL.
It tracks:
* Their independent lifecycle.
* Their post-contact response measurements.
* Daily and weekly range geometry.
* Shared range overlap.
* High-pair and low-pair spacing.
* Four-level hull position.
* State breadth.
Combining these functions into the existing pivot study would materially change that publication's purpose, supported horizon, default output, settings structure, alerts, and user workflow.
This is therefore a separate research tool rather than a minor visual variation or version update.
DISTINGUISHING DESIGN
Many previous-period high and low tools focus on one or more of the following:
* Drawing horizontal lines only.
* Tested or untested status.
* Swept or unswept status.
* Previous-month levels.
* Range midpoints or equilibrium levels.
* Nearest-target labels.
* Directional bias.
* Historical reach or break rates.
* Trade-plan instructions.
This implementation instead combines:
* Four raw completed daily and weekly boundaries.
* A four-stage lifecycle for each boundary.
* Confirmed post-contact response measurements.
* Frozen-ATR normalization of outside and inside excursions.
* Daily and weekly range-intersection geometry.
* Contact-pair timing.
* A four-level hull.
* State breadth.
* Neutral confirmed-bar alerts.
* Scale-aware annotation collision management.
The common PDH, PDL, PWH, and PWL inputs are objective completed-period prices.
The distinguishing purpose of this implementation is the state, response, geometry, source-handling, and visualization framework built around those four boundaries.
LIMITATIONS
* OHLC bars do not reveal the exact tick-by-tick sequence inside a candle.
* The script does not invent an intrabar event order.
* Contact results depend on the selected Wick range, Candle body, or Close-to-close span definition.
* Contact results also depend on the selected tolerance.
* Multiple events confirmed on the same chart bar are simultaneous at chart resolution unless the available data proves otherwise.
* Sustained beyond is a configurable confirmed-close condition, not proof that a move will continue.
* Re-entered is a recorded return through a boundary, not proof of reversal.
* ATR-normalized values depend on the symbol's completed daily data and the selected ATR length.
* Current day and week range-use values are incomplete while the current period is developing.
* The first loaded day or week can contain partial history if the chart dataset begins after that source period started.
* Session definitions, holidays, early closes, broker feeds, exchange data, and ticker modifiers can change completed-period OHLC values.
* Synthetic charts can produce event timing different from standard market candles.
* Historical drawing retention is limited by the selected settings and TradingView object limits.
* The visual annotation rail can move when the visible chart window changes.
* The script provides no entries, exits, targets, stops, position sizing, probability forecasts, or performance claims.
OPEN-SOURCE IMPLEMENTATION
The script is written in Pine Script v6 using Pine built-ins and independently implemented state, measurement, and drawing logic.
It imports no external libraries.
The source is published openly so users can inspect the calculations and adapt the research settings within TradingView's rules.
Indikator

Split VWAPWhat it does
Split VWAP cuts every bar horizontally at the session VWAP and draws it as two candles at the same position: one spanning the low up to VWAP, one spanning VWAP up to the high. Each partial takes the bar's open and close clamped into its own range, and a share of the bar's volume proportional to its height. Where VWAP sits at or beyond a bar's extreme, one partial collapses to zero height and the other takes the whole bar and all of its volume; the collapsed one is hidden by default.
A single candle gives you four prices and one volume total, but says nothing about how that activity was distributed relative to the session's average price. Splitting the bar at VWAP and attributing volume to each side makes that distribution visible.
How the colouring works
Each partial is coloured from two changes, both measured against the previous bar's partial on the same side of VWAP: the change in attributed volume, and the change in clamped close.
In the default mode, "Volume hue OKLCh", each change gets a channel of its own. The volume change moves the hue along a continuum — red (
#ea6c5c, hue 29) when it fell, green (
#05b28d, hue 171) when it held, blue (
#7b8efa, hue 274) when it rose. The price change moves the lightness: lighter when the close rose, darker when it fell.
All three anchors sit at an OKLCh lightness of 0.680 and hold as much chroma as their hue can carry at that lightness, capped at 0.16 so the ends do not shout over the middle. Green is the quiet one because green simply cannot hold as much. OKLCh is used rather than HSL because HSL treats lightness as a function of the hue you happen to be on, so a fixed magnitude renders brighter on some hues than others; in OKLCh, lightness, chroma and hue move independently.
Bodies are hollow when the partial's clamped close is above its clamped open, and solid otherwise. A dot marks the VWAP level itself, coloured by the same scheme applied to the whole bar.
Three further modes are included — Quadrant intensity, Bilinear blend and Polar OKLCh. These read the two changes as four corner colours instead of two channels, one per sign combination, and use magnitude to drive chroma and opacity. Every corner and anchor colour is an input.
Scaling
Every series is normalised against the dispersion of its own bar-to-bar changes: 2.5x the mean absolute change over a lookback, which is roughly two standard deviations for a well-behaved distribution but far less sensitive to the occasional volume spike.
Measuring each series against itself matters more than it sounds. A partial carries only a fraction of the bar's volume, so normalising its volume change against the whole bar's average volume compresses that axis and leaves the colour field stuck near the middle. In the other direction, half the ATR is smaller than a typical close-to-close move, so the price axis clips on a large share of bars. It also gives the VWAP-pinned partial a usable scale: when a bar closes above VWAP the lower partial's close is pinned to the cut, so its only movement is VWAP drift — small in absolute terms, but perfectly legible against its own dispersion.
The consequence worth holding on to while reading the chart: the colour says how unusual a change is for that partial, not how large it is in absolute terms.
Setup
The script paints over the chart's native candles, but Pine cannot hide the chart symbol itself. For the cleanest result, right-click the chart, open Settings -> Symbol, and uncheck Body, Borders and Wick.
Settings worth knowing
Gradient mode — the four schemes described above.
Price lightness span — how far a full-strength price change moves the lightness off the anchor, in OKLCh lightness. Default 0.16. A wider span reads more decisively but costs colour at both ends, because sRGB is widest in the middle and narrows toward black and toward white. Rather than let the channels clip, the requested chroma is fitted to whatever the lightness and hue can actually carry, so bright bars are pastel and dark bars are saturated.
Response ramp — how quickly the colour responds as a change grows. 1.0 is proportional; the default 0.6 reaches most of the response earlier, so only genuinely quiet bars stay washed out.
Price change scale / Volume change scale — the lookbacks for the two normalisers.
Transparency at no change — how far quiet bars recede. Lower it if the quiet end reads too faint.
Limitations
Volume attribution is proportional to segment height, not measured from intrabar data. It is a shape-preserving approximation, not a true intrabar volume profile.
The VWAP is session-anchored, so the split level resets at each session boundary and the first bars of a session sit close to it.
On a strongly trending session, price can run far enough from the session VWAP that one partial collapses on most bars and the display degrades toward ordinary candles. That is expected behaviour rather than a fault.
The script requires a symbol that reports volume, and raises a runtime error on symbols that report none.
Originality
This is original work. The bar splitting, the volume attribution, the per-partial normalisation, and the OKLCh colour handling — including the OKLab conversions and the chroma fitting, neither of which Pine provides — are implemented from scratch. No third-party code is reused. Indikator

Engulfing Confirmation Signals [algotim]Overview
Engulfing Confirmation Signals is a two-stage price action indicator designed to distinguish basic engulfing candle formations from engulfing setups that receive additional confirmation from market context.
The script does not treat every bullish or bearish engulfing candle as a signal. First, an engulfing candle must satisfy structural requirements and pass a rule-based quality score using trend alignment, relative volume, and ATR expansion. A qualifying engulfing candle then creates a temporary confirmation zone based on its full high-low range.
The second stage waits for price to close beyond that range within a configurable number of bars. This separates the initial pattern from the subsequent breakout confirmation.
Problem Statement
A traditional engulfing detector can produce a large number of signals because the candlestick pattern itself only describes the relationship between the current candle and the previous candle.
This script adds a filtering and confirmation process around that pattern.
Instead of treating the engulfing candle as the final event, the indicator asks two separate questions:
1. Does the engulfing candle have sufficient structural and market-context quality?
2. After qualification, does price subsequently break the engulfing candle's range before the setup expires?
This creates a distinction between a qualified engulfing setup and a confirmed breakout.
Methodology
Stage 1: Engulfing Structure
A bullish engulfing candle must close above its open while the previous candle is bearish.
A bearish engulfing candle must close below its open while the previous candle is bullish.
When full-body engulfing is enabled, the current candle must also open and close beyond the previous candle's corresponding open and close.
The current candle body must be at least the configured multiple of the previous candle's body. The default minimum is 1.05 times the previous candle body.
The pattern is evaluated on the confirmed bar close.
### Stage 2: Quality Score
A qualifying engulfing candle receives a score from three rule-based components.
**Trend alignment - 40 points**
For bullish setups, the close is compared with the configured EMA. A close above the EMA receives the full 40 points. A close within the defined 0.2% proximity band receives 20 points.
For bearish setups, the corresponding relationship is reversed.
**Relative volume - 30 points**
Volume is compared with its simple moving average:
Volume ratio = Current volume / Average volume
The resulting value is converted into a score and capped at 30 points.
This allows the scoring engine to distinguish an engulfing candle occurring with relatively high participation from one occurring on comparatively weak volume.
**ATR expansion - 30 points**
Current ATR is compared with an average of ATR values.
ATR expansion contributes additional points when current volatility is above its ATR baseline, with the contribution capped at 30 points.
The three components are added together. An engulfing candle is accepted only when its total score reaches the user-defined minimum score.
The score is a rule-based filter and should not be interpreted as a probability or expected win rate.
Signal Workflow
Bullish workflow
1. Detect a bullish engulfing candle.
2. Verify the required body relationship with the previous candle.
3. Calculate trend, volume, and ATR components.
4. Add the components into the 0-100 quality score.
5. Ignore the setup if the score is below the minimum threshold.
6. If qualified, create a bullish confirmation zone using the engulfing candle's high and low.
7. Monitor subsequent bars for a close above the engulfing candle high.
8. Generate the confirmed bullish signal when that breakout occurs.
9. Expire the zone if the breakout does not occur within the configured waiting period.
Bearish workflow
1. Detect a bearish engulfing candle.
2. Verify the required body relationship with the previous candle.
3. Calculate trend, volume, and ATR components.
4. Add the components into the 0-100 quality score.
5. Ignore the setup if the score is below the minimum threshold.
6. If qualified, create a bearish confirmation zone using the engulfing candle's high and low.
7. Monitor subsequent bars for a close below the engulfing candle low.
8. Generate the confirmed bearish signal when that breakout occurs.
9. Expire the zone if the breakout does not occur within the configured waiting period.
Why This Indicator Is Different
A conventional engulfing indicator normally stops at identifying the candlestick pattern.
This script uses the engulfing candle as the beginning of a two-stage process.
The first stage evaluates whether the pattern has sufficient contextual support using three measurable conditions: its position relative to an EMA, current volume relative to average volume, and current ATR relative to its ATR baseline.
The second stage does not immediately convert a qualified engulfing candle into a confirmed breakout signal. Instead, the engulfing candle's range becomes a temporary state that is monitored for a subsequent closing breakout.
This distinction is the main purpose of the indicator: the initial engulfing event and the later range break are treated as separate analytical events.
Inputs
Engulfing Detection
**Min Body Size vs Prior Candle**
Controls how large the engulfing candle's body must be relative to the previous candle.
**Require Full Body Engulf**
When enabled, the current candle's open and close must fully engulf the previous candle's body.
Confirmation Engine
**Trend EMA Length**
Sets the EMA used for the trend-alignment component of the score.
**Volume Average Length**
Controls the moving-average baseline used to evaluate relative volume.
**ATR Length**
Controls the ATR calculation used by the volatility component.
**Minimum Quality Score**
Sets the minimum combined score required for an engulfing candle to create a confirmation zone.
Confirmation Zone
**Max Bars to Wait for Confirmation**
Defines how long an active engulfing zone remains valid while waiting for a breakout.
**Extend Zone Box While Active**
Controls whether the active zone visually extends as subsequent bars are processed.
Visual Style
The visual inputs control bullish and bearish colors, zone transparency, Stage 1 markers, and whether the numerical quality score is displayed.
Alerts
The script provides alerts for:
* Qualified bullish engulfing
* Qualified bearish engulfing
* Confirmed bullish breakout
* Confirmed bearish breakout
Qualified alerts identify the first stage of the process. Confirmed breakout alerts identify the second stage.
Practical Usage
The Stage 1 marker can be used to locate engulfing candles that have passed the configured contextual filters.
The Stage 2 confirmation marker can then be used to identify cases where price subsequently closes beyond the qualified engulfing candle's range.
Users can adjust the minimum score to control selectivity. Higher thresholds require stronger combined trend, volume, and volatility conditions and will generally produce fewer qualifying setups.
The confirmation window can also be adjusted depending on how long the user wants an engulfing setup to remain valid.
The indicator is intended for chart analysis and can be evaluated across different instruments and timeframes. Settings should be tested against the characteristics of the market being analyzed.
Limitations
The quality score is a rule-based classification and is not a statistical probability, accuracy percentage, or guarantee of future performance.
Engulfing patterns can fail, and a confirmed range breakout does not guarantee continued price movement.
Volume behavior varies between instruments, particularly where volume data is limited or represents different types of market activity.
EMA, volume, and ATR parameters can produce different results across instruments and timeframes.
Signals are generated from completed bar conditions, but the confirmation process can still produce false breakouts during volatile or ranging conditions.
The indicator does not provide trade management, position sizing, stop-loss, or take-profit recommendations.
Notes
The script is designed as a structured confirmation framework around engulfing price action.
Its output should be interpreted as analytical information rather than a standalone trading decision. Users should evaluate the indicator with their own market context, risk management, and trading methodology. Indikator

Optimal Trade Entry (OTE) Zone Plotter [algotim]Optimal Trade Entry (OTE) Zone Plotter locates the 62%-79% institutional retracement zone of a confirmed impulsive swing and keeps only the single most relevant zone per direction on the chart, fading it through disclosed mitigation states as price interacts with it.
Problem Statement
The Optimal Trade Entry concept, retracing into the 62%-79% region of an impulsive leg before continuation, is a well-known Fibonacci convention, but most public implementations simply plot every Fibonacci level on every swing they detect. This produces charts covered in overlapping retracement boxes, most of which come from insignificant swings that carry no real weight, and gives no visual indication of which zones are still fresh, already tested, or fully invalidated.
This indicator addresses that gap by filtering which swings are allowed to generate a zone in the first place, by showing only the current zone per direction at full strength, and by changing each zone's appearance as price actually interacts with it.
Methodology
Swing highs and lows are identified with ta.pivothigh/ta.pivotlow using a user-defined Pivot Length, so every swing referenced by the script is a confirmed pivot, evaluated only after barstate.isconfirmed is true.
Consecutive pivots of the same type extend a running swing extreme; a leg is only registered when the pivot type alternates (a low following a high, or a high following a low). Each candidate leg must then clear three disclosed checks before it is allowed to create a zone: the leg's price range must reach a minimum multiple of ATR, the swing candle's own body-to-range ratio must reach a minimum threshold, and, if the Break of Structure filter is enabled, the new swing must exceed the prior swing of the same type. Legs that fail any check produce no zone, no label, and no alert.
A qualifying leg generates one OTE zone: the shaded region between the 62% and 79% retracement of that leg, with the 70.5% level drawn as a two-layer glowing midline inside it. Only one bullish and one bearish zone are ever active at a time. When a new qualifying leg forms, the previous zone of that direction is frozen in place and, if enabled, kept as a single low-opacity historical reference rather than removed outright or left overlapping the new zone.
Each active zone tracks its own mitigation state on every confirmed bar: Fresh (untouched), Touched (price has wicked into the 62%-79% region), Mitigated (a confirmed close through the 79% boundary), or Invalidated (a confirmed close back through the leg's own origin point). State can only advance forward, and the zone's fill opacity and border color update automatically at each transition, so the chart communicates a zone's condition without any additional label or panel.
Signal Workflow
Step 1 — a confirmed swing pivot alternates direction, registering a candidate leg from the prior opposite pivot to the new one.
Step 2 — the leg is checked against the Minimum Swing Size, Body Ratio, and optional Break of Structure filters; legs that fail are discarded with no chart output.
Step 3 — a qualifying leg creates a new active OTE zone (62%-79%) with its 70.5% midline, and the previous zone of the same direction is frozen and faded.
Step 4 — the active zone's state advances from Fresh to Touched as price wicks into the zone on a confirmed bar.
Step 5 — the zone advances to Mitigated on a confirmed close through the 79% boundary, or to Invalidated on a confirmed close back through the leg's origin, at which point it is greyed out.
Step 6 — each transition and each zone entry/exit can trigger its own alert, gated by the corresponding toggle in the Alerts group.
Why This Indicator Is Different
Most public OTE/Fibonacci scripts draw a zone for every detected swing regardless of its significance, leaving multiple overlapping retracement boxes on the chart at once.
This script applies a disclosed three-part quality filter (ATR-relative swing size, swing candle body ratio, optional break-of-structure confirmation) before a swing is even allowed to generate a zone.
Only one zone per direction is ever shown at full strength; the prior zone automatically fades to a quiet historical reference the moment a new qualifying swing appears, keeping the chart focused on the current opportunity.
Zone fill opacity and border color are driven entirely by a four-state mitigation engine (Fresh/Touched/Mitigated/Invalidated) computed from confirmed price action against the zone's own boundaries, so the visual state of a zone is informative rather than purely decorative.
The 70.5% equilibrium level is rendered as a two-layer glow line rather than a plain dashed line, giving the zone's mid-point a distinct, non-generic appearance.
Inputs
Swing Detection
Pivot Length
ATR Length
OTE Quality Filter
Minimum Swing Size (x ATR)
Minimum Swing Candle Body Ratio
Require Break of Structure
OTE Zone
Show Bullish OTE Zones
Show Bearish OTE Zones
Zone Extension (bars)
Show Institutional Midline (70.5%)
Fade Previous Zone on New Swing
Visual Settings
Bullish/Bearish Zone Colour
Bullish/Bearish Midline Colour
Label Size
Alerts
Alert: New OTE Zone Created
Alert: Price Entered OTE Zone
Alert: Price Left OTE Zone
Alert: OTE Zone Mitigated
Alert: OTE Zone Invalidated
Alerts
Alerts are available for:
New Bullish/Bearish OTE Zone Created
Price Entered Bullish/Bearish OTE Zone
Price Left Bullish/Bearish OTE Zone
Bullish/Bearish OTE Zone Mitigated
Bullish/Bearish OTE Zone Invalidated
Practical Usage
Treat an active, Fresh OTE zone in the direction of the prevailing structure as a region to watch for a retracement entry, not a standalone entry signal by itself.
Use the Break of Structure filter on trending instruments to restrict zones to swings that genuinely extended structure, and disable it on ranging instruments where internal swings may still be meaningful.
Raise the Minimum Swing Size and Body Ratio filters on lower timeframes or noisy instruments to reduce the number of zones generated.
Watch the zone's fill opacity as a quick visual read of its condition: a bold zone has not been tested, a lighter fill has already been touched or mitigated, and a greyed zone has been invalidated and should generally be disregarded.
Combine the Entered/Exited alerts with your own confirmation criteria (candlestick behavior, lower-timeframe structure, etc.) rather than treating zone entry alone as a trigger.
Limitations
Swing pivots require bars to form on both sides before they confirm, so every zone is inherently placed a Pivot Length number of bars after the actual swing extreme occurred.
The quality filter reduces the number of zones shown but does not evaluate or predict the outcome of any individual retracement.
Only one active zone per direction is displayed at a time; if you want to review multiple historical zones simultaneously, enable "Fade Previous Zone on New Swing" and note that only the single most recent prior zone is retained, not a full history.
As with any retracement-based tool, results will vary across instruments, timeframes, and market regimes.
Notes
This indicator is a zone-location tool intended to highlight the current, quality-filtered Optimal Trade Entry region and its mitigation state through a disclosed, rule-based process.
All swing confirmations, zone creation, mitigation-state transitions, and invalidations are evaluated on confirmed bar closes only, so no element of the script repaints once drawn.
The output is intended to support retracement-based analysis and is not a standalone buy or sell recommendation. Indikator

Pattern Atlas: Candlestick Indicator [AxeAlgo]Pattern Atlas: Candlestick Indicator
Companion indicator to Pattern Atlas : Candlestick (Library #1 of the AxeAlgo Pattern Atlas)
WHAT THIS INDICATOR IS
This is a complete candlestick pattern scanner built on top of the Pattern Atlas : Candlestick library — 23 classical candlestick patterns, detected on every bar and turned into on-chart highlighting, a live scanner table, and alerts. It doesn't implement any pattern math itself; every detection is delegated to the library's detect*() functions, so what you see here is exactly what that library finds, with nothing added or reinterpreted.
Candlestick reading is one of the oldest tools in technical analysis, tracing back to Steve Nison's work bringing Japanese candlestick charting to Western traders. The 23 patterns here follow that standard catalog (cross-checked against TA-Lib's CDL* function list), so anyone who already knows what a Morning Star or a Bullish Engulfing bar looks like will recognize exactly what's being flagged.
THE 23 PATTERNS IT SCANS
Single-bar patterns (9): Doji, Long-Legged Doji, Dragonfly Doji, Gravestone Doji, Hammer / Hanging Man, Inverted Hammer / Shooting Star, Marubozu, Spinning Top, Belt Hold.
Two-bar patterns (6): Engulfing, Harami, Harami Cross, Piercing Line / Dark Cloud Cover, Tweezer Top / Bottom, Kicker.
Three-bar-and-longer patterns (8): Morning / Evening Star, Morning / Evening Doji Star, Three Soldiers / Crows, Three Inside Up / Down, Three Outside Up / Down, Abandoned Baby, Rising / Falling Three Methods (the one pattern spanning 5 bars), Stick Sandwich.
READING THE CHART
Each matched pattern gets a box drawn around the exact bars it spans, colored gold for bullish, pale gold-white for bearish, and bright gold for neutral (indecision) patterns — colors are user-configurable. On top of that, a "pin" marker appears at the bar: bullish pins hang below the bar, bearish pins sit above it, and neutral patterns get a plain floating gem with no stem, since indecision doesn't have a direction to anchor to. Hovering any pin or gem shows the full description of everything that matched on that bar, including a measured strength percentage for each one — not just the pattern name repeated back at you.
Strength is a generic, direction-based read on how decisively the bar closed within its own high-low range (near the high for a bullish match, near the low for a bearish one, or a small body relative to the range for a neutral one) — a rough, pattern-agnostic proxy, not a bespoke ratio breakdown per pattern, since that level of internal detail isn't something the library exposes.
THE SCANNER TABLE
A table lists all 23 patterns grouped by category, with a live status column showing each one's current match percentage (or a dash when nothing's matching on the current bar). Position, text size, and whether it's shown at all are all configurable. This table is intentionally live — it reflects the forming bar in real time rather than waiting for the bar to close, since it's meant as a "what's happening right now" readout rather than a persisted signal.
FILTERS AND SETTINGS
Every pattern has its own on/off checkbox, and each of the three categories (Single-Bar, Two-Bar, Three-Bar+) has a master switch above its checkboxes to turn the whole group off in one click.
Three additional filters are available, all off by default so the scanner stays an unbiased detector unless you opt in:
- Volume confirmation — requires a match to occur on at least a chosen multiple of its own trailing average volume before it counts.
- Trend context — requires bullish matches to occur against a downtrend and bearish matches against an uptrend (the classical reading that a reversal candle means more against the trend it's reversing than in the middle of a random chop). Neutral patterns are never filtered by this, since they don't imply a direction.
- Minimum strength — hides matches below a chosen strength percentage.
These filters affect what's drawn on the chart and what feeds the pin/gem tooltips. They do not affect the scanner table, which always shows the library's raw, unfiltered read of the current bar, and they do not affect the per-pattern alerts described below, which fire independently of the visual display settings.
ALERTS
Every pattern has its own alert condition available in TradingView's Create Alert dialog, plus three combined conditions (any bullish pattern, any bearish pattern, any neutral pattern), plus one dynamic alert with a full message listing every pattern that matched, grouped by direction, with each one's measured description and strength.
A NOTE ON REPAINTING
Every box, pin, gem, and alert is gated on the bar actually having closed — nothing here fires or gets drawn off a still-forming bar, regardless of your alert-frequency setting in TradingView's dialog. The one exception is the scanner table, which is deliberately live so it can answer "what's happening on this bar right now" — that's a readout, not a persisted signal, and it's expected to change as the current bar develops.
PART OF A LARGER SERIES
This indicator is the companion to Library #1 of the AxeAlgo Pattern Atlas — a planned set of Pine libraries splitting pattern detection by the method actually used to find each kind of pattern: candlestick shape (this one), classical chart/geometric patterns (Library #2), harmonic Fibonacci-ratio patterns (Library #3), and market-structure concepts (order blocks, liquidity, Wyckoff-style events). Each library has, or will have, its own companion scanner indicator built the same way this one is.
DISCLAIMER
This indicator is a technical analysis tool for identifying classical candlestick shapes in historical and live price data. It does not predict future price movement, and a detected pattern — including its measured strength — is a description of past price action, not a signal guaranteed to repeat. Nothing in this script constitutes financial advice. Always combine pattern recognition with your own risk management and broader analysis before making any trading decision.
Indikator

Inside Bar [scriptedge]Overview
Inside Bar looks for a higher timeframe candle that trades entirely within the range of the one before it. Throughout this description the larger candle is called the mother candle , the contained one is the inside bar , and the one that follows is the trading candle .
The indicator is designed so that the whole setup can be visualised from the lower timeframe you intend to trade. The higher timeframe is read in the background and its structure is drawn onto your chart, so there is no need to switch timeframes to see where the range sits or how the trading candle is developing.
The tool draws structure and context. It does not generate buy or sell signals, and it does not manage entries, exits, stops, or position size. Those decisions are left to the trader.
The Higher Timeframe Pattern
An inside bar is a two candle pattern. The second candle's high is at or below the first candle's high, and its low is at or above the first candle's low — the whole candle sits within the range of the one before it. That is compression. Range has contracted, and unlike most patterns it carries no direction of its own. Both boundaries of the mother candle are live, and the market decides which one matters.
What Gets Drawn
Once the inside bar closes, the mother candle's high and low are drawn as solid lines. These are the levels a break has to clear, and they are what almost every published treatment of this pattern uses for entries and stops.
A shaded box spans the compression itself: from the mother candle through every inside bar, ending where the trading candle opens. The box shows the coil, the lines carry the levels forward through the trading candle.
Two target lines are projected at one times the mother candle's range, one above the high and one below the low. This is the measured move, the conventional objective for a range break. They are drawn from the trading candle's open, since that is when a target first becomes relevant. Every line stops when price trades through it, or when the trading candle ends, whichever comes first.
Nested Inside Bars
Inside bars often arrive in runs. When the trading candle turns out to be another inside bar — still entirely within the mother's range — the coil has not resolved, so nothing is reset. The mother candle's levels stay exactly where they are, the box extends, and the next candle takes over as the trading candle. A label on the box counts the inside bars whenever there is more than one, so a deep coil is visible at a glance.
Higher Timeframe Panel
The mother candle, every inside bar and the trading candle are redrawn to the right of the live chart, with the mother's levels marked across them. The trading candle updates live. On a long coil the mother candle is often well off the left of your screen. The panel is what lets you see the whole pattern without scrolling or switching timeframes.
Stats Dashboard
The table counts how past breaks on the selected higher timeframe resolved. A break is recorded the moment price trades outside the mother candle's range during the trading candle.
Breakout — after breaking, price reached the target before reaching the opposite boundary.
Failed breakout — after breaking, price reached the opposite boundary first.
Those two levels sit exactly one mother range either side of the break, so this is a symmetrical test rather than an arbitrary pairing.
A trading candle can break both boundaries, in which case both breaks are counted separately with their own outcomes. Breaks that have not yet resolved are excluded until they do, and setups still coiling are not counted at all, so the two percentages always sum to one hundred.
There is deliberately no win rate here. A failed breakout is a losing outcome to one trader and the entire premise to another, and it is not the indicator's place to decide which.
Please read this table for what it is. It is a count of what price did on the bars loaded in your chart. It is not a backtest and not a strategy report. No entry price, exit price, stop, commission, or slippage is assumed, because the indicator does not place trades. Past behaviour of a market does not indicate future behaviour.
Settings
Chart Theme — light or dark colour palette.
Stats Dashboard — show or hide the table.
Higher Timeframe — 15m, 1h, 4h, D, W or M.
HTF Candle Separators — vertical line at each higher timeframe open.
Show Target Lines — the measured move projections.
Alerts
An alert fires the first time price trades outside the mother candle's range in each direction, with a message naming the timeframe and the side, for example 1h inside bar broken up . A trading candle that breaks both boundaries produces two alerts. To use them, create an alert on the indicator and choose Any alert() function call as the condition.
Repainting
Historical bars are never restated. Specifically:
Higher timeframe candles are built by aggregating completed chart bars, so the pattern is only known once the inside bar has closed. request.security() with lookahead is not used anywhere in the script.
Levels come from candles that have already closed. Nothing is drawn at a price that could still change.
A break occurs once price trades through a level, which cannot be undone within a bar — once price has traded outside the range it has traded outside the range.
The box and the lines extend to the right as the trading candle progresses. That is a drawing being lengthened, not a value being changed.
Limitations
The mother candle defines the levels . Some traders use the inside bar's own high and low instead, for a tighter trigger and smaller risk. This tool does not draw those.
A break is any trade outside the range, wick or close . A candle that pokes through and closes back inside counts as a break. If you think of a break as requiring a close, the counts here will run higher than you expect.
On the higher timeframe itself , target lines, the inside bar count and the stats table are not shown. There the trading candle is a single bar, which cannot say whether a break or its outcome came first. The pattern, its levels and the box are still drawn.
Above the higher timeframe , nothing is drawn. Select a chart timeframe lower than the higher timeframe setting.
The panel is capped at twelve candles . A coil deeper than that still tracks correctly, but the panel shows the mother candle and the most recent inside bars rather than all of them.
Drawing objects are capped by the platform . On very long histories the oldest drawings will drop off the chart.
The stats table depends on how much history your plan loads , so the counts will differ between account types on the same instrument.
This is an indicator, not a strategy . It offers no entries, exits, stop levels, position sizing, or risk management, and makes no claim about profitability.
Disclaimer
This script is for informational and educational purposes only. It is not financial advice and not a recommendation to buy or sell anything. Trading involves substantial risk of loss. Test any tool thoroughly and make your own decisions. Indikator

MACD Trend Continuation Filter [algotim]MACD Trend Continuation Signals with Trend Strength and Session Validation is a trend-following indicator designed to reduce false MACD crossover signals by requiring confirmation from market direction, trend strength, and trading session activity before generating a signal.
Instead of treating every MACD crossover equally, the indicator applies a sequential validation process so that signals are only produced when momentum develops in the direction of the prevailing trend during active market sessions.
Problem Statement
Standard MACD crossover strategies often generate numerous signals during ranging markets, weak trends, or periods of reduced market participation. While many of these crossovers satisfy the basic MACD conditions, they frequently lack the broader context needed to support a higher-probability continuation move.
This indicator addresses that issue by combining momentum, trend direction, trend strength, and session timing into a single validation workflow. The objective is not to increase the number of signals, but to improve their selectivity by filtering out conditions that commonly produce lower-quality entries.
Methodology
The indicator evaluates each setup through four consecutive validation stages.
Stage 1 – Momentum Trigger
The process begins with a traditional MACD crossover.
A bullish setup requires the MACD line to cross above the signal line while both remain below the zero line, indicating that bullish momentum is emerging from previously negative momentum.
A bearish setup requires the MACD line to cross below the signal line while both remain above the zero line, indicating weakening bullish momentum before potential downside continuation.
Stage 2 – Trend Direction
After a valid MACD crossover is detected, price location relative to the selected EMA determines the higher-level trend.
Long signals require price above the EMA.
Short signals require price below the EMA.
This prevents taking counter-trend MACD crossovers.
Stage 3 – Trend Strength
The indicator then evaluates ADX.
Signals are only accepted when ADX exceeds the user-defined threshold, indicating that directional movement has sufficient strength. When enabled, this filter attempts to reduce signals generated during low-volatility consolidation periods.
Stage 4 – Session Validation
Finally, signals are restricted to the selected trading sessions.
By default, only London and New York sessions are considered valid. These periods generally coincide with higher market participation and increased liquidity compared with quieter trading hours.
Only when all four stages agree is a signal plotted.
Signal Workflow
Bullish Signal
MACD crosses above its signal line.
MACD remains below zero.
Price trades above the EMA trend filter.
ADX exceeds the minimum strength threshold (optional).
The current bar occurs during an enabled trading session (optional).
A bullish signal is displayed.
Bearish Signal
MACD crosses below its signal line.
MACD remains above zero.
Price trades below the EMA trend filter.
ADX exceeds the minimum strength threshold (optional).
The current bar occurs during an enabled trading session (optional).
A bearish signal is displayed.
Why This Indicator Is Different
Many MACD-based scripts generate signals immediately after every crossover.
This indicator instead applies a layered validation process where each filter serves a distinct analytical purpose:
MACD identifies the momentum shift.
The EMA confirms the broader directional bias.
ADX measures whether the market is exhibiting sufficient directional strength.
The session filter limits signals to predefined periods of higher market activity.
Rather than operating as independent indicators displayed together, these components form a sequential decision process where each stage must validate the previous one before a signal is produced.
Inputs
The indicator allows customization of:
MACD fast, slow, and signal periods
EMA length
ADX length
Minimum ADX threshold
London session
New York session
Enable/disable ADX filtering
Enable/disable session filtering
Alerts
Built-in alert conditions include:
Bullish Signal
Bearish Signal
Alerts trigger only after all enabled validation stages have been satisfied.
Practical Usage
The indicator is intended for traders who prefer trading with the prevailing market direction rather than reacting to every MACD crossover.
Because multiple filters must align, signal frequency is intentionally lower than a standard MACD indicator. Traders may use the signals alongside their own price action analysis, support and resistance levels, or risk management rules.
Limitations
Signals are generated only after bar confirmation.
Strong trends may still produce losing trades during rapid market reversals.
Session filtering may exclude valid opportunities occurring outside the selected trading hours.
ADX measures trend strength but does not indicate future price direction.
The indicator is designed as a confirmation tool and should not be relied upon as the sole basis for trading decisions.
Notes
This script is intended for educational and analytical purposes. It visualizes a structured validation process that combines momentum, trend direction, trend strength, and trading session timing into a single signal-generation workflow. As with any technical indicator, outputs should be evaluated within a broader trading plan that includes appropriate risk management. Indikator

Indikator

Indikator

Turtle Trading System - Full (S1+S2)Turtle Trading System - Full (System 1 + System 2)
A complete implementation of the original Turtle Trading rules (Richard Dennis, 1983),
built for Daily timeframe use. Pine Script v6.
FEATURES:
- System 1: 20-day breakout entry / 10-day breakout exit
- System 2: 55-day breakout entry / 20-day breakout exit (failsafe, never filtered)
- Last-Trade Filter: skips a System 1 signal if the prior System 1 trade was a winner,
reducing false breakouts in ranging markets. Falls through to System 2 when filtered.
- ATR-based (N) position sizing reference and 2N initial stop
- Pyramiding: adds units every 0.5N in the favorable direction, up to 4 units max
- Trailing stop that only tightens in the trade's favor, never loosens
- No-repaint option: signals confirm only on closed bars (barstate.isconfirmed)
- Live status table: current position, units held, active system, current N, filter state
NOTES:
- Calibrated for Daily charts, consistent with the original system's historical backtesting.
Using it on lower timeframes changes what the lookback lengths represent and has not been
validated here.
- The Last-Trade Filter only tracks trades entered via System 1. Trades triggered by the
System 2 failsafe do not update the filter, per the original rule set.
- This is a signal/reference tool, not an auto-trading strategy. Verify signals in replay
mode before trading live. Be claude IA Indikator

FCPO KDJ Tower HA EMA StrategyFCPO 5-Min Strategy Backtest v1 — A day-trading strategy for FCPO (Malaysia Crude Palm Oil Futures, BMD:FCPO1!) built on a 5-layer confluence system: KDJ + Tower (Baota) + Heikin Ashi + EMA20 + MACD. It uses the exact same entry logic as the companion "FCPO 5min Signal System v2" indicator, converted to the Strategy Tester to validate signal quality.
Entry Conditions (all 5 layers must align) :
- Layer 1 — Trend filter: price above EMA20 = long only; below EMA20 = short only
- Layer 2 — Momentum: MACD histogram direction (5,20,5)
- Layer 3 — Extreme signal: KDJ J value < 20 (oversold) or > 80 (overbought)
- Layer 4 — Candle confirmation: Heikin Ashi direction matches raw candle close direction
- Layer 5 — Final filter: Tower (Baota) line flips red (bullish) / green (bearish)
- Entries only when flat; each signal fires once, on the first bar all conditions align
Exit Rules (intraday discipline) :
- Fixed stop-loss / take-profit: 8 points each by default (1 lot = RM25 per point, i.e. RM200 / RM200)
- Max holding time: 60 bars by default (can be disabled)
- End-of-day liquidation at 17:45 — no overnight positions
- No new entries after 17:15 (MYT)
Backtest Settings : commission RM12.5/lot and 1-tick slippage included; initial capital 10,000, fixed 1 lot.
How to Use : Open FCPO1! (or BMD:FCPO1!) on a 5-minute chart — keep regular candlesticks (do NOT enable Heikin Ashi candles, as fill prices would be distorted) — add the strategy, then open the Strategy Tester. All parameters (EMA / KDJ / MACD / stop-take points / time windows) are adjustable in the settings panel.
Disclaimer: This script is a technical-analysis tool for validation only. Backtest results do not guarantee future performance, and this is not financial advice. Futures trading involves high risk; always use proper risk management and stop-loss discipline.
FCPO 5分钟 策略回测 v1 —— 基于 KDJ + 宝塔线 + Heikin Ashi + EMA20 + MACD 五层共振入场系统的 FCPO(马来西亚棕榈油期货,BMD:FCPO1!)日内交易策略,与「FCPO 系统警报 v2」指标使用同一套入场逻辑,用于在策略回测器中验证信号质量。
入场条件(五层全部满足才开仓) :
- 第1层 大方向:价格在 EMA20 上方只做多,下方只做空
- 第2层 动量背景:MACD 柱状线方向(5,20,5)
- 第3层 极端信号:KDJ J 值 < 20(KDJL)或 > 80(KDJH)
- 第4层 K线确认:Heikin Ashi 同向 + 普通K线收盘同向
- 第5层 最终过滤:宝塔线翻红 / 翻绿
- 只在空仓时进场,信号首次满足时只触发一次
出场规则(按日内交易纪律) :
- 固定止损 / 止盈:默认各 8 点(1手合约每点 = RM25,即 RM200 / RM200)
- 最长持仓超时:默认 60 根K线(可关闭)
- 日内强平:17:45 触发清仓,不留隔夜仓
- 17:15 后不开新仓
回测设置 :已含手续费(RM12.5/手)与滑点(1 tick);初始资金 10,000,固定 1 手。
使用方法 :FCPO1!(或 BMD:FCPO1!)5 分钟图 → 保持普通K线蜡烛模式(不要开 Heikin Ashi 蜡烛,否则成交价失真)→ 添加策略 → 打开策略回测器查看结果。EMA / KDJ / MACD / 止损止盈点数 / 时间窗口等参数均可在设置面板调整。
提醒:本策略仅为技术分析验证工具,回测结果不代表未来表现,不构成任何投资建议。期货交易风险高,请务必配合资金管理与止损纪律。 Strategie

Alpha S/R Channel StrategyAlpha S/R Channel Strategy (ASRC)
Mean-reversion strategy trading pullbacks to a dynamic Higher Timeframe EMA channel. Confirms exhaustion via Engulfing & Pin Bar patterns, with Pin+Engulf combo overriding trend filters to capture institutional liquidity grabs. Features optional RSI, BB width, and inverted Squeeze Momentum filters. Includes adaptive position sizing, partial TP, breakeven stops, session trade limits, no-trade windows, day/weekend close, and Friday trading control.
📌 Strategy Overview
Alpha S/R Channel Strategy is a dual‑timeframe mean‑reversion strategy that identifies high‑probability reversal setups by combining a dynamic channel derived from a Higher Timeframe EMA with high‑conviction candlestick patterns (Engulfing and Pin Bar).
The strategy waits for price to retrace to a dynamic value area (the channel) and confirms exhaustion through candlestick patterns before entering—capturing pullbacks within the prevailing trend while avoiding counter‑trend trades.
🧠 Unique Edge – Why This Mashup Works
Most trend‑following strategies chase breakouts and get caught in false moves. Most engulfing strategies ignore the bigger picture and enter too early. This strategy solves both problems by combining these components in a specific sequence:
1. Dynamic EMA Channel (The Value Area)
Instead of using static support/resistance, the strategy constructs a dynamic channel around a Higher Timeframe EMA. The channel width adapts to volatility using three modes:
- Percentage – width as % of current price.(price * (channelWidthPct / 100) )
- ATR Multiplier – width based on ATR from the Higher Timeframe.
- Fixed – static price distance.
Why this matters: The HTF EMA represents the "fair value" or equilibrium price. When price pulls back to this zone, it's statistically more likely to resume the trend rather than reverse.
-------------------------------------------------------------------
2. Channel Break + Candlestick Confirmation (The Trigger)
The strategy enters only when price returns to the channel AND shows exhaustion:
- Bullish Engulfing – Current green candle engulfs previous red/small green candle
- Bearish Engulfing – Current red candle engulfs previous green/small red candle
- Pin Bar + Engulfing Combo – Pin bar sweeps recent high/low and is followed by an engulfing pattern
Why this matters: The channel provides the context (where price should reverse). The candlestick patterns provide the confirmation (that reversal is actually happening). Using both drastically reduces false signals.
-------------------------------------------------------------------
3. Optional Multi‑Layer Filters (The Quality Control)
The strategy includes configurable filters that can be enabled/disabled:
1- EMA Lower TF – Ensures micro‑trend alignment (longs above EMA, shorts below)
However, there is a critical override:
🔄 Pin Bar + Engulfing Combo OVERRIDES the EMA Confirmation
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 that bypasses the EMA filter.
Why this is a breakthrough:
Strong institutional reversals (liquidity grabs) often happen against the short‑term EMA trend. A pure trend‑following strategy with a strict EMA filter would miss these reversals because price is moving against the EMA.
2- Higher Timeframe EMA – Ensures long‑term trend alignment
This acts as a "trend filter on top of the trend filter" – preventing entries that go against the even larger market structure. Users can select a separate timeframe (e.g., 1H) with its own EMA length for additional confirmation.
3- RSI – Prevents buying above 70 and selling below 30
4- Bollinger Bands – Blocks entries during low volatility (sideways markets)
5- Squeeze Momentum – This strategy uses an inverted Squeeze Momentum logic:
"val < 0 → Longs allowed, Shorts blocked"
"val > 0 → Shorts allowed, Longs blocked"
"val == 0 → Both allowed"
This inversion is intentional. The strategy is mean‑reversion based—it waits for momentum to become overextended and then trades against that momentum
These filters are optional because different assets and market conditions require different levels of confirmation. The user has full control.
-------------------------------------------------------------------
4. Comprehensive Risk Management
The strategy includes:
- Position Sizing – Fixed percentage of equity per trade (separate for first and second entry)
- Pyramiding – Allows up to 2 positions in the same direction (second trade uses lower risk)
- Multiple SL Options – Low-High, Swing high/low, Channel, Fixed distance
- Trade Counter Reset – Resets at session starts for scalping timeframes, daily for swing
- No‑Trade Windows – Blocks entries during end‑of‑day volatility (active only for TF ≤ 15m)
- Day/Week End Closing – Closes positions before gaps (configurable by timeframe)
- Partial Take Profit – Closes a configurable percentage (default: 50%) at a specified R:R ratio (default: 1:2), allowing the remainder to run to the full target (default: 1:3)
- Breakeven Stop – Optionally moves the stop loss to breakeven when the first TP level is reached, protecting the remaining position from turning into a loss
Why this matters: The risk controls ensure survivability across different market conditions. Also Breakeven protection reduces the risk of winning trades turning into losers.
-------------------------------------------------------------------
📊 How It Works
1. Dynamic Channel Calculation
The strategy constructs a channel around an Exponential Moving Average (EMA) from a selected Higher Timeframe:
- EMA – Calculated on the Higher Timeframe
- Channel Width – Adaptive based on volatility (Percentage, ATR, or Fixed)
- Upper Band = EMA + (Width / 2)
- Lower Band = EMA - (Width / 2)
Channel Width Modes:
- Percentage – Width = Price × (User‑defined %)
- ATR Multiplier – Width = ATR(14) × Multiplier
- Fixed – Width = Static distance
-------------------------------------------------------------------
2. Entry Signal Detection
Trades are executed on the Lower Timeframe (default: 5m) when all conditions are met:
Pattern Requirements (One of the following):
- Bullish Engulfing: Current green candle completely engulfs previous bearish or small green candle
- Bearish Engulfing: Current red candle completely engulfs previous bullish or small red candle
- Pin Bar + Engulfing Combo: Pin bar sweeps recent high/low AND is followed by engulfing pattern (Overrides LTF EMA)
# Engulfing Filters:
Body Only – Only bodies must engulf (not full range)
Min/Max Range – Configurable via Percentage, ATR, or Fixed
Gap Allowance – Controls how much gap is allowed in the wrong direction
Previous Range % – Limits the size of the prior candle when it's in the same color
# Pin Bar Detection:
- Wick/Body Ratio (default: 3.0) – Wick must be 3× larger than body
- Max Body/Range (default: 0.20) – Body must be ≤20% of total range
- Min Wick/Range (default: 0.70) – Wick must be ≥70% of total range
- Sweep Lookback (default: 10 bars) – Pin bar must sweep a recent high/low
Min Pin Bar Range % – Pin bar must meet a minimum size threshold
# Channel Proximity:
Price must be within the channel boundaries (open inside)
-------------------------------------------------------------------
3. Confirmation Filters (All Optional)
- Lower Timeframe EMA : Longs require price > EMA; Shorts require price < EMA (overridden by Pin+Engulf combo)
- Higher Timeframe EMA : Ensures long‑term trend alignment (longs above HTF EMA, shorts below)
- RSI : Prevents longs above 70; Prevents shorts below 30
- Bollinger Bands : Blocks entries when BB width < threshold (low volatility)
- Squeeze Momentum : Ensures momentum matches trade direction (inverted logic)
-------------------------------------------------------------------
4. Risk & Position Management
# Position Sizing:
- First Trade – Fixed % of equity (default: 2%)
- Second Trade – Separate % of equity (default: 1%)
- Position size = (Account Risk) / (Entry – SL Distance)
# Friday Trading:
- Allow Friday Trading (default: Disabled) – When disabled, no new trades will be opened on Fridays. Existing positions are not affected. This helps avoid weekend gap risk as markets close for the week.
# Stop‑Loss Options:
1- Low-High : Entry bar low/high ± buffer
2- Swing high/low : N-bar low/high ± buffer
3- Channel : Channel band ± buffer
4- Fixed distance : Fixed price distance from entry
# Take Profit:
- Main R:R ratio (default: 1:3)
- Separate R:R for second trade (default: 1:3)
# Trade Counter Reset:
TF ≤ 15m – Resets at Asia (20:00 NY), London (03:30 NY), New York (09:30 NY)
TF > 15m – Resets once per day at session start
# No‑Trade Window:
- Active only for TF ≤ 15m (16:45–19:05 NY time)
- Protects against end‑of‑day volatility spikes
# Close All Positions:
- TF ≤ 15m – Can close at day end and/or week end (configurable)
- 15m < TF ≤ 240m – Week end only
- TF > 240m – Feature disabled
# Entry Spacing:
- Minimum Bars Between Entries (default: 4) – Prevents multiple entries on the same bar or too close together, reducing the impact of whipsaw on tightly clustered signals
⚙️ Default Settings – Optimized for XAUUSD (Gold)
All default values have been specifically calibrated for Gold's typical volatility and intraday structure.
Setting \ Default \ Why This Works for Gold
-----------------------------------------------------------------------------------
Higher Timeframe \ 15m \ Gold's intraday rhythm operates on 15‑minute cycles. This timeframe captures the balance between institutional order flow and retail noise.
-----------------------------------------------------------------------------------
EMA Length \ 36 \ approximately one full trading session. This captures the dominant intraday trend without excessive lag.
-----------------------------------------------------------------------------------
Channel Width Mode \ Percentage \ Gold's price levels change over time. Percentage mode ensures the channel scales with price, maintaining consistent relative width regardless of Gold's price level.
-----------------------------------------------------------------------------------
Channel Width \ 0.35% \ Gold's daily range averages $30–$100. At current prices, 0.35% = approximately $113–$16. This width captures ~70% of Gold's daily volatility, creating a meaningful "value zone" that filters noise while remaining relevant.
-----------------------------------------------------------------------------------
Lower Timeframe \ 5m \ Fast enough to capture entry signals within the same session, slow enough to filter out micro‑noise. 5m is Gold's "sweet spot" for intraday entries.
-----------------------------------------------------------------------------------
Engulfing Mode \ Percentage \ Adapts to Gold's volatility. As Gold's price moves, the required engulfing range scales proportionally—ensuring consistent pattern quality.
-----------------------------------------------------------------------------------
Engulfing Min Range \ 0.098% \ At Gold's current price3000-5000, this ≈ $3.0–$5.0. Anything smaller is just market noise, not a meaningful reversal signal.
-----------------------------------------------------------------------------------
Engulfing Max Range \ 0.550% \ At Gold's current price, this ≈ $20–$25. Larger candles are often blow‑off spikes driven by news —they tend to reverse violently, making them poor entry points.
-----------------------------------------------------------------------------------
Previous Range % \ 0.60 \ Allows the prior candle to be up to 60% of the engulfing candle's range. This is Gold's "consolidation before reversal" pattern—a small same‑color candle before a large reversal candle.
-----------------------------------------------------------------------------------
Gap Allowance \ 250 ticks \ Gold's typical spread and gap behavior. (250 ticks = $0.250 However, tick values vary between brokers), which accommodates normal gaps without allowing extreme invalid gaps.
-----------------------------------------------------------------------------------
Pin Bar Sweep \ 10 bars \ On a 5m chart, 10 bars = 50 minutes. Gold's liquidity grabs often occur within a 30–60 minute window. 10 bars captures these recent liquidity zones without looking too far back.
-----------------------------------------------------------------------------------
Pin Bar Range % \ 0.70 \ Requires the pin bar(high-low) to be at least 70% of the minimum engulfing range. This ensures the pin bar has enough size to be meaningful—rejecting tiny pin bars that lack conviction.
-----------------------------------------------------------------------------------
Risk per Trade (1st) \ 2% \ Gold experiences 3–5 trade losing streaks regularly. 2% risk ensures that a typical losing streak results in only 6–10% drawdown—recoverable with a few winning trades.
-----------------------------------------------------------------------------------
Risk per Trade (2nd) \ 1% \ When pyramiding, total exposure increases. 1% on the second trade limits worst‑case loss to -3% total (2% + 1%), protecting the account during false reversals.
-----------------------------------------------------------------------------------
Risk:Reward \ 1:3 \ Gold routinely moves 1.5–2× its ATR in a single directional push. A 1:3 target (e.g., $15 on a $5 stop) is well within Gold's typical daily range—achievable without being overly ambitious.
-----------------------------------------------------------------------------------
Stop‑Loss Reference \ Channel \ Aligns the stop with the value area. If price breaks beyond the channel, the mean‑reversion thesis is invalidated. This is the most logical stop placement for this strategy.
-----------------------------------------------------------------------------------
Stop‑Loss Buffer \ 500 ticks \ 500 ticks = ($0.50 ) on Gold. However, tick values vary between brokers so The table on chart will display and show the calculated dollar value. This provides a safety buffer against spread, slippage, and normal wicks—preventing premature stops while keeping the stop within the value area.
-----------------------------------------------------------------------------------
Partial TP & Breakeven \ Disabled (50%, 1:2) \ Optional features that allow locking in partial profits and protecting positions once they move in your favor. Recommended to enable after forward testing.
-----------------------------------------------------------------------------------
No‑Trade Window \ Enabled \ 16:45–19:05 NY time captures the end‑of‑day volatility spike. Gold often experiences erratic moves during this period as institutional traders close positions.
-----------------------------------------------------------------------------------
Day End Close \ Enabled \ Gold gaps frequently at the daily open (5:00 PM NY). Closing before day end avoids these gaps, which can easily stop out tight positions.
-----------------------------------------------------------------------------------
Week End Close \ Enabled \ Gold is highly sensitive to weekend news (geopolitics, central banks). Gaps of $20–$50+ are common at Sunday open. Closing before Friday close is essential.
-----------------------------------------------------------------------------------
EMA Lower TF \ Enabled \ Ensures entries align with the 5m micro‑trend. However, the Pin+Engulf combo overrides this filter to capture institutional reversals against the trend.
-----------------------------------------------------------------------------------
Higher TF EMA \ Enabled (1H, 55) \ Provides an additional layer of trend confirmation at the macro level. The 1H 55‑EMA acts as a reliable gauge of the broader intraday trend, preventing entries against strong momentum.
-----------------------------------------------------------------------------------
RSI \ Enabled length(14) \ Prevents buying when Gold is overbought (RSI > 70) and selling when oversold (RSI < 30). Gold's sharp spikes often create extreme RSI readings—this filter avoids chasing exhausted moves.
-----------------------------------------------------------------------------------
Bollinger Bands \ Enabled \ locks entries during low volatility (BB width < 0.002). Gold sometimes enters tight consolidation ranges (BB width < 0.002) where engulfing patterns fail. This filter avoids trading in these conditions.
-----------------------------------------------------------------------------------
Squeeze Momentum \ Enabled \ This is inverted from standard SQZMOM. Gold's momentum often overshoots before reversing. By fading the extreme (longs when val < 0, shorts when val > 0), the strategy captures the reversal rather than chasing the continuation.
-----------------------------------------------------------------------------------
# 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 on OANDA, 1 tick = $0.001** per ounce (3 decimal places). 4 ticks = **$0.004 per ounce. Adjust this value if your broker quotes XAUUSD with different decimal precision (e.g., 2 decimal = $0.01 per tick).
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."
-------------------------------------------------------------------
📊 Chart Display
Channel – Upper/Lower bands with a semi‑transparent fill (red zone), representing the value area
EMA Lower TF – Green EMA on the lower timeframe for confirmation
HTF EMA Filter – Red EMA line showing the additional trend filter (plotted on all timeframes ≤ its TF)
Info Table – Shows Market Status, EMA confirmations, Channel Width, Engulfing ranges, SL settings,
Filters, No‑Trade Window status, Session Close status
Signal Arrows – Green arrow pointing up (below bar) for Long entries, Red arrow pointing down (above bar) for Short entries
Historical Trades – Configurable number of past trades to display on the chart (default: 111, max: 125). Adjust this to optimize chart performance while keeping sufficient trade history for visual analysis.
Reset Signal – Arrow marker (grey) indicating when the trade counter resets at session starts (Asia, London, New York for TF ≤ 15m, or daily for larger TFs)
Background Colors – red for No‑Trade Window, Gray/White for Session Close
UI Note
# When you adjust any setting in the Inputs tab (Channel Width, Engulfing Min/Max, Previous Range, SL Buffer, etc.), the values displayed in the info table update automatically in real‑time.
This allows you to:
- See the impact of your changes immediately
- Verify the actual dollar values of your settings at current price levels
- Fine‑tune parameters without switching between tabs
Example: If you change the Channel Width from 0.35% to 0.50%, the info table will instantly show the new width in dollars (e.g., $8.50 → $12.00).
# Inputs are hidden from the status line to keep the chart clean. All settings (zones, EMAs, risk, patterns) remain fully adjustable in Settings → Inputs tab.
-------------------------------------------------------------------
📌 In Summary:
This is not a random collection of indicators.
- The HTF EMA Channel provides the structural context – a dynamic value area that adapts to volatility.
- The Engulfing/Pin Bar patterns provide the high‑conviction trigger – exhaustion confirmation.
- The EMA Override provides the institutional edge – capturing liquidity grabs that standard EMA‑based strategies miss.
- The Optional Filters provide the quality control – reducing false signals.
- The Risk Management provides the survivability – realistic position sizing and stops.
Each component exists specifically to compensate for a flaw in the others. This interdependency is what makes the strategy original, robust,
Author: Awab_Hassan
Strategie
