Stopping Volume EMA RetraceStopping Volume EMA Retrace is designed to identify potential retracement setups when price becomes significantly extended away from an exponential moving average and the extended candle also shows unusually high volume together with rejection.
The indicator combines price extension, relative volume and candle structure for one specific purpose.
Price distance identifies when the market has moved unusually far from its mean.
Relative volume identifies unusually high participation at that extended location.
Wick structure and closing position are then used to filter for rejection-style candles rather than ordinary high-volume continuation candles.
HOW IT WORKS
The EMA acts as the mean and retracement reference.
The default EMA length is 50, but this can be changed by the user.
Upper and lower extension levels are calculated as a percentage distance from the EMA.
The default extension distance is 3%.
For a bullish setup, the candle low must reach or move below the lower extension level.
For a bearish setup, the candle high must reach or move above the upper extension level.
The extension calculation deliberately uses the candle high or low rather than only the closing price.
This allows a candle to move beyond the selected threshold, reject the extended area and close back toward the EMA while still qualifying as a setup.
RELATIVE VOLUME
A qualifying candle must also show unusually high volume.
The Volume Average Length controls how many previous completed candles are used to establish the volume baseline.
The High Volume Multiplier determines how much larger the current candle's volume must be compared with that baseline.
With the default settings, the current candle must have at least 2.0 times the average volume of the previous 20 completed candles.
REJECTION STRUCTURE
High volume alone does not generate a signal.
For a bullish setup, the candle must contain a sufficiently large lower rejection wick and close sufficiently far away from its low.
For a bearish setup, the candle must contain a sufficiently large upper rejection wick and close sufficiently far away from its high.
The optional wick-dominance filter can additionally require the rejection wick to be larger than the wick on the opposite side of the candle.
The Minimum Rejection Wick setting controls the required wick size as a percentage of the complete candle range.
The Minimum Close Recovery setting controls how strongly the candle must recover away from the rejected extreme.
SIGNALS
A bullish signal requires all of the following conditions on the same candle:
Price reaches the selected distance below the EMA.
Volume exceeds the selected relative-volume threshold.
The candle shows the required lower-wick rejection.
The candle closes sufficiently far away from its low.
If wick dominance is enabled, the lower wick must also be larger than the upper wick.
A bearish signal uses the inverse conditions above the EMA.
Signals are confirmed only after the qualifying candle closes.
Historical signal markers are displayed on the candle where the confirmed condition occurred. They are not backplotted onto earlier candles.
WHY THESE CONDITIONS ARE COMBINED
Distance from an EMA by itself only identifies price extension.
High volume by itself cannot distinguish continuation from rejection.
A large wick by itself can occur without unusually high market participation.
Stopping Volume EMA Retrace therefore requires these conditions to occur together.
The EMA extension supplies location.
Relative volume supplies participation context.
The wick and closing-position filters supply rejection context.
The result is a focused OHLCV-based method for highlighting extended high-volume rejection candles that may precede a retracement toward the mean.
HOW TO USE
First watch for price approaching or moving beyond one of the EMA extension levels.
Then wait for a highlighted stopping-volume candle or signal marker.
A bullish signal indicates that qualifying high relative volume and rejection occurred while price was extended below the EMA.
A bearish signal indicates the corresponding condition while price was extended above the EMA.
The EMA can then be used as a visual mean or retracement reference.
It should not be treated as a guaranteed target.
The signal can be evaluated together with market structure, trend, support and resistance, liquidity context and the user's own risk management.
Different markets have different volatility and volume characteristics.
The EMA distance can therefore be adjusted to determine how far price must become extended before a setup is considered.
The volume multiplier can be increased to require more exceptional volume.
The rejection-wick and close-recovery settings can also be increased to make signals more selective.
VISUAL SETTINGS
The EMA, upper extension and lower extension lines can each be shown or hidden independently.
Each line has independent colour, thickness and line-style controls.
Solid, dashed and dotted line styles are available.
Optional glow effects are available for the EMA and both extension lines.
All glow effects are disabled by default.
Bullish and bearish stopping-volume candles can be highlighted independently.
The bullish and bearish candle colours are user adjustable.
Signal markers can also be shown or hidden and have their own independent colour controls.
ALERTS
Alert conditions are included for:
Bullish stopping-volume retrace signals.
Bearish stopping-volume retrace signals.
Either signal type.
Because signals require a confirmed candle, alerts based on these conditions become valid when the qualifying candle closes rather than while it is still forming.
LIMITATIONS
The stopping-volume classification used by this indicator is an OHLCV-based analytical heuristic.
It does not use order-book information, true bid/ask trade classification or direct measurements of executed order-flow absorption.
High relative volume together with rejection therefore does not prove that absorption occurred.
Reported volume can differ between exchanges, brokers and data feeds. The same settings may therefore produce different signals on different markets or venues.
The EMA and extension levels can move while the current realtime candle is forming.
Signal conditions themselves require the candle to close before confirmation.
The indicator does not calculate historical win rates, simulated trade outcomes or Strategy Tester results.
It does not model commissions, spread, slippage, liquidity, position sizing or trade execution.
A confirmed signal means that the configured extension, relative-volume and rejection conditions occurred. It does not imply that price will subsequently return to the EMA or that a trade will be profitable. مؤشر

Modern VWAP with BandsModern VWAP with Bands is an anchored Volume Weighted Average Price overlay designed to show how far price has moved from its current volume-weighted reference and highlight unusually extended conditions that may be relevant to mean-reversion analysis.
The indicator combines an anchored VWAP, five configurable deviation bands, distance-based candle coloring, outer-band reversion signals, configurable Target and Stop reference levels, and separate historical Bull and Bear signal-outcome tables.
WHAT THE INDICATOR CALCULATES
The Trading Style setting determines the VWAP anchor period and price source.
Intraday = Daily VWAP using HLC3.
Swing/Daily = Weekly VWAP using HL2.
Long-term = Monthly VWAP using Close.
The VWAP resets automatically when the selected Daily, Weekly or Monthly anchor changes.
Five upper and five lower deviation bands are calculated around VWAP.
When ATR Bands is enabled, each deviation level represents an ATR multiple.
When ATR Bands is disabled, each deviation level represents a percentage offset from VWAP.
This allows the band structure to adapt either to current volatility or to fixed percentage distance from the VWAP reference.
WHY THE COMPONENTS ARE COMBINED
VWAP provides the central volume-weighted reference.
The deviation bands measure progressively larger extensions away from that reference.
The candle-coloring system provides a visual representation of how extended price currently is.
The outer Dev 5 signal logic identifies occasions when price moves through the most extreme configured band.
The Bull and Bear tables then provide historical context showing how those signals resolved using the selected Target and Stop assumptions.
Together, these components provide a workflow for identifying the current VWAP reference, measuring extension, highlighting extreme movement, identifying outer-band events and reviewing their historical outcomes.
BAR COLOR DISTANCE
Bar Color Distance Mode controls how distance from VWAP is normalized.
ATR mode measures absolute distance from VWAP relative to ATR.
% VWAP mode calculates the absolute percentage distance from the VWAP itself:
Absolute distance from VWAP / VWAP × 100
For example, if VWAP is 100 and the selected price source is 102, the % VWAP distance is 2%.
Auto mode uses ATR normalization when ATR Bands is enabled and % VWAP normalization when percentage bands are being used.
This keeps the candle-color distance measurement aligned with the selected band methodology.
REVERSION SIGNALS
A Bull reversion signal occurs when the closing price crosses below the lower Dev 5 band.
A Bear reversion signal occurs when the closing price crosses above the upper Dev 5 band.
These signals identify extreme extensions from VWAP. They do not confirm that a reversal has already started and should not be interpreted as predictions that price must return to VWAP.
Require Outside Dev 5 can apply an additional extension requirement beyond the Dev 5 band before a signal is accepted.
Dev 5 Outside % controls how far beyond Dev 5 price must extend when this filter is enabled.
The optional Cool Off Period prevents another accepted signal for a selected number of bars after the previous signal.
Show Reversion Signals controls only the visibility of the Bull and Bear markers. The underlying signal calculations and historical outcome tracking continue to operate when the markers are hidden.
ENTRY, TARGET AND STOP
The reference entry for both Bull and Bear signals is the closing price of the signal candle.
Bull Stop is positioned below the Bull reference entry according to Bull Stop %.
Bear Stop is positioned above the Bear reference entry according to Bear Stop %.
Target Source can be set to User % or VWAP.
With User % selected, Bull Target % and Bear Target % determine the Target distance from the signal-bar close.
With VWAP selected, the Target is the VWAP value that existed when the signal occurred.
The VWAP Target is fixed at that signal-bar value. It does not continue moving as the VWAP changes on later candles.
The Target and Stop lines displayed on the chart use the same corresponding values used by the historical outcome tables.
HISTORICAL SIGNAL-OUTCOME TABLES
The Bull and Bear tables provide simplified historical signal-outcome statistics.
T = Target reached.
S = Stop reached.
The displayed percentage is the number of Target outcomes divided by the total number of resolved Target and Stop outcomes for that direction.
The percentage is an internal historical measurement produced by the indicator's predefined evaluation rules. It is not a probability, expected win rate, accuracy prediction or guarantee of future performance.
The reference entry is the close of the signal candle.
Target and Stop evaluation begins on the following candle. Price movement that occurred earlier within the signal candle is therefore not used to determine an outcome after an entry at that candle's close.
If both the Target and Stop are touched during the same later candle, OHLC data cannot determine which level occurred first. The script therefore records the event conservatively as a Stop outcome.
Only one unresolved Bull simulation and one unresolved Bear simulation can be active at the same time.
If another signal in the same direction occurs while that direction already has an unresolved event, it is not added as another independently scored table event.
When Ignore Open Trades on Reset is enabled, unresolved events are discarded when the selected VWAP anchor resets. They are not counted as either a Target or Stop outcome.
These tables are analytical summaries and are not TradingView Strategy Tester backtests.
HOW TO USE
Start by selecting the Trading Style that matches the VWAP reference you want to analyse.
Use Intraday for a Daily VWAP, Swing/Daily for a Weekly VWAP, or Long-term for a Monthly VWAP.
Choose whether the deviation structure should react to current volatility using ATR Bands or represent fixed percentage distances from VWAP.
The inner deviation bands show smaller extensions from VWAP while the outer bands represent progressively larger extensions.
Use the candle colors as a quick visual indication of the current distance from VWAP.
Bull signals identify closes crossing below the lower Dev 5 band.
Bear signals identify closes crossing above the upper Dev 5 band.
These are extreme-extension conditions rather than automatic trade instructions. They can be combined with the trader's own price structure, trend, momentum, support/resistance or other confirmation methods.
Require Outside Dev 5 can be enabled when a greater extension beyond the outer band is desired.
The Cool Off Period can reduce repeated signals when price repeatedly moves around the outer band.
The Bull and Bear tables can then be used to examine how historical signals resolved under the currently selected Target and Stop assumptions.
IMPORTANT SETTINGS
Trading Style controls the VWAP anchor and source.
ATR Bands selects ATR-based or percentage-based deviation bands.
ATR Length controls the volatility calculation used by ATR bands and ATR-normalized visual calculations.
Level 1 Dev through Level 5 Dev control the five distances around VWAP.
Bar Color Distance Mode selects ATR or % VWAP normalization for candle coloring.
Bar Color Contrast Power controls how quickly color intensity increases as price moves farther from VWAP.
Bar Color Outside Boost increases visual emphasis after the most extreme configured distance is exceeded.
Require Outside Dev 5 adds an additional extension filter to signal generation.
Cool Off Period controls the minimum spacing between accepted signals when enabled.
Target Source selects percentage-based Targets or the fixed VWAP value at the signal.
Bull Target %, Bull Stop %, Bear Target % and Bear Stop % define the assumptions used for the corresponding historical signal-outcome calculations.
SIGNAL TIMING AND REPAINTING
The script does not use future-data lookahead, higher-timeframe request.security calculations, pivot calculations or historical pivot backplotting.
Signals are calculated using the current chart candle.
Because the closing price of a live candle changes while that candle is forming, a Bull or Bear signal can appear and disappear before the candle closes.
Once the candle has closed, that historical signal condition is fixed.
The script does not place a confirmed signal retrospectively onto an earlier pivot candle.
LIMITATIONS
VWAP depends on the volume data supplied for the selected chart symbol. Volume can differ between exchanges, brokers and data feeds, so VWAP and its resulting bands may also differ.
The indicator uses chart OHLCV data. It does not use order-book data, bid/ask trade classification or individual transaction-level order flow.
ATR is a historical volatility calculation and responds to changing market conditions rather than predicting them.
Extreme distance from VWAP does not guarantee mean reversion. Price can continue moving farther away from VWAP after a Bull or Bear signal.
Live-candle conditions can change before the candle closes.
The Bull and Bear historical statistics do not model commissions, spread, slippage, execution delay, liquidity, partial fills, leverage, position sizing or true intrabar sequencing.
When both Target and Stop occur inside the same candle range, the actual sequence cannot be determined from OHLC data and the event is therefore classified as a Stop.
Unresolved simulations can be removed at VWAP anchor resets when Ignore Open Trades on Reset is enabled.
The pre-reset and post-reset fading effects are visual features based on the expected length of the selected anchor period. Markets with restricted sessions or gaps may contain a different number of actual chart bars.
Historical results do not imply future performance.
ORIGINAL FUNCTIONALITY
Modern VWAP with Bands is designed as more than a standard VWAP plot.
Its implementation integrates selectable Daily, Weekly and Monthly VWAP anchoring, five ATR-or-percentage deviation zones, VWAP-relative or ATR-normalized candle coloring, configurable extreme-band signal filtering, fixed VWAP-or-percentage Targets, configurable Stops, anchor-reset handling and separate Bull and Bear historical outcome tracking.
The purpose of combining these elements is to connect VWAP location, distance measurement, visual extension analysis, signal generation and historical signal evaluation within one consistent overlay.
مؤشر

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.
مؤشر

MarketMaulers Auto TrendlinesMarketMaulers Auto Trendlines draws the diagonal structure you would have drawn yourself, and then stays with the line through the part that matters. Two confirmed pivots anchor it, the market's own touches validate it, and its parallel rail is projected through the furthest price travelled while the line was forming. Then it waits for the break, and reports which of the only two things that can follow a break took place.
Forming · Validated · Broken · Retested / Failed break
THE RETEST IS THE PRODUCT
Anyone can draw a line through two pivots and print a marker when price closes through it. The break is the least informative moment in a trendline's life. Most lines break, and the break on its own says nothing about whether the level still matters.
Two things can follow, and they mean opposite things.
• RETEST. Price comes back and respects the line from the OTHER side. Old support is now resistance. The line survived its own break as a reference and is arguably more useful after it than before.
• FAILED BREAK. Price closes straight back on the original side. The break was noise, the line was never beaten, and anyone who traded the break is offside.
This tool waits for one of those and names it. That is the read you cannot get by eyeballing the chart in the moment, because in the moment the two look identical.
FROM ZERO: WHY A DIAGONAL LINE IS A DIFFERENT ANIMAL FROM A HORIZONTAL ONE
A horizontal level is a price. It sits at one number and it is still that number tomorrow. A trendline is a price AND a rate. It asks the market to keep making higher lows at a certain speed, or lower highs at a certain speed. That is a much stronger claim, which is why trendlines break more often than horizontal levels and why the break carries less information when they do.
It is also why a line has to be earned rather than drawn. Two points define any line at all. Three or more touches is the market repeatedly agreeing to the rate.
HOW A LINE EARNS ITS PLACE
Five gates, each closing a specific way auto-trendline scripts produce clutter.
• Confirmed pivots only, paired for direction. A rising support line needs a second swing low strictly HIGHER than the first, a falling resistance line a second high strictly lower. A zero slope is unreachable by construction, so this file never draws a horizontal line.
• A cleanliness scan. Every bar between the two anchors is checked for a close through the line. A line price has already spent time on the wrong side of was never a valid line, and drawing it anyway is how a chart fills with lines nobody would have drawn by hand.
• Touch counting with a spacing rule. A touch is a bar reaching within a quarter of an ATR of the line, and touches within three bars of each other count once. Without the spacing rule one slow drift along a line counts as five touches and validates anything.
• Near-duplicate rejection. Two lines are compared at two sample points, now and fifty bars back, and the newer one is dropped if they sit within 0.75 ATR at BOTH. Comparing at a single point lets two lines with different slopes look identical at the moment they cross.
• A slope cap and abandoned-line retirement. Near-vertical lines off a single spike are refused, and a line price has stayed far away from for twenty consecutive bars is retired. That is what keeps ancient support lines from hanging under current price forever.
TWO WAYS A LINE BREAKS, AND THE SECOND ONE IS THE INTERESTING ONE
The obvious break is distance: a close sitting at least 0.35 ATR beyond the line. That catches the decisive break and it misses the slow one.
Price can park a fraction through a line, too shallow to trigger the distance test and too close to trigger retirement, and grind there bar after bar. Under a distance-only rule the line stays marked VALIDATED with price on the wrong side of it for as long as the grind lasts, which is a tool stating something false. So three consecutive wrong-side closes break a line at any distance. Decisive breaks are caught by distance, grinds by persistence, and there is no state left where the display and the price disagree.
A RETESTED LINE GOES BACK TO WORK
Most implementations treat the retest as the end of a line's life, which is backwards from what the retest proves. A line that broke, was left alone, and then held from the other side has demonstrated it still matters, and the tools that go quiet there stop watching at the exact moment the line earned its keep.
The mechanism is a POLARITY FLIP rather than a new line. Old support becomes resistance, so the side the break test looks at flips while the line's geometric identity does not. It is still a rising line, it keeps its color and its channel offset, and it starts being tested for a break to the upside. The label carries R1, R2, R3 so a twice-proven line is visibly different from a fresh one, and the cycle is capped at three, after which retested is terminal. A line oscillating around price cannot churn forever.
The status card reports both facts rather than picking one. RISING · RES is a rising line currently acting as resistance. Unflipped lines read RISING · SUP and FALLING · RES, which is what they always meant, said out loud.
THE CHANNEL
Once a line is validated, its parallel rail is projected through the furthest the market travelled away from it while the line was forming. The rail comes from a real extreme rather than from a statistical fit, so the width means something specific: this is how far this structure has been willing to travel from its own floor. Fill and opacity are yours to set, and the fill carries the state, so there is no color legend to memorize.
CONVERGENCE, WITH A TIME
Two validated lines with different slopes meet at an apex, and an apex is a price AND a bar. That is a triangle or a wedge resolving, one of the oldest readable objects in chart reading. It needs both lines retained as DATA rather than as drawings, which is why most auto-trendline scripts cannot offer it at all.
It is reported on the card and alerted, not drawn. A marker painted into future bars would say the same thing and add a drawing to a chart whose whole design rule is fewer marks. And it is a fact, not a forecast: it says where and when the structure runs out of room, not what happens when it gets there.
HIGHER TIMEFRAME LINES
A second engine, off by default, sharing the concepts of the chart-timeframe engine and none of its code paths. If the higher-timeframe layer is wrong, the layer you already trust keeps working.
Why most higher-timeframe trendline overlays are unsound is worth stating. A security call hands back prices. It does not hand back the ability to walk backwards through higher-timeframe bars, and the cleanliness scan IS a walk. So an HTF line built off a plain security read cannot be validated the way a chart line is, and most implementations quietly skip the check. Here, completed higher-timeframe bars are pushed into a ring buffer as they close and the whole HTF engine walks those. A real scan, real HTF touches, and a break that is a real HTF close through the line.
Breaks are judged by the timeframe that OWNS the line. A 15m candle closing through a 4H trendline is not a 4H close, and treating it as one is the most common way an HTF overlay lies. The visible consequence is that an HTF line can die up to one HTF bar later than the chart makes it look like it should. That is correct, and it will look wrong the first time.
What the HTF layer deliberately does not do, each one a decision rather than an omission: no channel, no polarity flip, no apex participation, and no separate alerts. The rail is measured by the same pass that validates the chart line. Converging HTF and chart slopes needs a unit conversion that is wrong the moment the chart timeframe changes. And two engines firing the same alert would double every notification. One slot, defaulted off, because new surface gets proven before it gets duplicated.
THE STATUS CARD
Six live lines on a chart and no way to tell which one matters this bar. The card names the nearest line, the distance to it in points and in ATR, its geometry and its current role, how many broken lines are still awaiting a verdict, and the soonest apex. A table rather than a label, because a label draws inside the price pane and loses the z-order fight with candles.
ALERTS
Trendline validated · Trendline broken · Trendline retest confirmed · Failed trendline break · Trendline convergence approaching
The convergence alert is the one worth leaving on. The other four report something that has already finished, which is useful for a journal. Convergence is the one thing the tool knows about the future, so it is the one alert that can reach you while there is still something to do about it. It is edge-triggered: it arms while the apex is beyond your warning distance and fires once on the way in, rather than firing every bar of the approach until you mute it forever.
WHY IT DOES NOT REPAINT
Lines anchor on confirmed pivots only, and a pivot is not known until the required bars have closed after it. Every state change is judged on a closed bar. The chart-timeframe engine contains no security call at all, and the higher-timeframe engine reads only completed HTF bars, never the one in progress, using the last-closed idiom with an atomic tuple so high, low, close and time cannot straddle a boundary. The cost is a deliberate lag of a few bars on every anchor, and that lag is the guarantee.
WHAT THIS TOOL IS NOT
It draws structure. It shades no band, marks no zone, and makes no claim about resting orders anywhere. When a broken line is reclaimed, this tool calls it a FAILED BREAK, which is a statement about structure and is what the price action supports on its own. A liquidity tool looking at the same bar would call it a sweep, which is a statement about order flow. Same behavior, different claim, and only one of them is visible on the chart.
MADE TO FIT YOUR CHART
Eight card positions, three text sizes, separate colors for rising and falling lines and for their higher-timeframe counterparts, line width, channel fill and opacity, labels on or off, and a toggle per section. Detection, channel, break and retest, style, higher timeframe, card and alerts are separate groups. Pivot length, minimum touches, maximum active lines, the slope cap, the retirement distance, the retest confirmation mode and the retest window are all exposed.
HOW TRADERS ACTUALLY USE IT
Pivot Length decides everything downstream, because it decides which swings exist to be paired. If the chart looks emptier than you expect, that is the first knob, ahead of the touch count.
Minimum touches is the honesty dial. Two touches is a line you drew. Three is a line the market drew. Three is the default for that reason.
Treat a break as the question and the following bars as the answer. Wait for RETESTED or FAILED before deciding what the break meant. The whole tool is built so you do not have to guess which one you are sitting in.
Works on any market and any timeframe.
Display only. This draws structure and reports what happened to it, it does not fire buy/sell signals and it does not forecast. Educational tool, not financial advice.
Published open-source. The pivot pairing and cleanliness scan, the near-duplicate rejection, the two-mode break test, the polarity-flip lifecycle, the apex pre-filter and the higher-timeframe ring buffer are all readable in the source. Everything above explains what it draws and how it decides what to draw; the code is there so you can check that the description is accurate rather than take it on faith. Read it, fork it, argue with the constants. مؤشر

Apollo Wave X-LunarApollo Wave X-Lunar
Apollo Wave X-Lunar is a momentum and directional indicator based on the movement and slope of three independent waves: F1, XA, and AK. Each source uses a different price calculation to provide complementary readings of market movement.
The indicator displays three “lights” on the panel:
▲ Lime: wave slope is equal to or above zero, indicating upward momentum.
▼ Orange: wave slope is below zero, indicating downward momentum.
In addition to the lights, the indicator displays a Wave Line whose source can be selected by the user.
⚙️ Parameters
Base Period — len
Defines the period used to filter the waves.
Lower periods: higher sensitivity to price changes and more frequent directional changes.
Higher periods: greater smoothing and lower sensitivity to short-term fluctuations.
The default value is 21.
There is no universally optimal period. The appropriate setting may vary depending on the asset, timeframe, and trading style.
Line Source — lineSource
Selects which of the three sources is used to construct the main chart line.
F1 — HLCC4
Uses the average of High, Low, and twice the Close.
XA — HLC3
Uses the average of High, Low, and Close.
AK — OHLC4
Uses the average of Open, High, Low, and Close.
The three sources are calculated independently for the lights. This parameter only changes the Wave Line displayed on the chart.
📊 How to Interpret
The indicator compares the current wave movement with its previous slope.
▲ F1
Shows the slope direction of the wave based on HLCC4.
▲ XA
Shows the slope direction of the wave based on HLC3.
▲ AK
Shows the slope direction of the wave based on OHLC4.
When all three lights point upward simultaneously, there is greater directional agreement between the three price sources. When all three point downward, there is greater agreement toward the downside.
Differences between the lights may indicate that the different price sources are producing different momentum readings.
🌊 Wave Line
The main line uses the source selected under Line Source.
F1: HLCC4
XA: HLC3
AK: OHLC4
The line color follows its slope:
Lime: positive or neutral slope.
Orange: negative slope.
🔧 Suggested Configuration
The default value of 21 can be used as a starting point.
For a faster reading, try lower periods.
For a smoother reading, try higher periods.
The appropriate configuration should be evaluated according to the asset and timeframe being analyzed. It is recommended to test different settings before using the indicator as part of trading decisions.
⚠️ Disclaimer
Apollo Wave X-Lunar is a technical analysis tool and does not constitute investment advice, an offer, or a guarantee of results.
The indicator's signals and readings should be used together with other analysis tools, risk management, and overall market context.
No technical indicator can guarantee future results. مؤشر

TEWMA Momentum Cloud - [JTCAPITAL]TEWMA Momentum Cloud - is a modified way to use dual-length Triple Exponential Weighted Moving Averages (TEWMA), momentum, and the rate of change of the TEWMA spread for Trend-Following and trend-state analysis.
The indicator is designed to do more than simply determine whether price is above or below a moving average. It compares two differently scaled TEWMA calculations to determine the current directional bias, while simultaneously measuring whether the distance between the two TEWMAs is expanding or contracting.
This creates four primary trend states:
* Bullish + Accelerating — the faster TEWMA is above the slower TEWMA and the difference between them is increasing.
* Bullish + Decelerating — the faster TEWMA remains above the slower TEWMA, but the difference between them is decreasing.
* Bearish + Accelerating — the faster TEWMA is below the slower TEWMA and the difference between them is becoming more negative.
* Bearish + Decelerating — the faster TEWMA remains below the slower TEWMA, but the difference between them is becoming less negative.
A fifth state, Neutral / Flattening , is used when the directional relationship between the two TEWMAs remains bullish or bearish, but the averaged TEWMA is moving in the opposite direction. This helps identify situations where the prevailing directional structure is losing momentum.
The result is a visual trend cloud in which the color of the TEWMA lines changes according to both direction and momentum expansion or contraction .
The indicator works by calculating in the following steps:
Selecting the Price Source
The script begins with a user-selected price source. By default, the source is the Close price.
This source is then used as the raw input for both TEWMA calculations. Because the two TEWMAs use the same source but different lengths, the difference between them primarily reflects the way the market is behaving across two different smoothing horizons.
Determining the Second TEWMA Length
The user specifies the primary Length , which defaults to 50.
The second length is dynamically derived from this value using the Multiplier :
Second Length = Length x Multiplier
The result is rounded to the nearest whole number because moving-average lengths must be represented as integer values.
With the default settings:
50 x 2.50 = 125
Therefore, the two TEWMA calculations use lengths of 50 and 125.
This creates a faster and slower version of the same underlying smoothing methodology. The shorter TEWMA reacts more quickly to changes in price, while the longer TEWMA provides a slower representation of the broader price direction.
Weighted Moving Average Calculation
Before the TEMA calculation is applied, the selected source is first processed through a Weighted Moving Average (WMA) .
The WMA assigns greater importance to more recent observations within its calculation period and progressively less importance to older observations.
This makes the resulting moving average more responsive to recent price changes than a conventional SMA.
The script performs this process separately for both lengths:
WMA(source, Length)
and
WMA(source, Second Length)
The resulting WMA series are then passed into the TEMA calculations.
Triple Exponential Moving Average Calculation
The WMA output is then processed through a Triple Exponential Moving Average (TEMA) .
TEMA is designed to reduce the lag that can occur when repeatedly smoothing a data series.
Conceptually, TEMA uses three levels of exponential smoothing and combines them in a way that reduces a substantial portion of the lag introduced by traditional moving averages.
The general TEMA structure can be represented as:
TEMA = 3 x EMA1 - 3 x EMA2 + EMA3
where EMA1 is the first exponential smoothing, EMA2 is an EMA of EMA1, and EMA3 is an EMA of EMA2.
In this script, TEMA is applied to the WMA rather than directly to price.
This produces:
TEWMA1 = TEMA(WMA(source, Length), Length)
and
TEWMA2 = TEMA(WMA(source, Second Length), Second Length)
The combination of WMA followed by TEMA is what gives the indicator its TEWMA construction.
The purpose of combining these smoothing methods is to create a trend representation that remains substantially smoother than raw price while retaining responsiveness to directional changes.
Creating the Average TEWMA
The two TEWMA calculations are then averaged:
TEWMA = (TEWMA1 + TEWMA2) / 2
This average represents the central line of the indicator.
Instead of relying exclusively on either the faster or slower TEWMA, the average provides a combined representation of both time horizons.
This can make the central trend representation less dependent on one specific smoothing length.
Calculating TEWMA Momentum / Spread
The script then calculates the difference between the two TEWMA values:
Momentum = TEWMA1 - TEWMA2
This is one of the most important calculations in the indicator.
The value is positive when TEWMA1 is above TEWMA2 and negative when TEWMA1 is below TEWMA2.
However, the script does not only look at whether this value is positive or negative. It also compares the current value with its previous value.
Therefore, the indicator is effectively examining the direction and rate of change of the spread between the two TEWMAs .
Detecting Bullish Acceleration
Bullish acceleration occurs when:
TEWMA1 > TEWMA2
and
Momentum > Momentum
The first condition establishes that the faster TEWMA is above the slower TEWMA.
The second condition establishes that the difference between the two TEWMAs is increasing.
Therefore, bullish acceleration means that the bullish separation between the two trend filters is expanding.
This is represented by Signal = 2 .
Detecting Bullish Deceleration
Bullish deceleration occurs when:
TEWMA1 > TEWMA2
and
Momentum < Momentum
The faster TEWMA is still above the slower TEWMA, so the overall directional relationship remains bullish.
However, the spread between the two TEWMAs is shrinking.
This means the bullish structure is becoming less expansive, even though the bullish relationship between the two trend measurements has not necessarily disappeared.
This is represented by Signal = 1 .
Detecting Bearish Acceleration
Bearish acceleration occurs when:
TEWMA1 < TEWMA2
and
Momentum < Momentum
The faster TEWMA is below the slower TEWMA, establishing a bearish relationship.
At the same time, the momentum difference is becoming increasingly negative.
Therefore, the separation between the two TEWMAs is expanding in the bearish direction.
This is represented by Signal = -2 .
Detecting Bearish Deceleration
Bearish deceleration occurs when:
TEWMA1 < TEWMA2
and
Momentum > Momentum
The faster TEWMA remains below the slower TEWMA, so the broader directional relationship remains bearish.
However, the difference between the two TEWMAs is becoming less negative.
This means the bearish separation is contracting.
This is represented by Signal = -1 .
Detecting Neutral / Flattening Conditions
The neutral condition is different from simply checking whether the two TEWMAs have crossed.
The script checks whether the directional relationship between TEWMA1 and TEWMA2 conflicts with the movement of their average.
A neutral state occurs when either:
TEWMA1 > TEWMA2 while TEWMA is falling
or
TEWMA1 < TEWMA2 while TEWMA is rising .
In other words, the two TEWMAs may still maintain a bullish or bearish relationship, but the combined TEWMA is beginning to move in the opposite direction.
This provides an additional way of identifying a loss of directional momentum before relying solely on a crossover.
The neutral state is represented by Signal = 0 .
Assigning the Persistent Trend State
The script stores the current signal state in a persistent variable.
The possible states are:
2 = Bullish + Accelerating
1 = Bullish + Decelerating
-1 = Bearish + Decelerating
-2 = Bearish + Accelerating
0 = Neutral / Flattening
Because the signal variable is persistent, it retains its previous value when none of the explicitly defined conditions changes the state.
This means the indicator is not simply recalculating an independent label on every bar; it maintains the latest identified trend state until another condition updates it.
Assigning the Visual Trend Color
The signal state determines the color used by the plotted TEWMA lines.
Bullish acceleration receives one color, bullish deceleration another, bearish acceleration another, bearish deceleration another, and neutral conditions receive a separate neutral color.
The visual distinction therefore communicates two dimensions simultaneously:
1. Direction — bullish or bearish
2. Momentum behavior — accelerating or decelerating
This allows the user to distinguish between a bullish trend that is strengthening and a bullish trend that is losing expansion, rather than treating both situations as identical.
Plotting the Central TEWMA
The averaged TEWMA is plotted as the primary, thicker line.
This line represents the combined trend estimate derived from the faster and slower TEWMA calculations.
Its color changes according to the current signal state.
Creating the Visual Cloud
The script creates an additional hidden plot at:
TEWMA x 0.9
and fills the area between the primary TEWMA and this lower reference level.
The same visual technique is also applied to TEWMA1 and TEWMA2.
These fills create the visual cloud/ribbon appearance of the indicator.
It is important to understand that these filled regions are primarily visual enhancements . They are not additional volatility bands, standard-deviation bands, ATR bands, or independent support/resistance calculations.
The 0.9 multiplier simply places the second boundary at 90% of the corresponding TEWMA value, creating a proportional visual area beneath the plotted line.
Plotting the Fast and Slow TEWMA
In addition to the averaged TEWMA, the script plots TEWMA1 and TEWMA2 individually.
TEWMA1 uses the shorter user-defined length and therefore represents the faster component.
TEWMA2 uses the multiplied length and therefore represents the slower component.
Viewing both lines allows the user to see the underlying relationship that produces the momentum classification.
Optional State-Change Labels
The script contains an optional Show Labels setting.
When enabled, labels are displayed when the signal changes from its previous state.
The available label descriptions are:
Rising + Widening
Rising + Compressing
Falling + Widening
Falling + Compressing
Flattening
The labels are only created when the current signal is different from the previous signal. This prevents a new label from being printed on every bar while the same state remains active.
The labels therefore focus attention on state transitions rather than continuously repeating the same information.
Buy and Sell Conditions:
This indicator does not contain conventional buy or sell conditions, strategy orders, entries, exits, or backtesting logic.
Instead, it identifies trend states .
The bullish states are:
* Bullish + Accelerating — TEWMA1 is above TEWMA2 and the TEWMA spread is increasing.
* Bullish + Decelerating — TEWMA1 is above TEWMA2 and the TEWMA spread is decreasing.
The bearish states are:
* Bearish + Accelerating — TEWMA1 is below TEWMA2 and the TEWMA spread is becoming more negative.
* Bearish + Decelerating — TEWMA1 is below TEWMA2 and the TEWMA spread is becoming less negative.
The neutral state occurs when the averaged TEWMA moves against the current directional relationship between TEWMA1 and TEWMA2.
This distinction is important because a decelerating trend is not automatically a reversal . For example, a bullish trend can begin compressing while remaining bullish. Likewise, a bearish trend can begin compressing while remaining bearish.
Users can therefore interpret the states according to their own trading methodology. For example, an external trading approach could use bullish acceleration as a trend-confirmation condition, while treating bullish deceleration as a warning that momentum is becoming less expansive. However, the indicator itself does not impose entries, exits, stop-losses, take-profits, or position sizing.
The same principle applies to bearish conditions.
The indicator is therefore best understood as a trend and momentum-state visualization tool , rather than a complete trading strategy.
Features and Parameters:
Source — Selects the price series used as the foundation of both TEWMA calculations. The default is Close.
Length — Defines the primary length used by the faster TEWMA. The default value is 50.
Multiplier — Determines the relationship between the faster and slower TEWMA lengths. The default is 2.50.
Second TEWMA Length — Calculated automatically as Length multiplied by Multiplier and rounded to the nearest integer.
Show Labels — Enables or disables the optional state-transition labels displayed on the chart.
Dual TEWMA Structure — Uses two differently scaled TEWMA calculations to compare shorter-term and longer-term trend behavior.
Momentum Spread — Measures the difference between the fast and slow TEWMA.
Acceleration / Deceleration Detection — Determines whether the TEWMA spread is expanding or contracting.
Five-State Classification — Separates the market into bullish acceleration, bullish deceleration, bearish acceleration, bearish deceleration, and neutral/flattening conditions.
Dynamic Color Coding — Changes the plotted line colors according to the current trend state.
Visual Cloud — Adds proportional filled regions around the plotted TEWMA lines to improve visual trend identification.
Specifications:
Price Source
The price source is the raw market data supplied to the indicator.
The default source is Close , meaning each calculation begins with the closing price of every bar.
The script allows TradingView's standard source selector to be used, so the calculation can be based on another available price series if desired.
The selected source is important because every subsequent calculation is derived from it.
Weighted Moving Average (WMA)
A Weighted Moving Average is a moving average that assigns different weights to observations within its calculation window.
More recent observations receive greater weight than older observations.
Compared with an SMA, this allows the WMA to react more strongly to recent price changes.
In this indicator, the WMA is not the final trend line. It is the first smoothing stage before the TEMA calculation.
This creates a two-stage smoothing structure in which the price data is first weighted toward recent observations and then processed through the TEMA.
Triple Exponential Moving Average (TEMA)
TEMA is a moving-average construction that uses three levels of exponential smoothing.
The purpose is to reduce lag compared with simply applying multiple layers of conventional exponential smoothing.
Its conceptual formula is:
TEMA = 3 x EMA1 - 3 x EMA2 + EMA3
where:
EMA1 = EMA(source)
EMA2 = EMA(EMA1)
EMA3 = EMA(EMA2)
The resulting TEMA attempts to retain smoothness while responding more quickly to changes than a heavily smoothed conventional moving average.
TEWMA
The TEWMA used by this indicator can be understood as a WMA-preprocessed TEMA .
Instead of applying TEMA directly to price, the script first calculates a WMA and then applies TEMA to that WMA.
This combines the weighting characteristics of WMA with the lag-reduction characteristics of TEMA.
The script creates two versions of this construction with different lengths.
Fast TEWMA — TEWMA1
TEWMA1 is calculated using the primary user-defined length.
With the default settings:
TEWMA1 = TEMA(WMA(Close, 50), 50)
Because the length is shorter, this component reacts more quickly to changes in the source than TEWMA2.
It therefore serves as the faster component of the trend comparison.
Slow TEWMA — TEWMA2
TEWMA2 uses the automatically calculated second length.
With the default settings:
50 x 2.50 = 125
Therefore:
TEWMA2 = TEMA(WMA(Close, 125), 125)
The larger length causes this component to respond more slowly to changes in the source.
It therefore represents the slower trend component.
Length Multiplier
The multiplier controls how far apart the two TEWMA horizons are.
The formula is:
Second Length = round(Length x Multiplier)
A larger multiplier creates a greater difference between the fast and slow calculations.
A smaller multiplier brings the two calculations closer together.
This parameter therefore directly influences how sensitive the spread is to changes in market direction.
TEWMA Average
The central TEWMA is calculated as:
TEWMA = (TEWMA1 + TEWMA2) / 2
This creates a central representation of the two trend horizons.
Rather than selecting either the fast or slow calculation as the primary line, the indicator combines both into one average.
This can provide a more balanced representation of the underlying trend structure.
TEWMA Spread / Momentum
The indicator defines momentum as:
Momentum = TEWMA1 - TEWMA2
This is effectively the spread between the fast and slow trend measurements.
When the value is positive, the fast TEWMA is above the slow TEWMA.
When the value is negative, the fast TEWMA is below the slow TEWMA.
The absolute size of the spread also provides information about how far apart the two trend estimates have moved.
Most importantly, the script compares the current spread with the previous spread to determine whether that separation is expanding or contracting.
Widening Momentum
When the TEWMA spread increases in the direction of the prevailing trend, the two TEWMAs are moving farther apart.
During a bullish state, this means TEWMA1 is moving further above TEWMA2.
During a bearish state, this means TEWMA1 is moving further below TEWMA2.
The indicator refers to these conditions as acceleration because the directional separation between the two trend measurements is increasing.
Compressing Momentum
Compression occurs when the spread between the two TEWMAs becomes smaller.
During a bullish state, TEWMA1 can remain above TEWMA2 while moving closer to it.
During a bearish state, TEWMA1 can remain below TEWMA2 while moving closer to it.
This is why deceleration does not necessarily mean that the trend has already reversed.
It means that the separation supporting the current directional structure is becoming less pronounced.
Bullish Acceleration
Bullish acceleration requires:
TEWMA1 > TEWMA2
and:
TEWMA1 - TEWMA2 > previous(TEWMA1 - TEWMA2)
This combines directional positioning with expanding momentum.
The first condition identifies the direction.
The second condition identifies whether that directional separation is strengthening.
Bullish Deceleration
Bullish deceleration requires:
TEWMA1 > TEWMA2
and:
TEWMA1 - TEWMA2 < previous(TEWMA1 - TEWMA2)
The fast TEWMA is still above the slow TEWMA, but the spread is shrinking.
This identifies a bullish structure that is losing expansion.
Bearish Acceleration
Bearish acceleration requires:
TEWMA1 < TEWMA2
and:
TEWMA1 - TEWMA2 < previous(TEWMA1 - TEWMA2)
The spread is becoming increasingly negative.
This means the fast TEWMA is moving farther below the slow TEWMA, strengthening the bearish separation.
Bearish Deceleration
Bearish deceleration requires:
TEWMA1 < TEWMA2
and:
TEWMA1 - TEWMA2 > previous(TEWMA1 - TEWMA2)
The spread remains negative but is becoming less negative.
This means the bearish separation is contracting.
Neutral / Flattening
The neutral condition is designed to detect situations where the average TEWMA is moving against the existing fast/slow directional relationship.
For a bullish relationship, neutral occurs when:
TEWMA1 > TEWMA2
but:
TEWMA < TEWMA
For a bearish relationship, neutral occurs when:
TEWMA1 < TEWMA2
but:
TEWMA > TEWMA
This is useful because a market can remain structurally bullish or bearish according to the relationship between the two TEWMAs while the combined trend measure begins moving in the opposite direction.
The neutral state therefore represents a loss of alignment between directional structure and movement of the combined trend .
Signal States
The script converts the detected conditions into numerical states:
2 = Bullish Acceleration
1 = Bullish Deceleration
0 = Neutral / Flattening
-1 = Bearish Deceleration
-2 = Bearish Acceleration
These numerical values are used internally to determine the visual state of the indicator.
Persistent Signal Variable
The signal is stored in a persistent variable.
This means the current state can remain active across multiple bars until another condition changes it.
The script therefore does not require every bar to generate a completely new classification.
This is particularly useful for the visual presentation because a trend state can remain visible until a meaningful change in the underlying conditions occurs.
Color Coding
The indicator uses different colors for the five states.
The colors are not additional calculations and do not affect the mathematical output.
They are a visual encoding system designed to allow the user to recognize both directional bias and momentum behavior without having to inspect the numerical relationships manually.
Primary TEWMA Line
The averaged TEWMA is displayed as the main, thicker line.
Because it combines the fast and slow TEWMA, it acts as the central visual representation of the indicator's trend structure.
Fast and Slow TEWMA Lines
TEWMA1 and TEWMA2 are also plotted individually.
The difference between these two lines is fundamental to the indicator's state classification.
When they separate, the spread changes.
When they move closer together, the spread contracts.
Their relative position determines whether the market is classified as bullish or bearish, while the change in their separation determines whether that trend is accelerating or decelerating.
Cloud / Fill Calculation
The script creates hidden secondary plots using:
TEWMA x 0.9
TEWMA1 x 0.9
TEWMA2 x 0.9
The area between each original line and its corresponding 90% reference is then filled.
This creates the cloud-like visual appearance.
These fills should not be interpreted as statistical probability bands or volatility envelopes.
They are proportional visual regions derived directly from the corresponding TEWMA value.
Optional Labels
The label system is disabled by default.
When enabled, the script checks whether the current signal state differs from the previous signal state.
A label is then created only at the transition into the new state.
This makes the labels useful for visually identifying when the market changes from one momentum regime to another without placing repetitive labels on every bar.
No ATR or Standard Deviation Component
This indicator does not use ATR, standard deviation, Bollinger Bands, RSI, MACD, volume, or other conventional volatility/momentum indicators.
Its momentum classification comes specifically from the difference between two differently smoothed TEWMA calculations and the change in that difference over time .
This is an important part of the design because the indicator is intentionally focused on the relationship between two trend estimates rather than combining unrelated technical indicators.
Why Combine WMA and TEMA?
WMA and TEMA perform different roles within the calculation.
WMA gives greater emphasis to recent observations.
TEMA then applies a triple-exponential smoothing structure designed to reduce lag compared with repeated conventional smoothing.
Combining them creates a trend filter that attempts to balance smoothness and responsiveness .
The objective is not simply to make the moving average smoother. Excessive smoothing can make a trend indicator slow to react.
Instead, the construction uses multiple forms of smoothing while maintaining a relatively responsive relationship with recent price behavior.
Why Use Two TEWMAs Instead of One?
A single moving average can provide information about direction, but it does not directly provide the same contextual information about how the market behaves across different trend horizons.
Using two TEWMAs creates a relative comparison.
The shorter TEWMA reacts faster.
The longer TEWMA reacts more slowly.
When the faster calculation moves above the slower calculation, the short-term trend representation has moved ahead of the longer-term representation.
When it moves below it, the opposite relationship exists.
This relative structure is the foundation of the indicator's directional classification.
Why Measure the Spread Between Them?
Simply knowing that one moving average is above another can be insufficient.
A bullish relationship can exist while the two averages are rapidly separating, or while they are slowly moving back toward each other.
Those are materially different conditions.
The spread calculation captures this distinction.
An expanding spread indicates increasing separation between the two trend horizons.
A contracting spread indicates decreasing separation.
The indicator therefore adds a second layer of information to the basic fast-versus-slow relationship.
Why Separate Acceleration From Deceleration?
A trend does not necessarily change direction immediately when its momentum begins to weaken.
For example, TEWMA1 can remain above TEWMA2 while the spread starts contracting.
The market can therefore remain structurally bullish while the bullish separation is losing strength.
Likewise, a bearish trend can remain structurally bearish while the bearish separation begins to contract.
Separating acceleration and deceleration allows the indicator to communicate this transition instead of treating every bullish or bearish condition equally.
Why Include a Neutral / Flattening State?
The neutral state provides another layer of information beyond the fast/slow relationship.
If TEWMA1 remains above TEWMA2 but the averaged TEWMA begins declining, the underlying directional relationship and the movement of the combined trend measure are no longer aligned.
The same principle applies in reverse during bearish conditions.
This gives the indicator a mechanism for visually highlighting situations in which the prevailing trend structure may be losing alignment.
How the Components Work Together
The indicator can therefore be viewed as a sequence of three major analytical layers:
Layer 1 — Trend Smoothing
The source is processed through WMA and TEMA to create two TEWMA trend estimates.
Layer 2 — Multi-Horizon Comparison
The faster TEWMA is compared with the slower TEWMA to establish the directional relationship.
Layer 3 — Momentum Expansion / Contraction
The difference between the two TEWMAs is monitored over time to determine whether the directional separation is widening or compressing.
The additional neutral logic then evaluates whether the average TEWMA is moving against the established fast/slow relationship.
This creates a compact framework that attempts to answer two related questions:
What is the current directional relationship?
and
Is that relationship becoming more expansive or less expansive?
How to Interpret the Indicator
Bullish + Accelerating
The faster TEWMA is above the slower TEWMA and the spread is expanding.
This is the strongest bullish state within the indicator's classification system because both directional positioning and spread expansion point in the same direction.
Bullish + Decelerating
The faster TEWMA remains above the slower TEWMA, but the spread is contracting.
The bullish structure remains present, but the separation between the two trend horizons is decreasing.
Bearish + Accelerating
The faster TEWMA is below the slower TEWMA and the spread is expanding negatively.
Both directional positioning and spread behavior are aligned with the bearish side.
Bearish + Decelerating
The faster TEWMA remains below the slower TEWMA, but the bearish spread is contracting.
The bearish structure remains present, but the separation is becoming less pronounced.
Neutral / Flattening
The fast/slow relationship remains directional, but the averaged TEWMA is moving against that relationship.
This represents a loss of alignment and can be interpreted as a transition or weakening state rather than an automatic reversal.
Limitations and Important Considerations:
This indicator is a technical-analysis tool and does not predict future price movements.
It does not contain a strategy engine, position sizing, stop-loss calculation, take-profit calculation, risk management system, or backtesting logic.
The bullish and bearish states should therefore not automatically be interpreted as guaranteed entry or exit signals.
Moving averages are inherently derived from historical price data. Even though the WMA/TEMA construction is designed to remain responsive, the indicator can still react after a price movement has already begun.
The Length and Multiplier settings materially affect the behavior of the indicator. Shorter lengths generally make the calculations more responsive, while longer lengths generally make them slower and smoother.
The indicator does not use a volatility normalization mechanism. The TEWMA spread is measured directly in the price units of the underlying instrument.
The cloud fills are visual representations and should not be interpreted as probability bands, volatility bands, or statistically calculated support/resistance areas.
The neutral state does not guarantee that a reversal will occur. It identifies a specific loss of alignment between the directional TEWMA relationship and the movement of the averaged TEWMA.
Likewise, deceleration does not automatically mean that a trend is ending. It only indicates that the spread between the two TEWMAs is contracting according to the script's calculation.
Users should therefore interpret the indicator within the context of their broader market analysis and risk-management process.
Originality and Design Purpose
The distinctive element of this indicator is not simply the use of moving averages.
The script combines a WMA-preprocessed TEMA structure with two different time horizons and then uses the spread between those two TEWMAs as a momentum-state measurement .
Instead of producing only a binary bullish/bearish classification, the indicator separates directional conditions into acceleration and deceleration states.
This provides a more detailed visualization of the relationship between short-term and longer-term trend behavior.
The purpose of the design is therefore to make the changing relationship between two trend horizons easier to interpret visually, while keeping the underlying calculations focused specifically on TEWMA structure and its momentum spread.
Summary
TEWMA Momentum Cloud combines two differently scaled TEWMAs to create a multi-horizon view of trend direction.
The source is first processed through a Weighted Moving Average and then through a Triple Exponential Moving Average.
The resulting fast and slow TEWMAs are averaged to create the central TEWMA.
The difference between the fast and slow TEWMAs is then calculated as the momentum spread.
The sign of that spread determines the bullish or bearish relationship, while the change in the spread determines whether that relationship is accelerating or decelerating.
An additional neutral condition identifies situations where the averaged TEWMA moves against the prevailing fast/slow relationship.
The result is a five-state trend classification:
Bullish + Accelerating
Bullish + Decelerating
Neutral / Flattening
Bearish + Decelerating
Bearish + Accelerating
The visual cloud, line colors, and optional transition labels are then used to make these states easier to identify directly on the chart.
TEWMA Momentum Cloud is therefore designed as a trend-structure and momentum-state visualization tool , helping users distinguish not only between bullish and bearish conditions, but also between trends that are expanding and trends that are beginning to compress.
Enjoy! مؤشر

Pattern Atlas : Geometric Indicator [AxeAlgo]Pattern Atlas : Geometric Indicator
A chart-native scanner for 16 classical price-structure ("geometric") chart
patterns. It tracks confirmed swing pivots as they form and, when a run of
pivots satisfies the geometry of a known pattern and its breakout condition, it
marks the pattern on the chart with an outline box, an optional construction
skeleton, a measured-move target, and a labelled pin signal. It also keeps a
live status table of every pattern it knows.
All pattern-recognition logic lives in the companion Pine library
"Pattern Atlas : Geometric ". This script is the visualization and
alerting layer on top of it, so the detection rules stay in one place that can
be maintained and audited on their own.
Patterns detected
Reversal patterns: Head & Shoulders and its Inverse; Double Top and Double
Bottom; Triple Top and Triple Bottom; Rounding Top and Rounding Bottom; Diamond
Top and Diamond Bottom; Broadening Formation; and the V-Top / V-Bottom spike.
Continuation patterns: Ascending Triangle; Descending Triangle; Symmetrical
Triangle; Rising and Falling Wedge; Bull and Bear Flag; Bull and Bear Pennant;
Rectangle; and Cup & Handle with its Inverted form.
Structural patterns: Island Reversal and Bump-and-Run Reversal.
How it works
First, a rolling list of confirmed swing highs and lows is maintained. The
"Pivot left bars" and "Pivot right bars" inputs set how many bars on each side
of a candidate must be less extreme for it to count as a pivot. Higher values
give fewer, more significant pivots and a longer confirmation lag.
Next, each pattern function inspects the recent pivot sequence for its defining
shape together with the price move that confirms it. For example, Head &
Shoulders looks for three peaks with a lower-shoulder relationship and a close
back through the neckline; an Ascending Triangle looks for a flat resistance
base with a rising support line and a close through the base.
Each match reports its direction (bullish or bearish), the exact pivots it was
built from, a text description, a strength score, and a measured-move price
target.
Strength score
The strength score runs from 0 to 100 percent and measures how decisively price
broke through the pattern's confirmation level, relative to the pattern's own
price range. A higher score means a cleaner, more committed break.
Patterns defined by a single point, such as the Spike and the Island Reversal,
have no internal range to measure against and always score a neutral 50 percent.
The "Minimum pattern strength to show" input filters marginal matches off the
chart and out of the alerts.
Measured-move targets
The target is a classical projection: the pattern's own height added to or
subtracted from the breakout point, shown as a small price label. No ray is
drawn out to it.
Targets are not shown for the Spike, the Island Reversal, or the Bump-and-Run
Reversal, because those patterns have no reliable height to project from.
Repainting
Every box, line, target, and pin is drawn only on a closed bar. Each match is
gated so it appears, and alerts, only once, on the bar it is first confirmed.
Swing pivots are only known a number of bars after they occur, equal to
"Pivot right bars". That confirmation lag is structural to pivot-based analysis,
not repainting. Nothing already drawn is moved or removed on later bars.
What you see on the chart
A box outlines the full pivot span of each match, coloured by direction.
Construction lines draw a zig-zag through the exact pivots that built the
pattern. This is off by default.
Construction points place a small circle on each of those pivots. This is also
off by default.
A target label shows the measured-move price.
A pin signal is a thin stem with a glowing gem at its tip, placed below the bar
for a bullish match and above it for a bearish one. Hovering the gem shows the
full list of matches on that bar with their strength and targets.
The scanner table lists every pattern with a live status column. When a pattern
matches on the current bar the row shows its name and strength percent; when it
does not, the row shows a dash. Hovering any row shows that pattern's
description.
Inputs
Pivot Detection controls the left bars, right bars, and the maximum number of
pivots tracked.
The Reversal, Continuation, and Structural groups each have a master enable
switch plus one checkbox per pattern, so a whole category can be turned off in
one click.
Display controls the boxes, construction lines, construction points, targets,
and pin signals; the minimum strength filter; the table on/off, position, and
text size; and the bullish and bearish colours.
Watermark switches between a Dark and a Light theme.
Alerts
There is one alert condition per pattern, plus an "Any Bullish Chart Pattern"
and an "Any Bearish Chart Pattern" condition.
There is also a single dynamic alert() call that fires once per closed bar with
the full list of patterns found on that bar, along with their strength and
targets. Add it using the "Any alert() function call" option when creating the
alert.
Every alert condition is gated to confirmed bars in the code itself, so none of
them can fire from a still-forming bar regardless of the alert frequency chosen.
Notes
Chart-pattern recognition is inherently approximate. Treat matches as structured
context rather than mechanical trade signals, and confirm them with your own
analysis.
The indicator works best on liquid instruments and on timeframes where swings
are well defined. Very low timeframes produce noisy pivots.
This is not financial advice.
Dependency: Pattern Atlas : Geometric , a Pine library.
مؤشر

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. مؤشر

PyraTime True Trend Line (PTTL)PTTL builds a dynamic, vector-based geometric framework utilizing two extreme market pivots (A and B) and projects their mathematical structure forward in price and time. Because it processes its own internal OHLCV data array, it bypasses native TradingView history constraints, allowing historical vectors to act on live price action without breaking down.
Why This Works
Standard trend lines are notoriously subjective, often skewed by the user pulling lines to fit a narrative. PTTL removes user bias by hard-locking purely to mathematical extremes.
Furthermore, instead of relying on a generalized Volume Profile across the entire screen, PTTL isolates its Vector POC strictly within the A-B impulse leg. This explicitly traps the liquidity nodes associated only with the trend currently being analyzed, rather than mixing it with unrelated historical chop.
How This Works
The Core Buffer: The indicator continuously records high, low, close, and volume data into a 5,000-bar rolling array. This isolates the calculations from TradingView's visual history and prevents data from dropping out when zooming or scrolling.
Dynamic Geometry: In Auto mode, PTTL perpetually hunts for the most significant A and B pivots. Because this window is dynamic, historical structure migrates as stronger dominant highs/lows appear.
Harmonic Divisions: By treating the maximum price deviation from the true A-B line as a 100% boundary, the tool mathematically slices the resulting channel into exact geometric fractions (1/8, 1/3, 1/2, etc.) to highlight internal support/resistance nodes.
Time & Price Squaring (AB=CD): PTTL measures the span of the A-B impulse and demands that the Point C retracement validates within a strict time window. Once validated, it targets an identical price/time expansion (Target D), actively grading the setup as Pending, Success, or Failed based on real-time price intersection.
Settings Guide
Mode Selection: Choose between Auto (dynamically scanning) and Manual (locking Point A to a user-defined timestamp).
Manual — One-Click Anchor: Anchor Point A to a specific timestamp and price. Pivot B Search Window dictates how many bars forward the tool should scan before permanently locking Point B into place.
Auto Mode Settings: Adjust the Scan Window to define how many bars back the tool searches for major swings, and set a Minimum AB Span to ensure it doesn't anchor to microscopic, noisy swings.
Features & Visibility: Toggle overlays like the True Trend Line, Vector POC, Parallel Channel, and Reflection angle.
AB=CD Settings: Configure the time allowance for Point C to form. If Hide Failed Patterns is on, invalidated geometries clear immediately to keep the chart clean.
Projection Settings: Decide whether Time Cycles scale against the duration of the A-B leg (× AB duration) or project forward uniformly (Fixed bars).
Alert Triggers: Fire native TradingView alerts the moment price crosses the True Trend Line, the maximum-deviation Channel rail, or the isolated Vector POC. مؤشر

Opening Range Gap (ORG) [TH Trader]Opening Range Gap (ORG) Zones
This indicator maps the overnight gap between the prior session's settlement (16:14 NY close) and the regular session open (09:30 NY), then divides that range into Fibonacci-style levels so you can track how price interacts with the gap throughout the day.
How it works:
Anchors are captured via a minute-by-minute walk over 1-minute data on the chart's own symbol, so both the 16:14 settlement price and the 09:30 open are always caught precisely — regardless of your chart's timeframe or Extended Hours setting
The gap range is divided into customizable levels (0/Open, 12.5%, 25%, 37.5%, 50%/CE, 62.5%, 75%, 87.5%, 100%/Close), each individually toggleable with its own color
The midpoint (CE) is highlighted separately as it often acts as a key reference for gap-fill trades
A background box shades the full gap zone, and a label shows the gap size in both points and percentage
Tracks whether each ORG has been "filled" (price has traded back to the settlement price) — fill detection uses your chart's own bars, so toggling Extended Hours changes what counts as filled
Extension styles:
Cap at day end — zone freezes at the end of each session
Cap at time of day — zone freezes at a custom cutoff time
Extend all lines right — zones extend indefinitely
Extend unfilled ORGs — filled zones are removed from the chart, keeping only unfilled gaps visible (with an option to keep the most recent ORG visible even after it fills)
How to use it:
Use the gap size label to gauge overnight volatility relative to recent history
Watch how price reacts at each Fibonacci level within the gap, especially the 50% (CE) level, for potential support/resistance or gap-fill setups
Combine with the CME Overnight Range and Anchored VWAP for additional overnight-positioning context
Works on any intraday timeframe; disabled on Daily/Weekly/Monthly charts since the concept requires intraday anchors مؤشر

BBMA Trend & MomentumBBMA Trend & Momentum
The BBMA structure read as one running sequence rather than a handful of separate signals.
Most tools built on Bollinger Bands and moving averages draw the lines and leave the reading to
you. This one keeps a memory. It knows that momentum came first, that a reversal candle followed it, that the pullback target has already been reached, and it will not report the next step until the ones before it have happened. Each label on the chart is a position in that sequence, not an isolated condition that happened to be true.
Two of those steps are level touches rather than candle patterns, and they are treated
differently from the rest. That distinction is explained below and it matters.
THE LINES
Four families are drawn. Seven individual lines carry every rule in the script.
Bollinger Bands SMA 20 with deviation 2, giving Upper, Mid and Lower
LW MA on the HIGH weighted averages of the candle HIGH, drawn in the upper colour
LW MA on the LOW weighted averages of the candle LOW, drawn in the lower colour
EMA 50 on Close, drawn as a slower reference
The High averages sit above price and the Low averages below it, because of what they are
averaging. That is what forms the two bands the price runs between.
The seven lines every rule is written against are the three Bollinger Bands and the 5 and 10
period LW MAs on each side. Those four averages are drawn SOLID. Periods 6 to 9 are drawn DASHED, exist only to show the shape of the band, and sit on their own switch so you can take them off and see for yourself that nothing is calculated from them. Within each band the 5 sits nearer to price and the 10 further out.
The EMA 50 is drawn and nothing is measured from it either. It is there as background context for your own reading, and it can be switched off without changing a single label.
THE SEQUENCE
Upper and Lower name the band an event belongs to. Every rule below has an exact mirror on the other side, so only the Upper form is spelled out.
CSM - Candlestick Momentum
LW MA 5 High is above the Upper BB, and the candle CLOSES above LW MA 5 High.
The close is therefore beyond the outer band as well, without needing to be tested for it.
EX - Extreme
A CSM has already happened and its Extreme has not been taken yet. LW MA 5 High is still
outside the Upper BB, but a candle now CLOSES back below it. That candle must not reach down to LW MA 5 Low, LW MA 10 Low, or the Mid BB. Touching any one of the three disqualifies it. Exactly one Extreme belongs to one CSM. For another Extreme, a new CSM has to come first.
MTP - Mandatory Take Profit
After an Extreme, the first time price reaches LW MA 5 Low or LW MA 10 Low.
If a new CSM or a new MTM arrives before that touch, the MTP is cancelled and a fresh Extreme
has to form before it can be looked for again.
MLV - Market Volume Lost
After the MTP has been reached, a candle rises to the Upper BB but cannot CLOSE beyond it, and closes at or above the Mid BB. The band was tested and refused.
CSD - Candlestick Direction
A candle that opens on one side of the Mid BB and CLOSES through it, and in the same candle
closes beyond BOTH LW MA 5 and LW MA 10 on the side it broke into. An Upper CSD breaks upward through the Mid BB and both High averages; a Lower CSD breaks downward through the Mid BB and both Low averages. CSD is named by the direction it broke, not by which cycle it interrupted.
MTM - Momentum Push
After a CSM, price falls back below the Upper BB without ever CLOSING below the Mid BB, then
closes above the Upper BB again. That renewed push is the MTM candle. It is not itself a CSM,
which is what separates the two - and because it is not a CSM, it does not open the door to a
new Extreme either. It only clears whatever the previous CSM had left waiting.
RE - Re-Entry
The touch that follows CSM, MTM or CSD. An upper-band sequence looks for LW MA 5 Low or LW MA 10 Low; a lower-band sequence looks for LW MA 5 High or LW MA 10 High. Three kinds are marked separately, because they arrive from three different places:
CSM RE a pullback that was followed by a full CSM
MTM RE a pullback that was followed by an MTM push
CSD RE the pullback after a CSD
WHAT IS READ WHEN
This is the part worth being precise about.
CSM, EX, MLV, CSD and MTM are structure. They are decided on the CLOSE of a candle, and once
decided they never change.
MTP and RE are not patterns, they are level touches. A touch happens at the moment price reaches the level, not when the candle finishes, so both are read on the RUNNING candle. Waiting for the close would report the touch after the level had already been passed, which would describe something other than what happened.
When a running-candle label and a closing label land on the same bar, the running one is
removed and its text is folded into the closing label, so the two never sit on top of each other.
WHAT MAKES THIS DIFFERENT
1. It is a sequence, not a checklist.
An Extreme is not reported unless a CSM came first. An MTP is not looked for until an Extreme has been confirmed, and an MLV not until the MTP has been reached. The same candle shape means different things depending on what came before it, and the script keeps track of that.
2. A step can be cancelled, not only completed.
If momentum resumes with a new CSM or an MTM while an MTP is still waiting for its touch, that MTP is dropped. The market changed its mind, so the sequence restarts rather than reporting a target that no longer belongs to anything.
3. One Extreme per CSM.
An Extreme is the answer to a particular CSM, so it is reported once and then that CSM is spent.
Price can keep closing back inside the band for the next ten candles and none of them will be
called an Extreme. A new CSM has to arrive first. An MTM push does not substitute for one.
4. The Extreme test is deliberately narrow.
Closing back inside the band is not enough. The candle also has to stay clear of the opposite LW
MA 5 and 10 and of the Mid BB. A candle that reaches any of them has done more than fail at the edge, and it is not reported as an Extreme.
5. CSD is named by what it did.
A downward break through the Mid BB and both Low averages is a Lower CSD, wherever it happens to appear. Naming it after the cycle it interrupted would put the wrong word on the chart.
6. Touches are read as touches.
The two events that are levels rather than candle patterns are handled as levels, on the running candle, and the script says so plainly rather than pretending everything is close-based.
READING THE CHART
Each event prints a small label at the candle it belongs to. Upper-band events sit above the
candle, lower-band events below it, and where several land on the same candle they are stacked into one label instead of overlapping.
CSM momentum push beyond the outer band
MTM renewed push after a pullback
EX the reversal candle
MTP first touch of the opposite LW MA 5/10 after an Extreme
MLV the outer band tested and refused
CSD Mid BB and both same-side LW MAs broken together
CSM RE / MTM RE / CSD RE the re-entry touch, named after what preceded it
SETTINGS
Lines
- BB Period and BB Deviations for the Bollinger Bands.
- BB Shift: moves the drawn bands only. The values every rule is measured against are not
moved.
- LW MA 5 to 10 Low and LW MA 5 to 10 High: the twelve weighted average periods. Only 5 and 10 are used by any rule.
- EMA Period.
Pattern Types
- A switch for each of the seven: CSM, MTM, EX, MTP, MLV, CSD and RE.
Line Style
- Show LW MAs: the 5 and 10 period averages, the ones every rule is measured against.
- Show LW MA 6-9 Band: the four decorative periods on each side, on their own switch. Turning
them off is the quickest way to check the claim above - the chart gets simpler and not a single
label moves.
- Show or hide the Bollinger Bands and the EMA.
- Colours for the Bollinger Bands, the LW MA High band, the LW MA Low band and the EMA.
Labels
- Label Size.
ALERTS
Fourteen alert conditions, one for each event on each side:
CSM Upper / CSM Lower
MTM Upper / MTM Lower
EX Upper / EX Lower
MTP Upper / MTP Lower
MLV Upper / MLV Lower
CSD Upper / CSD Lower
Re-Entry Upper / Re-Entry Lower
The structural ones fire once per bar close. MTP and Re-Entry fire once per bar, because they are touches and are read on the running candle.
The same events are also sent through the alert function, so the "Any alert() function call"
alert type can deliver all of them through a single alert. Those messages name the exact
Re-Entry kind - CSM, MTM or CSD - which a fixed alert condition cannot.
REPAINTING
This script does not repaint.
CSM, MTM, EX, MLV and CSD are structure. They are evaluated only after a candle has fully closed and the state memory they drive is updated only on closes, so price moving inside an open candle cannot change the sequence.
MTP and Re-Entry are read on the running candle, and that deserves a straight answer rather than a disclaimer, because a label that can appear mid-candle usually can vanish mid-candle too. Here it cannot, and the reason is in the arithmetic of the level being watched.
A weighted average of the LOW gives the candle still forming a weight of one third at length 5,
and about one fifth at length 10. The running low of that candle falls three to five times faster
than the average it is being compared against. So the moment the low reaches the average, the gap between them can only keep closing. It can never reopen inside that candle. The high side is the exact mirror.
Which means:
- Once an MTP or Re-Entry label is drawn, it stays. It cannot un-touch before the candle closes.
- Reloading the chart gives the same result, because a closed candle is evaluated once using its
final low and high, and those are the most extreme values the candle ever had.
- The only thing that changes at the close is presentation: a running-candle label is folded into
the closing label for that bar so the two do not sit on top of each other. The event itself is
not re-decided.
When you create an alert, TradingView may show a caution banner saying the indicator can repaint.
That banner appears automatically for any script that uses the built in bar state variables, no
matter how they are used, because the platform cannot check the intent behind them. For the
structural alerts, choosing "Once Per Bar Close" is still recommended.
NOTES AND LIMITATIONS
- CSD is the strong form only: the Mid BB and BOTH same-side LW MAs have to be broken by the same candle. A Mid BB break on its own is not reported.
- An Extreme always needs a CSM before it. A reversal candle appearing without that history is
not an Extreme here, whatever it looks like.
- The 6, 7, 8 and 9 period LW MAs and the EMA 50 are drawn but never measured. Changing them, or hiding them, changes the picture and nothing else.
- BB Shift is visual only. Shifting the bands does not shift the rules.
- TradingView caps a script at 500 labels and the oldest are dropped once that cap is reached, so on a long history the earliest labels leave the chart.
- Detection is purely structural. It reports where each step of the sequence occurred and nothing more. It does not rank setups by quality, measure what happened next, or produce entries, targets or stops.
HOW TO USE IT
Read the labels in order rather than one at a time. A CSM on its own says momentum arrived. The same CSM followed by an Extreme says the move ran out of room. That Extreme followed by an MTP and then an MLV says the band was tested again and refused. Each label narrows what the previous one meant.
The two bands are the working area. Price spends most of its time between the LW MA High band and the LW MA Low band, and the Re-Entry marks are where it came back to one of them after a push.
A CSD is the point where the picture changes side. It is the only event in the set that breaks
the Mid BB and both same-side averages in one candle, and everything after it belongs to the new direction.
These are reference points, not entry signals on their own. Use them alongside your own analysis, your own entry method and proper risk management.
DISCLAIMER
This indicator is a pattern detection tool. It is not financial advice and it makes no claim
about profitability. Trading involves risk. Always apply your own analysis and risk management. مؤشر

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. مؤشر

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. مؤشر

Converging Triangles [The_lurker]🔻 CONVERGING TRIANGLES — المثلثات المتقاربة 🔺
No repaint. Nothing that appears ever moves, shifts, or disappears.
Converging Triangles identifies contracting price structures built from confirmed swing pivots: a falling resistance line and a rising support line that coexist in time and close on each other. It runs three independent scales at once, freezes each structure the moment it is identified, and reports the two boundary prices and the exact bar they were crossed.
🔶 1 — THE STRUCTURE
A converging triangle here is not a shape matched against a template. It is a state: two independently valid trendlines, alive at the same time, closing on each other.
Upper boundary — anchored on the two most recent confirmed swing highs, sloping down.
Lower boundary — anchored on the two most recent confirmed swing lows, sloping up.
Because the constraint is on the sign of each slope, the detected family covers symmetric triangles and the near-flat ascending and descending variants. Wedges, where both boundaries slope the same way, are excluded by construction and never appear.
🔶 2 — HOW A STRUCTURE IS ADMITTED
Each boundary must pass every test below, and both boundaries must pass simultaneously before a structure is drawn. One failed test drops the whole structure.
🔸 PER BOUNDARY — five conditions
Pivot confirmation — both anchors are swing points confirmed by "length" bars on each side.
Span — at least 3 bars between anchors, at most length × Max span.
Slope direction — the upper boundary must fall, the lower must rise.
Interior containment — no bar between the two anchors violates the line.
Forward containment — no bar from the second anchor to the present violates the line.
🔸 PER STRUCTURE — three conditions
Both sides live — neither boundary has been broken.
Time overlap — the two boundaries share a common bar range, so no line is drawn across a region where it has no anchors.
Convergence horizon — the projected intersection falls inside Min bars to apex … Max bars to apex.
🔒 Once admitted, the geometry is frozen. Anchor points and slopes never change for the life of that structure.
🔶 3 — READING THE DRAWING
Each boundary is drawn in two segments, and the difference is deliberate.
Solid segment — spans the boundary's own two anchors. This is measured containment, confirmed by the market.
Dotted segment — from the last anchor to the present bar. This is pure extrapolation.
You can always see where the confirmed part ends and the projected part begins.
A single fill binds the two boundaries into one object rather than two unrelated strokes. Its corners are the two starting anchors and the two current endpoints, so the left edge is a slant, not a vertical cut, and the wedge tip is filled.
🔸 COLOUR STATES
⚪ Forming — neutral grey. No directional claim is made before resolution.
🟢 Broken up — green. Lines and fill together.
🔴 Broken down — red. Lines and fill together.
The structure stays neutral for its entire life. Direction is asserted only after a break is confirmed at bar close.
🔶 4 — BREAK DETECTION
On every confirmed bar, the break source is compared against both boundaries at that bar.
If one boundary is violated, the structure resolves in that direction.
If a single bar violates both boundaries, resolution goes to the side with the larger excursion beyond its line.
The shape is then redrawn in the break colour and frozen at the break bar. It does not extend forward afterward.
🏷️ A break label is placed at the bar, carrying its layer letter and any tags that fired.
🔶 5 — THREE INDEPENDENT SCALES
📏 Large (21) · Mid (14) · Small (5)
Contraction is not a single event. A large structure can be narrowing while a small one narrows inside it, and each can resolve in the opposite direction to the other. That is information worth seeing, not a conflict to hide.
Each layer detects, tracks, and resolves independently. Break labels carry L, M, or S, so the scale is always identifiable. Any layer can be switched off.
🔶 6 — HISTORICAL ARCHIVE
🗂️ Optional, off by default.
When enabled, a resolved structure is not deleted but redrawn at a faded shade. Over time this builds a map of where previous contractions broke on that symbol, under a count cap you control, with oldest-first eviction.
The fade is a separate control: set it to zero and archived structures render identically to live ones.
A structure that expires at the apex without resolving is not archived, since there is no event in it to keep.
Archived structures carry no label. Their colour and position already carry the direction.
🔶 7 — INFORMATION PANEL
📋 Reports the nearest live structure, or the nearest recently resolved one if none is live.
Layer — Large / Mid / Small. Coloured by resolution direction once broken.
Upper — the exact upper boundary price, ready to place an order against.
Lower — the same for the lower boundary.
Width (ATR) — current width in ATR units. After a break it becomes "Width at break", measured against the ATR recorded at that same bar, so the number stays fixed for a frozen structure and does not drift as volatility changes.
Projected apex — bars until the two boundaries intersect. After a break it becomes "Since break".
Status — Active · Break pending at close · Broken up · Broken down.
⚠️ The status row alone reads the live bar. It can move between pending and active within a single bar as price crosses back and forth. That is a live readout, labelled as such, not a repaint. The drawn geometry does not move.
🔶 8 — BREAK TAGS
Two optional descriptive measurements, shown on the break bar when they occur.
📊 V — break-bar volume exceeded its moving average by the configured multiplier.
📐 E — break-bar true range exceeded ATR by the configured multiplier.
These describe what happened on that bar. They are not quality scores or confidence grades, and they do not filter anything.
🔶 9 — ALERTS
🔔 Pattern formed — a new structure is admitted.
🔔 Break up — upper boundary broken.
🔔 Break down — lower boundary broken.
🔔 Any resolution — either break.
All alerts fire once per bar close, never before.
🔶 10 — SETTINGS REFERENCE
The icons below match the group headers you see inside the indicator's settings window.
🔸 ⚙️ SETUP
Language — default English. Switching to Arabic changes the entire interface.
Log scale — default Off. Must be matched to your chart's scale manually. See section 12.
ATR length — default 14. Feeds the E tag, the demote distance, and the panel width reading.
🔸 📏 LAYERS
Large L — default On, length 21.
Mid M — default On, length 14.
Small S — default On, length 5.
🔸 🔎 DETECTION
Close-only pivots — default Off. Off anchors on highs and lows; On anchors on closes.
Break source — default Close. One switch governing three things at once: interior containment, forward containment, and break detection.
Max span (× length) — default 5. Ceiling on bars between a boundary's two anchors.
Min side overlap — default 0. Required shared bar range between the two boundaries.
Min bars to apex — default 2.
Max bars to apex — default 200.
🔸 🎨 APPEARANCE
Fill triangle — default On, transparency 78.
Line width 2, line transparency 15.
Colours — grey while forming, green for an upward break, red for a downward break.
🔸 🗂️ HISTORY AND LIFETIME
Keep as current (bars) — default 30. After this the structure is demoted to the archive, or deleted if the archive is off.
Demote beyond (ATR) — default 8.0. Measured against current ATR by design: the question is how far price is now, in today's volatility.
Show historical patterns — default Off.
Historical kept — default 12, a cap across all three layers combined.
Historical fade — default 30, added on top of line and fill transparency.
🔸 🏷️ LABELS
Show labels — default On, 2 kept.
Volume tag V — default On. MA 20, multiplier 1.5.
Range expansion E — default On. Multiplier 1.4.
🔸 📋 PANEL
Show panel — default On, positioned top right.
🔶 11 — ON ACCURACY
Two different things get called accuracy. Only one of them is claimed here.
✅ Structural accuracy is exact and independently verifiable. Every anchor is a confirmed pivot, never a guess. Every line satisfies its containment test at the bar it is drawn. Geometry closes at formation and is never recalculated. A break is settled by a single unambiguous test on a closed bar. Nothing is repainted, backfilled, or silently adjusted. Replay any chart and trace any element yourself.
❌ Predictive accuracy is not claimed. You will find no win rate here, no signal grade, and no price target.
The indicator tells you precisely where the boundaries are and precisely when they were crossed. What that is worth in your strategy, on your instrument, at your timeframe, is yours to determine and yours to risk.
🔶 12 — BEHAVIOUR TO UNDERSTAND BEFORE TRUSTING THE CHART
⚠️ Why a structure appears late. A pivot is not a pivot until its full confirmation bars have passed. That delay is the price of the promise in the first line: nothing appears before its time, and nothing that appears is taken back afterward.
⚠️ A wick may cross a line. By default, anchors sit on highs and lows while containment and break detection are tested on the close. A wick can pierce a boundary while the structure remains valid. Set Break source = Wick for a shape no wick ever touches, and expect noticeably fewer structures from that considerably stricter test.
⚠️ Log scale is manual. Pine cannot read your chart's scale setting. If your chart is logarithmic, enable Log scale. When the two disagree, the computed break level diverges from the drawn line: negligible on narrow structures, material on wide ones. The tell is visible on the chart itself, as the left fill edge separates from the boundary at the second anchor.
⚠️ Where anchors come from. Each boundary is built from the two most recent pivots on its own side. A line that would skip an intermediate pivot is outside the detection scope.
⚠️ Density. Three layers with a full archive weighs the chart down. Disable the layers you do not need, and use the archive cap and the fade to control it.
═════════════════════════════════════════════════════════════
⚠️ DISCLAIMER
═════════════════════════════════════════════════════════════
This indicator is for educational and analytical purposes only. It does not constitute financial, investment, or trading advice. Use it alongside your own strategy and risk management. Neither TradingView nor the developer is responsible for any financial decisions or losses.
═════════════════════════════════════════════════════════════
🔻 المثلثات المتقاربة — Converging Triangles 🔺
ما يظهر على الشارت لا يتحرك ولا ينزاح ولا يُسحب لاحقاً. لا إعادة رسم.
يبحث المؤشر عن حالة واحدة لا عن شكل: أن يجتمع خط مقاومة هابط مع خط دعم صاعد في الوقت نفسه، وأن يضيق ما بينهما شمعةً بعد شمعة. فإذا اجتمعا واستوفى كلٌّ منهما شروطه، رُسم النطاق وتجمّدت هندسته في اللحظة نفسها، فلا تتغيّر بعدها مهما فعل السعر.
🔶 أول ما ينبغي أن تعرفه
لأنه لا يبحث عن شكل يطابقه بقالب جاهز، فهو لا يفرض عليك تسمية. هو يعطيك حدّين بسعرين محدّدين، ويخبرك متى عُبر أحدهما بالضبط. أما ما تفعله بذلك فأنت وحدك.
الحد العلوي — مرسي على آخر قمتين مؤكَّدتين، هابط.
الحد السفلي — مرسي على آخر قاعين مؤكَّدين، صاعد.
ولأن الشرط على إشارة كل ميل، فالعائلة المكتشَفة تشمل المثلث المتماثل والنسخ شبه المستوية من الصاعد والهابط. أما الوتدان، حيث يميل الحدّان في اتجاه واحد، فمستبعدان بالبناء ولا يظهران أبداً.
ويعمل على ثلاثة مقاييس في وقت واحد، لكل مقياس نموذجه المستقل.
🔶 متى يُرسم النطاق؟
لا يُرسم شيء ما لم يستوفِ كل حد شروطه الخمسة، ثم يجتمع الحدّان معاً على ثلاثة شروط أخرى. وأي شرط يسقط يُسقط النموذج كله.
🔸 الحد الواحد — خمسة شروط
أن يقوم على محورين مؤكَّدين. والمحور لا يُعدّ مؤكَّداً إلا بعد أن تمرّ عليه شموع التأكيد كاملة على الجانبين.
أن تكون المسافة بين المحورين ثلاث شموع فأكثر، ولا تتجاوز الطول مضروباً في «أقصى مسافة».
أن يكون العلوي هابطاً والسفلي صاعداً.
ألا تخرق أي شمعة الخط في الفترة الواقعة بين المحورين.
ألا تخرقه أي شمعة من المحور الثاني إلى اللحظة الحالية.
🔸 الحدّان معاً — ثلاثة شروط
أن يكون كلاهما سليماً لم يُكسر.
أن يتعايشا على فترة زمنية مشتركة. وهذا الشرط يمنع أن يُرسم خط في منطقة لا محاور له فيها أصلاً.
أن يقع تقاطعهما المتوقَّع ضمن المدى الذي تحدّده بين «أدنى مسافة للرأس» و«أقصاها».
🔒 وبعد القبول تُغلق الهندسة نهائياً: المحاور ثابتة والميلان ثابتان، ولا شيء يُعاد حسابه.
🔶 كيف تقرأ ما تراه
لكل حد مقطعان، والفرق بينهما مقصود لا زخرفي:
المقطع الصلب يمتد بين محوري ذلك الحد، وهو ما تحقّق فعلاً واحتواه السوق.
المقطع المنقّط يمتد من المحور الأخير إلى الشمعة الحالية، وهو استقراء لا أكثر.
فأنت ترى في كل لحظة أين ينتهي المؤكَّد ويبدأ المتوقَّع.
وتربط بين الحدّين تعبئة واحدة تجعلهما كياناً واحداً لا خطّين منفصلين. وقد أُخذت أركانها من محورَي البداية الفعليين، ولذلك جاءت الحافة اليسرى مائلة يمتلئ عندها رأس الشكل، لا مقطوعة عمودياً.
🔸 واللون يحمل الحالة وحدها
⚪ رمادي محايد ما دام النطاق حيّاً. فلا اتجاه يُدّعى قبل أن يُحسم.
🟢 أخضر إذا حُسم بالخروج من الأعلى. الخطوط والتعبئة معاً.
🔴 أحمر إذا حُسم بالخروج من الأسفل. الخطوط والتعبئة معاً.
فالنطاق يبقى محايداً طوال حياته، ولا يُعلن الاتجاه إلا بعد أن تُغلق الشمعة خارج أحد الحدّين.
🔶 متى يُعدّ النطاق مكسوراً
عند إغلاق كل شمعة يُقاس السعر على الحدّين معاً.
فإن خرج من أحدهما حُسم النطاق في اتجاهه.
وقد تأتي شمعة عنيفة تخرج من الحدّين كليهما، وعندها يُحسم للجهة التي ابتعد عنها السعر أكثر.
ثم يُعاد رسم الشكل بلون الخروج ويُثبَّت عند شمعته، فلا يمتد بعدها إلى الأمام.
🏷️ وتوضع عندها تسمية تحمل حرف المقياس (L أو M أو S) ووسوم الشمعة إن تحقّقت.
🔶 لماذا ثلاثة مقاييس
📏 كبير 21 · متوسط 14 · صغير 5
لأن الانضغاط ليس حدثاً واحداً. فقد يضيق نطاق كبير بينما يضيق داخله نطاق صغير، ويخرج كلٌّ منهما في اتجاه مضاد للآخر. وهذا في نفسه معلومة تستحق أن تُرى، لا تعارضاً يجب إخفاؤه.
ولذلك تعمل الطبقات الثلاث باستقلال تام، ويحمل كل خروج حرف مقياسه فلا يختلط عليك من أين جاء. وتستطيع إطفاء أي طبقة لا تحتاجها.
🔶 النماذج السابقة
🗂️ خيار مطفأ افتراضياً.
إن شغّلته، لم يُمحَ النموذج بعد حسمه، بل بقي مرسوماً بدرجة خافتة. وبمرور الوقت تتكوّن لديك خريطة لمواضع الخروج السابقة على الرمز نفسه، بسقف عددي تحدّده أنت، ويُخلى الأقدم فالأقدم.
ودرجة الخفوت مستقلة بيدك: إن أنزلتها إلى الصفر صارت النماذج القديمة كالحيّة تماماً.
والنموذج الذي انتهى عمره دون خروج لا يدخل الأرشيف، إذ لا حدث فيه يُحفظ.
والنماذج المؤرشفة بلا تسميات، فلونها وموضعها يكفيان.
🔶 لوحة المعلومات
📋 تعرض اللوحة أقرب نطاق حيّ إليك، فإن لم يوجد عرضت أقرب نطاق حُسم حديثاً.
الطبقة — كبير أو متوسط أو صغير، وتُلوَّن باتجاه الخروج بعد حسمه.
الحد العلوي — سعره بالضبط، جاهزاً لوضع أمر عليه.
الحد السفلي — كذلك.
العرض بوحدات ATR — وبعد الخروج يصير «العرض عند الكسر»، محسوباً بـ ATR المسجّل في تلك الشمعة نفسها. فالرقم يبقى ثابتاً لنموذج مجمّد ولا ينزاح بتغيّر التقلّب.
الرأس المتوقَّع — كم شمعة تفصل عن تقاطع الحدّين. وبعد الخروج يصير «منذ الكسر».
الحالة — نشط، أو كسر معلّق يثبت بالإغلاق، أو كُسر لأعلى، أو كُسر لأسفل.
⚠️ وسطر الحالة وحده يقرأ الشمعة الجارية، فقد ينتقل داخلها بين «معلّق» و«نشط» كلما دخل السعر وخرج. وهذه قراءة لحظية مكتوب فيها صراحة أنها تثبت بالإغلاق، وليست إعادة رسم: الشكل المرسوم لا يتحرك.
🔶 الوسمان V و E
يظهران على شمعة الخروج إن تحقّقا:
📊 V — تجاوز حجم الشمعة متوسطه بالمضاعف الذي ضبطته.
📐 E — تجاوز مداها الحقيقي مؤشر ATR بالمضاعف الذي ضبطته.
وهما وصفٌ لما جرى في تلك الشمعة، لا حكم على جودة الخروج ولا درجة ثقة فيه. ولا يمنعان ظهور أي نموذج.
🔶 التنبيهات
🔔 تكوّن نموذج
🔔 كسر لأعلى
🔔 كسر لأسفل
🔔 أي حل — يجمع الاثنين
وجميعها تشتعل مرة واحدة عند إغلاق الشمعة لا قبله.
🔶 الإعدادات
الرموز أدناه هي نفسها التي تراها على رؤوس المجموعات داخل نافذة إعدادات المؤشر.
🔸 ⚙️ الإعداد
اللغة — إنجليزي افتراضاً، وتبديلها إلى العربية يغيّر الواجهة كلها.
المقياس اللوغاريتمي — مطفأ افتراضاً. اضبطه ليطابق شارتك، وانظر آخر قسم.
طول ATR — 14. يخدم وسم E ومسافة إخلاء النماذج وقراءة العرض في اللوحة.
🔸 📏 الطبقات
كبير L — مفعّل، بطول 21.
متوسط M — مفعّل، بطول 14.
صغير S — مفعّل، بطول 5.
🔸 🔎 الكشف
محاور على الإغلاق فقط — مطفأ. فتُؤخذ المحاور من القمم والقيعان. وبتشغيله تُؤخذ من الإغلاقات وحدها.
مصدر الكسر — Close. وهو مفتاح واحد يحكم ثلاثة أشياء دفعة واحدة: الاحتواء بين المحورين، والاحتواء بعدهما، وكشف الخروج.
أقصى مسافة مضروبة في الطول — 5. سقف ما بين محورَي الحد الواحد.
أدنى تداخل بين الضلعين — 0. الفترة المشتركة المطلوبة بين الحدّين.
أدنى مسافة للرأس — 2.
أقصى مسافة للرأس — 200.
🔸 🎨 المظهر
تعبئة المثلث — مفعّلة، بشفافية 78.
عرض الخط 2، وشفافيته 15.
الألوان — رمادي للتكوّن، أخضر للخروج علواً، أحمر للخروج هبوطاً.
🔸 🗂️ التاريخ والعمر
إبقاؤه كالحالي — 30 شمعة، ثم يُنزَّل إلى الأرشيف أو يُحذف إن كان الأرشيف مطفأً.
التنزيل عند البُعد — 8 من ATR. ويُقاس بـ ATR الحالي عن قصد، لأن السؤال هنا عن بُعد السعر الآن بمقياس تقلّب اليوم لا تقلّب الأمس.
إظهار النماذج السابقة — مطفأ.
عدد النماذج المحفوظة — 12، وهو سقف على الطبقات الثلاث مجتمعة.
خفوت التاريخية — 30، تُضاف فوق شفافية الخط والتعبئة.
🔸 🏷️ التسميات
إظهار التسميات — مفعّل، ويُحفظ منها 2.
وسم الحجم V — مفعّل، بمتوسط 20 ومضاعف 1.5.
وسم التمدد E — مفعّل، بمضاعف 1.4.
🔸 📋 اللوحة
مفعّلة، وموضعها أعلى اليمين.
🔶 الدقة: أي دقة؟
تُطلق كلمة «الدقة» على معنيين مختلفين، ولا يُدّعى هنا إلا واحد منهما.
✅ فأما دقة البناء فمضبوطة، وتستطيع التحقق منها بنفسك دون أن تصدّقني: كل محور مؤكَّد لا مظنون، وكل خط يستوفي شرط احتوائه عند الشمعة التي رُسم فيها، والهندسة تُغلق عند التكوّن فلا يُعاد حسابها، والخروج يُحسم باختبار واحد على شمعة مغلقة. لا شيء يُعاد رسمه، ولا يُملأ بأثر رجعي، ولا يُعدَّل في الخفاء. أعد تشغيل أي شارت وتتبّع أي عنصر.
❌ وأما الدقة التنبؤية فغير مُدّعاة، ولن تجد هنا نسبة نجاح ولا درجة إشارة ولا هدفاً سعرياً.
المؤشر يخبرك أين الحدّان ومتى عُبرا، بدقة. أما قيمة ذلك في استراتيجيتك أنت، على أداتك أنت، وفي إطارك الزمني أنت، فتقديرك ومسؤوليتك.
🔶 أمور تعرفها قبل أن تعتمد عليه
⚠️ لماذا يظهر النموذج متأخراً. لأن المحور لا يُعدّ محوراً حتى تمرّ شموع تأكيده كاملة. وهذا التأخّر هو ثمن ما وعدناك به في السطر الأول: لا شيء يظهر قبل أوانه، ولا شيء ظهر يُسحب منك بعد ذلك.
⚠️ قد تجد ذيلاً عابراً للخط. فالمحاور افتراضياً على القمم والقيعان، بينما يُقاس الاحتواء والخروج على الإغلاق. فيجوز أن يخترق ذيلٌ حداً والنموذج ما زال سليماً. وإن أردت شكلاً لا يمسّه ذيل فاضبط مصدر الكسر على Wick، واعلم أنه اختبار أصرم بكثير وأن النماذج ستقلّ بوضوح.
⚠️ المقياس اللوغاريتمي يدوي. فـ Pine لا يستطيع قراءة إعداد شارتك. وإذا كان شارتك لوغاريتمياً فشغّل الخيار. وعند اختلاف الاثنين ينحرف مستوى الخروج المحسوب عن الخط الذي تراه: انحرافاً مهملاً على النماذج الضيّقة، ومادّياً على الواسعة. وعلامته أمام عينك مباشرة، إذ تنفصل حافة التعبئة اليسرى عن الحد عند المحور الثاني.
⚠️ من أين تُؤخذ المحاور. كل حد يُبنى من آخر محورين على جهته. فالخط الذي يتجاوز محوراً وسيطاً خارج عن نطاق الكشف.
⚠️ الكثافة. ثلاث طبقات مع أرشيف ممتلئ تُثقل الشارت. أطفئ ما لا تحتاجه، واستعن بسقف الأرشيف ودرجة الخفوت.
═════════════════════════════════════════════════════════════
⚠️ إخلاء المسؤولية
═════════════════════════════════════════════════════════════
هذا المؤشر لأغراض تعليمية وتحليلية فقط. لا يُمثل نصيحة مالية أو استثمارية أو تداولية. استخدمه بالتزامن مع استراتيجيتك الخاصة وإدارة المخاطر. لا يتحمل TradingView ولا المطور مسؤولية أي قرارات مالية أو خسائر.
═════════════════════════════════════════════════════════════ مؤشر

DATEOFBIRTH Strategy)# Date of Birth Strategy — Annual High & Low Levels
## Overview
The **Date of Birth Strategy** is an experimental market-analysis tool based on the concept of identifying and tracking the High and Low of a market's historically significant "Date of Birth."
For example, if an index or instrument has a defined inception/date-of-birth date, this script identifies the High and Low formed on that particular calendar date and plots those levels across subsequent years.
The objective is to provide a **historical reference framework** that traders can use alongside conventional technical analysis, price action, market structure, and risk-management techniques.
## How It Works
The script:
* Uses a user-defined **Date of Birth**.
* Identifies the corresponding calendar day for each year.
* Captures the **High and Low** of that day's trading session.
* Plots the levels as horizontal reference lines.
* Extends the levels so traders can observe how price reacts around historically derived levels.
* Can be used for historical analysis as well as monitoring future occurrences of the selected calendar date.
### Example
If the selected Date of Birth is **3 November**, the script attempts to identify the High and Low of 3 November for each available year.
These historical levels can then be studied for:
* Support and resistance reactions
* Breakouts and breakdowns
* Price rejection
* Market structure
* Confluence with technical indicators
* Historical price behavior around the annual date
## Important Considerations
This indicator is intended as a **research and educational tool**. Historical price levels do not necessarily have predictive power, and the appearance of a reaction around a DOB level should not be interpreted as proof of a causal relationship.
The results may vary depending on:
* The selected symbol
* Exchange trading calendar
* Historical data availability
* Timeframe
* Session settings
* Corporate actions or contract changes
* Data-feed differences between brokers and exchanges
Users should independently verify important historical levels against reliable market data.
## Suggested Usage
For better analysis, consider combining the DOB levels with established methods such as:
* Price action
* Market structure
* Volume analysis
* Support and resistance
* Moving averages
* Volatility analysis
* Trend analysis
* Risk/reward assessment
Do not use the DOB levels as a standalone signal for entering or exiting a trade.
## Disclaimer
**Educational and informational purposes only.**
This script is provided for research, educational, and analytical purposes and does **not constitute investment advice, financial advice, trading advice, or a recommendation to buy or sell any security, derivative, cryptocurrency, commodity, index, or other financial instrument.
Past performance or historical market behavior does not guarantee or imply future results. No representation is made that the levels, signals, or observations generated by this script will accurately predict future market movements.
Trading and investing involve substantial risk, including the possible loss of capital. Users are solely responsible for their own trading and investment decisions.
Always conduct your own research and use appropriate risk-management practices. If required, consult a qualified financial professional before making investment decisions.
## Transparency
This script is based on a **calendar-date / historical-level methodology** and should not be interpreted as a guaranteed forecasting system.
The author makes no guarantee regarding the accuracy, completeness, reliability, or future performance of the levels or observations generated by the script.
**Use at your own risk.**
---
**Tags:** `Date of Birth` `DOB Strategy` `Annual Levels` `Support Resistance` `Technical Analysis` `Market Analysis` `Trading Strategy` `Price Action` `Historical Levels`
مؤشر

Trend Trigger | EMA Trend Filter + MTF Stochastic Entry with ATROverview
This strategy combines two proven, independent mechanisms rather than inventing a new indicator: a slow-moving EMA trend filter decides which direction is permitted, and a higher-timeframe-confirmed stochastic oscillator decides when to actually enter. Trend and timing are handled by separate logic layers so each does one job well, instead of stacking multiple overlapping conditions that rarely align.
How it works
Trend permission (EMA 38/62): Trades are only allowed in the direction the EMA fast/slow relationship currently supports — longs when fast > slow, shorts when fast < slow. This keeps the strategy from fighting the prevailing trend. This filter can be disabled for a pure counter-trend/mean-reversion test.
Entry timing (MTF Stochastic): The current-timeframe %K/%D stochastic must cross through the midline (50) with rising/falling momentum, and the same stochastic recalculated on the next higher timeframe (auto-stepped: 1m→5m, 1h→4h, 1D→1W, etc.) must agree in direction. This is the same core logic as classic MTF stochastic systems — entries are timed at momentum inflection points that are confirmed on a broader structural timeframe, not just the noisy current one.
Staged, ATR-based risk management: Every position opens with an ATR-scaled hard stop. Once the trade reaches a configurable R-multiple (default 1.0R), the stop moves to breakeven — locking in "no loss" without capping upside. Past a second, larger R-multiple (default 1.5R), the stop begins trailing using ATR (not fixed ticks), so the trailing distance scales with the instrument's actual volatility instead of an arbitrary number.
Secondary exits: A stochastic-fade exit (mirroring the entry logic in reverse) and an optional trend-flip exit close the trade early if the higher-timeframe signal reverses or the EMA trend turns against the position. A time-stop closes any trade that's gone nowhere after N bars.
Distinctive features
Trend and timing are decoupled — you can test pure momentum-timing (trend filter off) versus trend-confirmed pullback entries (trend filter on) with one toggle.
No fixed-tick trailing stop — every risk parameter (initial stop, breakeven trigger, trailing distance) is ATR-scaled, so the same settings behave sensibly across instruments with very different volatility (e.g., a $30 stock vs. a $60,000 crypto asset) without manual re-tuning.
Risk-based position sizing ties trade size directly to the ATR stop distance and a fixed % of equity risked per trade, rather than a flat share/contract count.
A compact confirmation meter (colored bar table) shows trend + stochastic alignment strength at a glance — no cluttered multi-line oscillator overlays on the chart.
Tips for use
Test with the trend filter both on and off separately — they represent genuinely different strategies (trend-following pullback entries vs. pure momentum reversal) and will perform differently depending on the instrument's regime.
Start testing on liquid instruments and a base timeframe of 1H or higher — the automatic higher-timeframe step needs enough bars underneath it to be meaningful; very low timeframes (1–5 min) compress the "higher timeframe" confirmation into something almost as noisy as the entry timeframe itself.
Check Average Win vs. Average Loss in the Strategy Tester, not just win rate — this strategy is built to keep those two numbers close together (via the breakeven/trailing stages), and that ratio is a better health check than win rate alone.
The breakEvenR and trailStartR inputs interact — a very tight breakeven trigger combined with a very close trail can choke off winners before they develop; a very loose one leaves more of the position exposed to giveback. Both are worth walking through several combinations on your specific instrument and timeframe rather than assuming one setting is universally correct.
This is a rules-based tool, not a guarantee — past backtest results don't ensure future performance, and all trading involves risk of loss.
استراتيجية

Jamallo Channels🔹Intro
For decades, technical traders have relied on conventional channel models, each burdened by fundamental mathematical limitations:
- Bollinger Bands rely on simple moving averages (SMA) and raw price standard deviation. When strong directional trends emerge, raw variance conflates trend slope with volatility, causing the bands to artificially flare open ("volatility bulge") and produce severe lag and frequent false mean-reversion signals.
- Keltner Channels utilize exponential moving averages (EMA) wrapped with Average True Range (ATR). While smoother, the EMA introduces continuous phase delay, and the bands drift constantly with price, failing to provide stable, horizontal support and resistance benchmarks during consolidation.
- Donchian Channels plot rolling highest highs and lowest lows over an N-bar window. However, they are exceptionally vulnerable to single-bar outlier wicks and sudden step jumps that distort the true statistical distribution without accounting for underlying volatility dynamics.
Jamallo Channels resolves these structural flaws through a novel mathematical synthesis:
1. It replaces lagging moving averages with a multi-resolution Maximal Overlap Discrete Wavelet Transform (MODWT) Haar filter bank coupled with an energy-calibrated deadband step-hold state machine. The baseline remains strictly stationary during consolidation and snaps instantaneously to new price levels upon statistically significant drift.
2. It decouples trend from volatility by computing standard deviation strictly on the detrended high-frequency wavelet residual, filtered through a rolling linear-interpolation median to eliminate spike distortion.
3. It locks the volatility corridor at the exact moment a new regime step triggers—producing pristine, step-synchronized horizontal channels and mathematically robust exhaustion zones.
🔹Break down
1. Multi-Resolution Haar Wavelet MODWT Engine:
- Undecimated Dyadic Decomposition: Deconstructs raw price action across up to 5 dyadic scale levels (Level 1 = 2-bar, Level 2 = 4-bar, Level 3 = 8-bar, Level 4 = 16-bar, Level 5 = 32-bar) into orthogonal approximation (trend) and detail (high-frequency noise) coefficients without phase distortion or downsampling loss.
- Scale-Adaptive Smoothing: Isolates the true low-frequency structural trend from intraday churn and microstructure noise at the selected dyadic decomposition level.
- Dynamic Detail Energy Tracking: Measures the real-time volatility intensity of the high-frequency detail spectrum by computing a rolling Simple Moving Average of absolute detail coefficients over a calibrated lookback window.
2. Energy-Calibrated Deadband Step-Hold Mechanism:
- Statistical Innovation Filtering: Establishes an adaptive deadband threshold scaled directly by the product of the detail energy and a deadband multiplier.
- Zero-Drift Piecewise Step-Holding: The smooth wavelet baseline is held strictly horizontal until price innovation definitively breaches the dynamic detail deadband threshold. Once breached, the baseline snaps instantaneously to the new equilibrium price level, eliminating baseline drifting during consolidation phases.
- Clean Regime Direction State: Evaluates the direction of every confirmed step, immediately classifying the market into Bullish (Teal) or Bearish (Maroon) regime states.
3. Detrended Residual Volatility & Frozen Sigma Bands:
- Trend-Decoupled Dispersion Measurement: Unlike standard deviation calculated around lagging moving averages—which artificially inflates during strong trends—Jamallo Channels isolates the high-frequency wavelet residual (Price minus Wavelet Mid) before computing variance, capturing genuine localized volatility.
- Median Filter Outlier Rejection: Applies a rolling linear-interpolation median filter (50th percentile over a 100-bar window) to the raw residual standard deviation, immunizing the channel against one-off spike anomalies and erratic expansion.
- Step-Locked Volatility Corridors: Volatility is sampled and frozen precisely at the moment a new Haar baseline step triggers. The frozen sigma remains constant throughout the entire regime life cycle, producing stable, non-wiggling horizontal channels.
4. Multi-Tier Volatility Corridors & Exhaustion Envelopes:
- Inner Expansion Zone (1.0σ): Defines the immediate high-probability operational boundary around the stepped trend baseline.
- Mid Dispersion Boundary (2.0σ): Represents standard 2-sigma statistical bounds where normal trending impulse legs oscillate.
- Outer Exhaustion & Mean-Reversion Zone (3.0σ): The extreme channel boundary (2.0σ to 3.0σ highlighted by shaded backgrounds) marks statistical overextension where price is prime for momentum exhaustion and mean-reverting retests back to the Haar stepped baseline.
🔹How to use: Trend Following & Risk Management
Jamallo Channels provides clear, objective mathematical parameters for both momentum trend riders and mean-reversion scalpers across all timeframes.
Regime Trend Trading:
- Setup & Execution: Enter in the direction of a newly confirmed Haar baseline step (when the baseline shifts color to Teal for Longs or Maroon for Shorts) or upon a sustained price breakout above/below the baseline following volatility compression.
- Stop Loss Placement: Anchor stop loss orders directly behind the most recent stepped Haar baseline level or just outside the opposite inner/mid channel boundary.
- Trailing & Letting Winners Run: Trail stop loss orders systematically step-by-step as new horizontal baseline rungs are confirmed, protecting capital while letting winners ride the macro expansion.
Mean-Reversion & Exhaustion Scalping:
- Exhaustion Rejection: When price enters the extreme 2.0σ–3.0σ outer band corridor (upper red fill or lower teal fill) and forms rejection wicks or structural exhaustion patterns, execute counter-trend mean-reversion setups.
- Take-Profit Targets: Target the inner channel (1.0σ) for partial profits and the primary Haar stepped baseline (0σ mean) for final profit harvesting.
- Invalidation / Stop Loss: Place tight stop losses just beyond the outer 3.0σ boundary line.
🔹Settings Parameters
Haar Wavelet Basis:
- Basis Level (1 - 5): Selects the dyadic wavelet decomposition scale (1 = 2-bar, 2 = 4-bar, 3 = 8-bar, 4 = 16-bar, 5 = 32-bar). Higher levels smooth out larger macro trends, while lower levels capture high-frequency swings.
- Deadband Multiplier (0.1 - 10.0): Scaling coefficient applied to the detail energy. Higher values widen the deadband, requiring larger directional thrusts to trigger a new step and producing wider, noise-immune steps.
- Detail Energy Lookback (5 - 200): The rolling lookback window used to calculate the average magnitude of wavelet detail coefficients.
Stdev Bands:
- Stdev Length (min 2): Lookback period for measuring the standard deviation of the detrended wavelet residual.
- Inner Multiplier (0.1 - 10.0): Standard deviation multiplier for the inner channel envelope (default: 1.0σ).
- Mid Multiplier (0.1 - 10.0): Standard deviation multiplier for the middle channel envelope (default: 2.0σ).
- Outer Multiplier (0.1 - 10.0): Standard deviation multiplier for the extreme exhaustion envelope (default: 3.0σ).
Display Settings:
- Basis Up Color: Custom color for the stepped baseline during bullish regime states (default: Teal).
- Basis Down Color: Custom color for the stepped baseline during bearish regime states (default: Maroon).
- Upper Color: Accent color for the upper channel bands and exhaustion fills (default: Red).
- Lower Color: Accent color for the lower channel bands and exhaustion fills (default: Teal).
- Show Fill: Toggles background shading for the inner and outer volatility corridors.
مؤشر

FCP | Market Sessions | High Low Box & Range StatsMarks the Sydney, Tokyo, London and New York sessions, tracks each
one's high and low, and carries those levels forward to the next
session open.
WHAT IT DRAWS
• A shaded box spanning each session's time window and price range.
• High and low lines that extend to the next session's open.
• Range extension lines projected from the session high and low at
configurable multiples of the session range (0.5x, 1x, 2x by
default), with optional multiplier labels.
• A stats table showing each active session's current range as a
percentage of its own average range over the last N sessions.
Rows for disabled sessions are hidden.
HOW IT WORKS
Session boundaries and session extremes are not read from the chart's
candles. They are computed from 5-minute data through a lower-timeframe
request, so the levels are identical whether you are on a 15-minute
chart or a 4-hour chart. The chart is only the canvas.
The session in progress updates on every tick rather than on bar close,
so the box and its high and low lines follow price in real time.
SETTINGS
Session timezone — sessions are defined in this timezone, so the
windows stay fixed regardless of the symbol's exchange timezone.
Accepts a UTC offset (GMT+0, GMT+3) or an IANA name (Europe/London).
Look-back — how many past sessions to keep drawn.
Each session has its own on/off switch, time window, colour and line
width, so you can define custom windows instead of the defaults.
Range extensions — three independent multipliers; set any of them to
0 to hide one. Line style, width and transparency are adjustable.
Range stats — the averaging window, panel corner and text size.
NOTES
Works on timeframes up to and including 1 day. On higher timeframes
nothing is drawn.
Session times are fixed to the selected timezone and do not shift with
daylight saving time. If your sessions are defined in a DST-observing
timezone, adjust the windows twice a year or enter an IANA timezone
name. مؤشر

OBV Acceleration / DecelerationDescription:
Introduction
Classic On-Balance Volume (OBV) is a powerful tool for tracking smart money and volume flow. However, standard OBV relies on raw closing prices to determine whether volume was "bullish" or "bearish" for the day. This makes it highly susceptible to market noise, wicks, and fake-outs.
This open-source script, OBV Acceleration / Deceleration, rebuilds the OBV formula from the ground up. It filters price noise using a Fibonacci-weighted Master Average and introduces a Volume Kinetics engine to detect exactly when volume is accelerating (spiking) or decelerating (drying up)
How It Works: Core Logic & Features
This indicator is built on three core mechanical features. Here is the exact logic behind how they work:
1. The Fibonacci Master Average (Noise Filtering)
Instead of looking at the raw close price to decide if volume should be added or subtracted, this script calculates six separate Simple Moving Averages (SMAs) based on the first six numbers of the Fibonacci sequence (1, 1, 2, 3, 5, 8).
*The Logic: The script averages these six SMAs together to create a "Master Average."
*The Result: If the Master Average is pointing up, the volume is added to the OBV. If it points down, it is subtracted. This ensures that a single erratic price wick does not falsely flip the volume flow.
2. Volume Kinetics (Acceleration & Deceleration)
Standard OBV only tells you direction, not intensity. This script measures the "velocity" of the volume by tracking the absolute change in the OBV step bar-by-bar, and compares it to a 40-period historical average.
*Acceleration (Volume Spikes): If the current volume is greater than our customizable Expansion Factor (default 2.0x the average), it flags an Acceleration state. This indicates high momentum, institutional participation, or a heavy breakout.
*Deceleration (Volume Dry-Up): If the current volume drops below our Compression Factor (default 0.5x the average), it flags a Deceleration state. This mathematically highlights market exhaustion, tight consolidation, or a lack of interest.
3. OBV Moving Average & Cloud Fill
To help determine the broader momentum context, a 20-period SMA is applied directly to the custom OBV line.
*The Logic: A dynamic cloud fills the space between the OBV line and its SMA.
*The Result: When OBV is above its SMA, the cloud is Teal (Bullish momentum). When OBV is below its SMA, the cloud is Maroon (Bearish momentum).
Visual Guide (Reading the Dots)
The indicator plots color-coded dots directly on the OBV line to give you instant visual feedback on volume kinetics:
🟢 Bright Green Dot: Bullish Acceleration (High-volume buying spike).
🔴 Bright Red Dot: Bearish Acceleration (High-volume selling spike).
🟡 Yellow Dot: Deceleration / Exhaustion (Volume has severely dried up).
🔵 Teal Dot: Standard bullish volume flow.
🟤 Maroon Dot: Standard bearish volume flow.
Practical Trading Applications
Confirming Breakouts: If price breaks through a key resistance level and the indicator prints a Bright Green Dot, it confirms the breakout is supported by anomalous volume and is more likely to succeed.
Spotting Reversals (Exhaustion): When price approaches a major support or resistance level and prints a cluster of Yellow Dots, it means the volume pushing the trend has dried up. This often precedes a reversal or a deep pullback.
Trend Riding: Stay in trades as long as the OBV line remains on the correct side of its SMA (represented by the Teal or Maroon cloud fill), ignoring minor price pullbacks.
مؤشر

Regime Gated Confluence Score [Pineify]Regime Gated Confluence Score
Overview
This pane indicator combines trend, momentum, and volume after a four-state gate selects meaning and weight. The main score and dashboard reconcile signed contributions.
Problem Definition
Fixed-weight confluence hides a regime error. Positive RSI may confirm a trend but mark extension in a range. EMA separation can persist after efficient travel ends. Relative volume shows participation, not acceptance. A permanent sum can stay strong when path efficiency is low, factors disagree, or ATR leaves its baseline, so users cannot tell whether magnitude reflects agreement or one dominant input.
Design Rationale
ATR-normalized EMA separation and slope measure trend across price scales. Centered RSI supplies momentum; RANGE reverses it to express a fade. Volume pressure combines capped relative volume with close location without claiming aggressor flow. EMA spread and path efficiency classify structure; ATR versus baseline identifies displacement. Lower hold thresholds add hysteresis. A trained model would add hidden data assumptions, while fixed weights preserve the failure. Explicit rules accept sensitivity and lag for auditability.
Key Features
Four regimes with hysteresis.
Standardized trend, RSI, and participation factors.
Regime weights, range inversion, missing-volume renormalization, conflict attenuation, exact contribution totals, and confirmed alerts.
How It Works
EMA spread and fast-EMA change are normalized by ATR, blended 65/35, and clipped to -1 through +1. RSI is centered at 50, divided by 25, and clipped. Volume multiplies close location inside the bar by relative volume capped at 2.5 times baseline, then smooths it. If fewer than 80% of volume-window bars are usable, volume is omitted.
Trend strength is absolute normalized EMA spread. Path efficiency divides net movement by total one-bar movement. ATR relative to baseline measures displacement. VOLATILE has priority until its lower hold level clears. Otherwise, strong separation and efficiency enter TREND, weak evidence enters RANGE, and unresolved evidence is TRANSITION.
Trend/momentum/volume weights are 55/30/15 in TREND, 15/60/25 in RANGE, 40/35/25 in VOLATILE, and 35/40/25 in TRANSITION. RANGE reverses only RSI. Missing volume removes its weight and renormalizes the others. Agreement divides absolute net contribution by total absolute contribution and sets a 0.55-to-1 gate; VOLATILE adds an ATR penalty. Gated components sum to the score. Warm-up or invalid threshold and EMA ordering blocks output with a diagnostic.
How Multiple Indicators Work Together
Trend estimates structure, momentum locates bounded pressure, and volume tests participation plus bar acceptance. The regime interprets them before combination. Without range inversion, extension becomes a continuation vote; without trend, brief momentum can dominate; without volume, weights must be renormalized. Agreement converts remaining conflict into lower magnitude rather than hiding it.
Trading Ideas and Insights
Use the score as context, not an order. A confirmed threshold cross during TREND identifies aligned conditions. In RANGE, check whether trend or volume opposes inverted momentum before considering a fade. In VOLATILE, a compressed gate shows ATR displacement discounting the raw sum. A strong component beside a modest total indicates conflict.
Unique Aspects
The contribution is the sequence of classification, interpretation change, weighting, and attenuation. RANGE reverses momentum while other factors can veto it; hysteresis separates trend entry from persistence; missing volume is removed; and agreement scales every component so the ledger equals the score. The halo shows magnitude, the background shows regime, and the table exposes construction.
How to Use
Start with defaults and compare the regime label with visible path behavior. Wait for warm-up. Keep the ledger visible to see whether structure, oscillator pressure, or participation drives direction. Use confirmed alerts when closing-state transitions matter. Contribution lines are diagnostic; the halo and background form the primary view. Omitted volume means a disclosed two-factor score.
Customization
EMA lengths and slope lookback control structural response; RSI length controls momentum sensitivity. Volume baseline and smoothing trade speed for stability. Regime length changes path efficiency and the ATR baseline. Entry thresholds must exceed hold thresholds. Raising the score threshold reduces alert frequency but does not establish better forecasting. Visual switches change display only.
Assumptions and Limitations
The script uses chart OHLC and reported volume. Exchange, tick, and absent volume differ; close-location volume is only a proxy. EMA, ATR, RSI, and rolling baselines lag. RANGE can fade a breakout, hysteresis can delay exits, and attenuation can suppress an early shock.
Realtime factors, regime, colors, and score can change before close; alerts require confirmation. No request calls, future data, pivots, or negative offsets are used. The script does not model liquidity, news, sizing, entries, stops, or exits. Thresholds do not establish expected return. Sparse bars and unreliable volume can distort evidence.
Conclusion
This replaces a fixed sum with an inspectable state process. The score and ledger show weights, conflict attenuation, and missing-data effects. Keep separate risk and execution rules.
.
مؤشر

5-Day Rolling SMA 1m + Trend Alignment Band5-Day Rolling SMA 1m + Trend Alignment Band
This indicator displays a rolling multi-day Simple Moving Average calculated from 1-minute closing prices, together with a three-state Trend Alignment Band.
It is designed to provide a continuous view of short-term market direction across intraday chart timeframes.
Concept
A conventional 5-day SMA calculated on a daily chart averages only five daily closing prices.
This indicator uses a different approach. It calculates the average from all 1-minute closing prices contained in approximately five regular trading sessions.
For a U.S. stock or ETF with a 390-minute regular trading session:
390 minutes x 5 trading days = 1,950 one-minute bars
The default 5-day calculation is therefore approximately equivalent to:
SMA = Sum of the last 1,950 one-minute closes / 1,950
However, the script does not assume that every market has exactly 390 one-minute bars per trading day.
Instead, it measures the actual number of 1-minute bars in recent completed trading sessions. It then uses the median session length to estimate the typical number of bars per day.
The rolling window is calculated as:
Rolling Window = Typical 1-minute bars per session x Rolling Days
Using the median helps reduce the influence of shortened or unusual trading sessions.
Why use 1-minute data?
Using 1-minute data allows the multi-day average to move continuously instead of behaving like a daily moving average projected onto an intraday chart.
On a 1-minute chart, the rolling SMA can update every minute as:
one new 1-minute close enters the calculation;
the oldest observation leaves the rolling window.
On higher chart timeframes, the same internally calculated 1-minute rolling SMA is sampled onto the selected chart timeframe.
The purpose is not to reproduce a conventional 5-period daily SMA. It is to represent the average location of intraday prices over approximately the most recent five trading sessions.
Trend Alignment Band
The area between price and the rolling SMA is colored according to the relationship between price and the direction of the SMA.
Green - Bullish Alignment
Green appears when:
Price is above the rolling SMA.
The rolling SMA is rising.
Condition:
Price > SMA AND SMA(t) > SMA(t-1)
This indicates that price location and short-term trend direction are aligned upward.
Red - Bearish Alignment
Red appears when:
Price is below the rolling SMA.
The rolling SMA is falling.
Condition:
Price < SMA AND SMA(t) < SMA(t-1)
This indicates that price location and short-term trend direction are aligned downward.
Yellow - Transition / Conflict
Yellow appears when the two conditions are not aligned.
Examples include:
Price moves above the SMA while the SMA is still falling.
Price moves below the SMA while the SMA is still rising.
The SMA is flat.
Yellow should therefore not automatically be interpreted as a ranging market. It represents disagreement between current price location and the direction of the rolling average, which can occur during transitions, pullbacks, reversals, or consolidation.
Intended Use
The indicator is intended primarily as a short-term market-regime and directional context tool rather than as a standalone entry signal.
Possible uses include:
Identifying short-term directional bias.
Distinguishing aligned trends from transition phases.
Providing context for pullbacks and rallies.
Comparing current price with the average intraday price location of recent trading sessions.
Maintaining a consistent short-term reference when moving between intraday chart timeframes.
The three band states can be interpreted as:
Green = bullish alignment
Red = bearish alignment
Yellow = transition or directional conflict
These states are descriptive, not predictive, and should not be treated as automatic buy or sell signals.
Original Features
The script differs from a standard daily SMA or a fixed-length intraday SMA in several ways:
The moving average is calculated internally from 1-minute closing prices.
The script automatically measures the typical number of 1-minute bars in recent completed sessions.
The median session length is used to reduce sensitivity to shortened or irregular trading days.
The rolling period is automatically constructed from the detected session length and selected number of trading days.
The Trend Alignment Band combines both price position and SMA direction instead of using a simple price/SMA crossover alone.
This allows the indicator to adapt its multi-day rolling window to different symbols and trading-session structures without relying on a permanently fixed 1,950-bar setting.
Settings
Show 5-Day Rolling SMA
Shows or hides the rolling SMA line.
Show Trend Alignment Band
Shows or hides the colored area between price and the rolling SMA. Enabled by default.
SMA Line Width
Adjusts the thickness of the SMA.
SMA Color
Default: orange.
Band Transparency
Controls the transparency of the colored trend band.
Bullish Band / Bearish Band / Transition Band
Allows customization of the green, red, and yellow states.
Rolling Days
Default: 5 trading days.
Session Detection Days
Controls how many completed sessions are used when estimating the typical number of 1-minute bars per trading day.
Session
Regular: Uses the symbol's regular trading session.
All: Uses the available session data for the symbol.
For U.S. stocks and ETFs, Regular is the intended default.
Limitations
This is not the same calculation as a conventional 5-period SMA on a daily chart.
The indicator averages 1-minute closing-price observations, so it is better interpreted as a rolling intraday time-sampled price average over approximately the selected number of trading days.
Results can vary depending on:
the symbol's trading-session structure;
Regular versus All session selection;
holidays and shortened trading sessions;
the amount of 1-minute historical data available from the data provider;
the chart timeframe on which the internally calculated series is sampled.
A sufficient amount of historical intraday data is required before the script can determine the normal session length and calculate the full rolling window.
This indicator does not predict future prices and does not generate guaranteed trading signals. It should be used together with price structure, support/resistance, volume analysis, risk management, or other independent forms of analysis.
日本語説明
このインジケーターは、**直近の複数営業日相当の1分足終値から計算するローリングSMA(単純移動平均線)**と、価格とSMAの状態を3色で表すTrend Alignment Bandを表示します。
一般的な日足5SMAとは計算方法が異なります。
通常の日足5SMAは、
直近5本の日足終値の平均
ですが、本インジケーターは直近約5営業日に含まれる1分足終値を連続的に平均します。
米国株・ETFの通常取引時間が1日390分の場合、
390分 × 5営業日 = 1,950本
となるため、デフォルト設定では概ね1分足1950期間SMAに相当します。
1日のバー数を自動判定
このインジケーターでは、1日のバー数を390本と固定していません。
過去の完了した取引日について実際の1分足本数を計測し、その中央値から通常の1営業日あたりのバー数を推定します。
計算期間は、
ローリング本数 = 1営業日の代表的な1分足本数 × ローリング日数
として自動的に決定されます。
中央値を使用することで、短縮取引日などの特殊なセッションの影響を受けにくくしています。
1分足を使用する理由
日足5SMAをそのままイントラデイチャートへ表示すると、日ごとに値が切り替わるため階段状になります。
本インジケーターでは内部計算を1分足で行うため、1分足チャートでは新しい1分足が形成されるごとにローリング平均が更新されます。
したがって、通常の日足5SMAよりも連続的に、直近数営業日における価格の平均的な位置を表現できます。
上位時間足では、この1分足で計算されたRolling SMAを各チャート時間足へサンプリングして表示します。
Trend Alignment Band
価格とRolling SMAとの間を、価格の位置とSMAの方向に応じて3色に分類します。
緑 - Bullish Alignment
以下の2条件が同時に成立した状態です。
価格がSMAより上
SMAが上向き
Price > SMA かつ SMA(t) > SMA(t-1)
価格と短期トレンドの方向が上方向に一致している状態を示します。
赤 - Bearish Alignment
以下の2条件が同時に成立した状態です。
価格がSMAより下
SMAが下向き
Price < SMA かつ SMA(t) < SMA(t-1)
価格と短期トレンドの方向が下方向に一致している状態を示します。
黄 - Transition / Conflict
価格とSMAの方向が一致していない状態です。
代表例:
価格はSMAを上回ったが、SMAはまだ下降している
価格はSMAを下回ったが、SMAはまだ上昇している
SMAが横ばい
したがって黄色は単純な「レンジ」を意味するものではありません。
価格の位置と短期平均の方向に不一致が生じている状態であり、転換、押し・戻し、反転、持ち合いなどで発生します。
基本的な使い方
本インジケーターは直接的な売買シグナルではなく、短期的な相場環境と方向性を把握するためのツールとして設計しています。
基本的には、
緑 = 上昇方向への整合
赤 = 下降方向への整合
黄 = 移行状態または方向の不一致
として使用します。
価格が単にSMAの上か下かだけではなく、SMA自体の方向も同時に判定することが特徴です。
本インジケーター独自の特徴
一般的な日足SMAや固定期間のイントラデイSMAと比較して、以下の特徴があります。
1分足終値を内部計算に使用
1営業日の実際の1分足本数を自動計測
過去セッションの中央値によって通常のセッション長を推定
セッション長 × 日数からローリング期間を自動設定
価格のSMAに対する位置とSMAの方向を組み合わせて3色の状態を表示
これにより、1950本などの固定値をすべての銘柄に適用するのではなく、銘柄ごとの取引セッションに応じた複数日Rolling SMAを構成します。
設定
Show 5-Day Rolling SMA
Rolling SMAの表示・非表示。
Show Trend Alignment Band
Trend Bandの表示・非表示。デフォルトはON。
SMA Line Width
SMAの太さ。
SMA Color
デフォルトはオレンジ。
Band Transparency
帯の透明度。
Bullish / Bearish / Transition Band
緑・赤・黄色を個別に変更できます。
Rolling Days
デフォルト5営業日。
Session Detection Days
通常の1営業日の1分足本数を判定するために使用する過去セッション数。
Session
Regular:通常取引時間のみ
All:取得可能なセッションデータを使用
米国株・ETFではRegularを基本設定として想定しています。
通常の日足5SMAとの違い
通常の日足5SMAは、5本の日足終値を平均します。
本インジケーターは、直近約5営業日に含まれる大量の1分足終値を平均します。
したがって、両者は「5日」という時間範囲を扱っていても同じ指標ではありません。
本インジケーターは、直近数営業日において価格が平均的にどの水準に滞在していたかを連続的に表現することを目的としています。
制約・注意事項
計算結果は以下の要因によって変化する場合があります。
銘柄ごとの取引時間
Regular / All の選択
祝日や短縮取引
TradingView側で利用可能な1分足履歴
表示しているチャート時間足
十分な1分足履歴が存在しない場合、通常のセッション長および完全なローリング期間を計算できるまでSMAが表示されない場合があります。
また、本インジケーターは将来の価格を予測するものではなく、売買結果を保証するものでもありません。価格構造、支持抵抗、出来高、リスク管理など、他の分析と組み合わせて使用してください。 مؤشر

SHM - Dual-WMA Momentum OscillatorSHM - Dual-WMA Momentum Oscillator
Overview-
The SHM Dual-WMA Momentum Oscillator (DWO) is an institutional-grade momentum indicator engineered to isolate structural trend direction, momentum acceleration, and high-probability market cycles across custom timeframes.
By calculating the percentage distance between a Fast WMA and a Slow WMA, the DWO filters out transient market noise and locks calculation logic to a customizable higher timeframe wave—allowing you to project and track macro momentum seamlessly across every chart resolution.
Key Features & Architecture-
* Flexible Multi-Timeframe (MTF) Engine: Complete control over your anchor timeframe (Anchor Momentum Timeframe). Choose your preferred momentum wave (e.g., 4H, Daily/24H, 3D, Weekly) and lock it to display consistently across all timeframes without repainting or distortion.
* Universal Timeframe Visibility: Lock your preferred anchor to the 4-Hour wave, and that 4H momentum wave stays strictly visible whether you zoom down to a 15-minute execution chart or step up to inspect the Daily or Weekly macro chart.
* Structural Trend Isolation: Eliminates short-term volatility, revealing where higher-timeframe capital flow is actually moving.
* Triple Equilibrium Baselines: Features customizable numeric anchor points (+33, 0, -33) paired with dynamic 4-color momentum acceleration histograms to easily spot expansion, exhaustion, and mean-reversion zones.
* Signal Tracking Line: Integrates an EMA-smoothed signal tracking line to highlight momentum crossovers and zero-line baseline retests cleanly.
How to Use for Analysis-
1. Selecting Your Anchor Timeframe:
* Set the Anchor Momentum Timeframe in the settings input to your preferred cycle (e.g., 240 for 4H execution, 1440 for Daily macro, or 1W for high-timeframe positioning).
2. Determining Trend Bias:
* DWO Line Above Zero Baseline: The selected anchor wave is structurally bullish. Intraday pullbacks act as buying liquidity within the broader trend.
* DWO Line Below Zero Baseline: The selected anchor wave is structurally bearish. Intraday bounces act as counter-trend rallies.
3. Equilibrium Acceleration Histograms:
* Green / Teal Histograms: Positive momentum acceleration relative to your selected anchor timeframe.
* Red / Dark Red Histograms: Negative momentum acceleration relative to your selected anchor timeframe.
Inputs & Settings-
* Anchor Momentum Timeframe (Default: 24H / 1440): Selects the timeframe wave to project across all charts (supports 1m up to 1W).
* Fast WMA Lookback (Default: 65): Controls the sensitivity of the primary signal curve.
* Slow WMA Lookback (Default: 480): Establishes the baseline filter for long-term trend isolation.
* Signal Smoothing Line (Default: 63): Adjusts the sensitivity of the EMA signal tracking curve.
* Triple Baseline Configuration: Sets the Y-axis levels for upper (+33), zero (0), and lower (-33) histograms.
Disclaimer
This script is designed for educational, informational, and analytical charting purposes only. It does not constitute financial or trading advice. Always perform independent analysis and practice strict risk management.
مؤشر

Dual Shock SPMA | NAL1. Overview
Dual Shock SPMA | NAL is a dual-memory trend indicator designed to separately track how significant bullish and bearish price shocks are developing through time.
Unlike the standard Shock Percentile Moving Average, the Dual Shock SPMA maintains two independent adaptive baselines. Positive shocks update the Bull Shock SPMA, while negative shocks update the Bear Shock SPMA.
This creates two separate memories of where statistically stronger directional moves have occurred, allowing the indicator to evaluate the relationship between bullish and bearish shock structure rather than treating all large movements as one stream.
2. Calculation
The indicator begins by calculating the percentage return of the selected source and ranking the absolute magnitude of that return against recent history.
Ret = not na(source ) ? (source - source ) / math.max(math.abs(source ), syminfo.mintick) : 0.0
ShockRank = ta.percentrank(math.abs(Ret), percentrank_lookback)
Because the percentile calculation uses the absolute return, bullish and bearish shocks are ranked against the same magnitude distribution.
The direction of the return then determines which baseline is allowed to update.
BullGate = Ret > 0.0 and not na(ShockRank) and ShockRank > percentile_gate
BearGate = Ret < 0.0 and not na(ShockRank) and ShockRank > percentile_gate
A qualifying positive shock updates only the Bull Shock SPMA. A qualifying negative shock updates only the Bear Shock SPMA. Otherwise, each baseline retains its previous value.
BullMA := na(BullMA ) ? emaValue : BullGate ? emaValue : BullMA
BearMA := na(BearMA ) ? emaValue : BearGate ? emaValue : BearMA
Each shock stream then maintains its own directional memory.
A rising Bull SPMA means significant positive shocks are occurring at progressively higher price levels. A rising Bear SPMA means significant negative shocks are also occurring at progressively higher levels. The inverse applies when either baseline is declining.
BullTrend := BullSPMA > BullSPMA ? 1 : BullSPMA < BullSPMA ? -1 : nz(BullTrend , 0)
BearTrend := BearSPMA > BearSPMA ? 1 : BearSPMA < BearSPMA ? -1 : nz(BearTrend , 0)
The final state requires agreement between both shock memories.
For a bullish regime, both baselines must be trending upward and the Bull SPMA must remain above the Bear SPMA. For a bearish regime, both must be trending downward and their ordering must reverse.
An optional midpoint gate can additionally require price to remain aligned with the center of the dual-shock structure.
ShockMid = math.avg(BullSPMA, BearSPMA)
Long = BullTrend == 1 and BearTrend == 1 and (not UseMidGate or close > ShockMid) and BullSPMA > BearSPMA
Short = BearTrend == -1 and BullTrend == -1 and (not UseMidGate or close < ShockMid) and BullSPMA < BearSPMA
3. Key Features
Separate bullish and bearish shock-memory baselines.
Absolute-return percentile ranking for directly comparable shock magnitude.
Event-driven updates restricted to statistically stronger price movements.
Independent directional memory for positive and negative shocks.
Dual-baseline agreement and relative-position logic.
Optional price midpoint confirmation.
Optional neutral state during unresolved shock structure.
Shock-memory spread visualization and state-based candle coloring.
4. Use
Dual Shock SPMA is designed to analyze how significant positive and negative price events are evolving relative to one another.
Rather than treating volatility as a single undifferentiated stream, the indicator preserves separate memories for each side of the market. This makes the relationship between bullish and bearish shock structure itself part of the signal.
The spread between the two baselines visually represents this evolving relationship, while the midpoint provides a central reference for the combined shock structure.
Dual Shock SPMA is designed as a specialized structural component within a complete strategy framework. Its role is to identify when independently maintained bullish and bearish shock memories begin establishing directional agreement, providing a distinct layer of information about the underlying development of larger price movements.
مؤشر
