The Essential Pivots
The Essential Pivots
Not every pivot deserves space on your chart.
The Essential Pivots was designed around a simple idea: emphasize the higher-importance pivot levels that tend to attract greater participation, receive more meaningful reactions, and produce larger directional moves—while removing many of the secondary levels that often add more clutter than clarity.
Traditional pivot indicators can fill the chart with numerous support and resistance lines. Although every calculated level may have a purpose, displaying all of them at once can make it difficult to recognize which areas truly matter. The Essential Pivots takes a more selective approach, giving traders a cleaner view of the market’s most significant reference points.
Why These Pivots Matter
Major pivots can act as areas where:
Price pauses, rejects, or reverses
Breakouts gain momentum
Previous resistance becomes support, or support becomes resistance
Buyers and sellers compete for directional control
Trend indicators react, flatten, or change direction
Larger intraday and multi-session moves begin
Because these levels represent broader reference points, they may be watched by more market participants than many lower-priority pivot levels. This does not mean price will always reverse at a pivot. Instead, the levels identify areas where trader attention and the probability of a meaningful reaction may increase.
A Cleaner Approach to Market Structure
The primary purpose of The Essential Pivots is not to predict every market turn. It is to simplify the chart so traders can quickly answer a more useful question:
Where are the most important decision areas right now?
By concentrating on essential pivot levels, the indicator helps reduce visual noise and prevents the chart from becoming a maze of competing horizontal lines. This makes it easier to combine the pivots with price action, market structure, volume, or a preferred trend indicator without overwhelming the screen.
Ways to Use the Indicator
The Essential Pivots can help traders evaluate:
Rejection entries when price tests a pivot and fails to continue
Breakout opportunities when price closes decisively through a level
Retests after a broken pivot changes its role
Profit targets near the next major pivot
Stop placement beyond a confirmed structural level
Consolidation when price repeatedly crosses the same pivot
Confluence with trendlines, moving averages, opening ranges, or volume-based tools
A pivot should generally be treated as an area of interest rather than an automatic entry signal. The quality of the reaction still matters. A decisive rejection, strong close, successful retest, or expansion in momentum provides more information than price merely touching the line.
Reading Price Around a Pivot
Rejection: Price tests the pivot but closes back away from it, suggesting the level is being defended.
Breakout: Price closes clearly beyond the pivot with directional conviction.
Retest: Price returns to the broken level and holds it from the opposite side.
Acceptance: Price repeatedly trades on both sides of the pivot, suggesting uncertainty or balance rather than a clean directional edge.
Role reversal: A former resistance level begins acting as support, or former support begins acting as resistance.
When price repeatedly moves above and below a pivot, conditions may be too indecisive for the level to provide a reliable directional bias. In these situations, patience may be more valuable than prediction.
Visual Design
The indicator uses a consistent visual hierarchy so the pivots remain easy to identify without competing with candles or other tools. Essential levels are displayed with greater prominence, while the overall presentation remains intentionally minimal.
The quarterly pivot is enabled by default because it can provide valuable higher-timeframe context and may remain relevant across many trading sessions.
Best Practices
The Essential Pivots is most effective when used as a framework for context—not as a standalone buy-or-sell system. Traders may improve selectivity by considering:
The strength and direction of the prevailing trend
The quality of the candle reaction at the pivot
Whether price is rejecting, breaking, or accepting the level
The distance to the next significant pivot
Current volatility and market conditions
Alignment with higher-timeframe structure
The strongest opportunities often occur when price reaches an important pivot with clear directional intent and then confirms whether the level is being defended or surrendered.
Final Perspective
The Essential Pivots is built for traders who want fewer lines and more meaningful information.
Rather than displaying every possible pivot calculation, it focuses attention on the levels most likely to influence price behavior, support larger moves, and provide useful structural context. The result is a cleaner chart, a clearer decision-making process, and more room to observe what matters most: how price actually responds when it reaches an important level.
Important: Pivot levels are reference points, not guarantees. This indicator does not provide financial advice and should be used alongside appropriate confirmation, risk management, and independent analysis.
Indicador

PGO Ensemble [MiesOnCharts]An ensemble of Pretty Good Oscillators, one for every length in a range. Each one measures how far price sits from its own moving average, in units of its own average true range, and each holds a long or short state. The plotted score is the margin of the vote across them, running from -1 when every member is short to +1 when every member is long.
Built with daily bars in mind. The inputs adjust for other timeframes.
What PGO measures
Displacement from a moving average, divided by ATR over the same length. A reading of 2 means price sits two typical bars away from its own mean. Dividing by range is what makes it portable: the same number means the same thing on any symbol at any price.
Why an ensemble
Any single length is an arbitrary pick, and the best one is only obvious afterwards. Short lengths react fast and whipsaw. Long lengths are steady and late.
The reason this works on PGO in particular is the ATR division. Raw distance from a mean cannot be pooled across lengths, because a long average sits further from price by construction and would dominate any average of the two. Dividing by range over the same length puts every member in identical units, so a short member disagreeing with a long one is real information rather than an artefact of scale.
Members hold a state, not a reading
Each member latches long when it clears the upper threshold and stays long until it breaks the lower one. The vote counts positions rather than values, so a brief dip does not flip a member back.
The two thresholds are asymmetric on purpose. Price spends more time stretched above its mean than below in most markets, and a symmetric pair produces a permanent long bias.
A member that has never crossed either threshold contributes nothing. Early in a chart's history the score is muted for that reason, which is correct. Those members have no opinion yet.
Signals
Score at or above the trend threshold turns the state to uptrend and everything green. At or below the mirror of it, downtrend and red. In between, the previous state holds, so a brief loss of agreement does not end a regime.
Triangles mark each flip in the pane and on the price chart, the candles carry the regime colour, and both flips have alerts.
Inputs
Source and MA Type: the price series, and the average each member measures displacement from. VWMA falls back to the simple average on symbols that carry no volume.
Min Length, Max Length and Length Step: the range and spacing of the ensemble. A wider span mixes more timescales and gives a smoother score. Every member costs the same regardless of its length, so range is cheap here.
Long Threshold and Short Threshold: how far a member must be displaced before it latches.
Trend Threshold: how much of the ensemble must agree before the regime flips. Higher is more selective and later.
Flat When Split: whether an undecided ensemble holds the last regime or drops to flat.
Display toggles for the fill, the chart candles and the flip arrows.
How to use it
Read the colour as a regime filter rather than an entry.
Watch the score when it sits away from its extremes. A trend running with only half the ensemble behind it is resting on the short members alone.
Displacement is not direction. A member can be latched long while price falls, because it is still stretched above its mean.
Limits
It is reactive. It describes displacement that has already happened and will lag turns.
Nearby lengths give similar answers, so a narrow range delivers less of the averaging benefit than a wide one.
Latching cuts both ways. It holds a member through noise, and it also holds it too long when a move genuinely ends.
The asymmetric thresholds assume the usual upward drift. On a market without one they should be evened out.
No setting is right everywhere. Test on your own market and timeframe.
Credits
The Pretty Good Oscillator is Mark Johnson's. The TradingView implementation is Alex Orekhov's (everget). This script was inspired by QuantLapse's PGO variant, which is where the latching state and the asymmetric thresholds come from. The ensemble, the vote across it and the reconstruction of the members are the additions here.
Disclaimer
This indicator is provided for educational and informational purposes only and does not constitute financial, investment, or trading advice, nor a recommendation to buy or sell any asset. Indicador

MSnR Classic StoryLine MTFMSnR Classic StoryLine MTF
A dashboard that reads the trend of five higher timeframes at once, and reports each one as
Bullish or Bearish.
What makes each reading is not an indicator applied to five timeframes. It is a two timeframe
process. The higher timeframe decides WHERE to look: it finds the support or resistance level
that price has just rejected. The lower timeframe then decides WHICH WAY: it waits for price to
break the last structural level standing in the way. Only when both halves complete does that
row change.
Nothing is calculated from the chart you are on, so the table reads the same on every timeframe.
You can sit on M5 and still read the Monthly trend.
THE FIVE PAIRS
Monthly decided on Daily
Weekly decided on H4
Daily decided on H1
H4 decided on M30
H1 decided on M15
Each row is completely independent. They share no state and can disagree with each other, which
is the point: agreement across rows is information, and so is conflict.
WHAT MAKES THIS DIFFERENT
1. Two timeframes decide one reading.
Most multi timeframe tools run the same calculation on several timeframes and stack the results.
Here the two timeframes have different jobs. The higher one supplies the context and never
decides direction on its own. The lower one supplies the proof and is never consulted without a
context. Neither half means anything alone.
2. Levels are tracked, not drawn.
A level is not a line that is placed once and left there. Every level created inside the window
is followed forward, candle by candle, and its state is updated: it can be rejected, it can be
broken, it can flip sides and come back to life. A rejection only counts when it happens on a
level that is still Fresh. This is what stops the same tired level from producing a signal over
and over.
3. Several setups wait at the same time.
Every rejection opens its own setup, and a newer one never cancels an older one. Two, five, a
dozen can be waiting together, each with its own level and its own breakout target. Whichever
one breaks out FIRST is the one that turns the trend. A tool that tracks only the latest
rejection is late whenever the older one was closer to completing.
4. Both directions are always watched.
A single higher timeframe candle can reject a resistance and a support at the same time. Both
open a setup. The one that completes first turns the trend, and the other stays alive and can
turn it back afterwards. Nothing is switched off because of what the trend already says.
5. It shows its own reasoning.
The dashboard alone would be a black box. So for one row of your choosing the script draws the
whole chain on the chart: the level that was rejected, the candle that rejected it, the lower
timeframe candle that touched it, the level that was locked, and the candle that broke it. You
can check every reading against the candles yourself.
THE LEVELS
Every pair of consecutive candles leaves a level behind, priced at the CLOSE of the first candle
of the pair. Closes are used rather than wicks because a close is where the market actually
agreed on a price.
A candle is Green when close is greater than open and Red when close is less than open. A Doji,
where close equals open, is neither and forms no level.
A Level Green then Red sits above as resistance
V Level Red then Green sits below as support
Bullish Gap Green then Green sits below as support
Bearish Gap Red then Red sits above as resistance
From there each level lives on one of two sides, and every close through it flips it:
RBS Resistance Become Support a resistance a candle CLOSED above
SBR Support Become Resistance a support a candle CLOSED below
A level can flip any number of times. Each flip also makes it Fresh again, because in its new
role it has never been tested.
Fresh and Unfresh
Fresh newly created, or just flipped. Untested on the side it now sits on.
Unfresh price has already come back, touched it, and been turned away.
Only a Fresh level can produce a rejection. Once it turns Unfresh it stays quiet until a
breakout flips it and makes it Fresh again.
HOW ONE ROW DECIDES ITS TREND
Step 1 - the higher timeframe rejection
A higher timeframe candle reaches a Fresh level and fails to close through it.
Support side the LOW touches the level and the CLOSE stays above it
Resistance side the HIGH touches the level and the CLOSE stays below it
The level turns Unfresh, and that is the event the row acts on.
A close THROUGH the level is not a rejection. It is a breakout, it flips the level, and it
produces nothing. Breakout is always checked before rejection.
If one candle rejects several Fresh levels at once, the LOWEST is taken on the support side and
the HIGHEST on the resistance side - the level price actually reached.
Step 2 - the reference line
The rejection candle's OPEN becomes the reference point. On the lower timeframe this lands on
the candle that opens at the same moment, and that candle is the first one examined. Nothing to
the left of it is ever looked at again.
Step 3 - the touch candle
Moving forward from the reference point, the first lower timeframe candle that reaches the
rejected level is the touch candle. Reaching it is enough; it does not matter whether price
bounces or cuts through.
The touch candle splits the chart in two: everything left of it is External, everything right of
it is Internal.
Step 4 - lock the level to be broken
On the External side, take the nearest level of the opposite kind:
Buy side context the nearest A Level to the left, for an upward break
Sell side context the nearest V Level to the left, for a downward break
It does not need to be Fresh. Any A or V will do. Only A and V are used here - Gap, RBS and SBR
are not.
Step 5 - the breakout
On the Internal side, wait for a lower timeframe candle to CLOSE through the locked level.
Close above the locked A Level the row turns Bullish
Close below the locked V Level the row turns Bearish
A wick through it is not enough, and the touch candle can never confirm itself - the earliest a
row can turn is the candle after the touch.
There is no time limit on the wait.
WHEN SEVERAL SETUPS ARE WAITING
Each open setup carries its own rejected level, its own reference line, its own touch candle and
its own locked level. They all run at the same time.
Setup A rejected 4050, waiting for a close below 4000
Setup B rejected 4040, waiting for a close below 4010
Price reaches 4010 first, so setup B turns the row Bearish. The instant that happens the row is
Bearish, and setup A never gets its turn.
A setup ends in one of three ways: it confirms, the higher timeframe closes through the level it
came from - which flips that level and makes the rejection meaningless - or it is pushed out by
the pending cap.
TREND PERSISTENCE
Once a row is Bullish it stays Bullish until a Bearish confirmation completes, and the other way
round. There is no sideways or neutral state in between, and no expiry.
Before the very first confirmation on a symbol a row reads No Trend. After that it is always one
or the other.
READING THE CHART
The dashboard
Five rows, each with a coloured dot, the timeframe name and its current trend. Hovering a row
name shows which lower timeframe confirms it. Rows can be hidden individually.
The setup visualiser
For the row you select, the chain that produced its current trend is drawn in the trend colour:
a horizontal line the higher timeframe level that was rejected, labelled with the timeframe,
the level type and its price, starting at the candle whose close created it.
a vertical line the higher timeframe rejection candle.
a vertical line the lower timeframe touch candle.
a horizontal line the locked A or V level, labelled with its timeframe and price.
a vertical line the lower timeframe candle that broke it.
If a setup is still waiting, it is drawn the same way in the opposite colour with dashed lines,
so you can see what the row is waiting for next. Everything can be switched off if you only want
the table.
SETTINGS
Dashboard Settings
- Table Position and Table Size.
Engine Settings
- Max Stored Levels (per HTF): how many levels each timeframe keeps in memory. Older ones are
forgotten, so a rejection from a very old level is only seen while it is still inside this
window.
- Max Pending Setups (per side): how many setups may wait at once. When full, the oldest is
dropped.
- History Depth (bars per timeframe): how far back each engine runs. Bars older than this are
skipped, because the levels they create would have been pushed out of the level window long
before reaching the present. Lower it if the script is slow on a heavy symbol.
Dashboard Rows
- An individual switch for each of the five rows.
Colors
- Bullish, Bearish and No Trend colours, used by both the table and the visualiser.
Setup Visualiser
- Show Active Setup On Chart, the row to draw, and whether to also draw the setup still waiting.
ALERTS
Ten alert conditions, one per row per direction:
Monthly Trend Bullish / Bearish, Weekly Trend Bullish / Bearish, Daily Trend Bullish / Bearish,
H4 Trend Bullish / Bearish, H1 Trend Bullish / Bearish.
Each fires only when a row actually FLIPS, not on every bar. Each message carries the row, the
direction, the symbol and the closing price. The same messages are sent through the alert
function, so the "Any alert() function call" alert type delivers every flip through one alert.
One thing worth knowing: an alert can only fire on a bar of the chart it was created on. If you
create it on a Weekly chart, a row that flips twice inside that week produces one alert, not two.
Create alerts on a chart timeframe at or below M15 and nothing is missed.
REPAINTING
The values do not repaint.
- Every engine reads confirmed candles only. It works on the previous, already closed candle of
its own timeframe, so the candle still forming can never enter the calculation and cannot
change what has already been decided.
- Each candle is processed exactly once. A timestamp guard makes a second pass over the same
candle impossible.
- No request uses lookahead, so no calculation can see data that had not happened yet.
- A row's value changes only when a candle of the timeframe that decides it closes. Once a row
has turned, that reading does not change afterwards.
- Because the calculation is independent of the chart, the table reads the same whichever
timeframe you are on.
When you create an alert, TradingView may show a caution banner saying the indicator can repaint.
That banner appears automatically for any script that requests data from other timeframes, no
matter how carefully it is done, because the platform cannot check the intent behind the request.
NOTES AND LIMITATIONS
- Intended for intraday charts, roughly M1 up to H4. On Daily and higher, the M15 and M30
requests have to cover a very long range and TradingView may refuse them with a memory
error on symbols with deep history. There is nothing to gain from a high chart timeframe
anyway, as the table reads the same everywhere.
- The far left of the chart reads No Trend. Each engine starts from a fixed depth, so it needs a
stretch of candles before the first confirmation completes. This never affects the current
reading.
- Levels older than the Max Stored Levels window are forgotten. A rejection from a very old
level will not be seen once it has aged out.
- Detection is purely structural. It reports which way a timeframe has turned and why. It does
not rank readings by quality, measure what happened afterwards, or produce entries, targets
or stops.
HOW TO USE IT
Read the rows as a stack. When the slow rows agree, the market has one direction and the faster
rows tend to give pullbacks inside it. When they disagree, the faster rows are usually working
against the slower ones, and that is normally where the choppy trading is.
The visualiser is there so you never have to take a reading on faith. Point it at the row you
care about and the whole chain is on the chart: which level was rejected, when, where price
touched it, and exactly which level had to break. If a reading looks wrong, the drawing shows you
why it is what it is.
These are structural readings, not entry signals. Use them as direction and context alongside
your own levels, your own entry method and proper risk management.
DISCLAIMER
This indicator is a market structure analysis tool. It is not financial advice and it makes no
claim about profitability. Trading involves risk. Always apply your own analysis and risk
management. Indicador

Fibonacci Trend Continuation Signals [AlgoAlpha]🟠 OVERVIEW
Fibonacci Trend Continuation Signals maps Fibonacci retracement levels inside an adaptive trend structure. It combines a smoothed price midline, volatility-based outer bands, and Fibonacci ratios to show where price is trading within the current bullish or bearish trend range.
The trend changes only when price moves beyond a volatility-adjusted outer band. Once a direction is active, the script projects 0.236, 0.382, 0.500, 0.618, and 0.786 levels between the active outer band and the midline. This creates a moving Fibonacci framework that adjusts as price and volatility change.
Continuation signals appear when price closes back through an enabled Fibonacci level in the direction of the active trend. This lets traders use retracements within an established trend instead of treating each Fibonacci level as a fixed reversal point.
🟠 CONCEPTS
Trend Midline — An exponential moving average of closing price. It forms the central reference for the trend structure and the endpoint of the Fibonacci range.
Volatility Bands — Outer boundaries placed above and below the midline using a smoothed measure of the high-to-low price range. Price crossing an outer band changes the active trend direction.
Fibonacci Trend Range — The distance between the active outer band and the midline. In bullish trends, levels are measured upward from the lower band. In bearish trends, they are measured downward from the upper band.
Fibonacci Levels — The 0.236, 0.382, 0.500, 0.618, and 0.786 ratios divide the active trend range into retracement zones that move with the underlying trend structure.
Continuation Signal — A bullish signal occurs when price closes upward through an enabled Fibonacci level during a bullish trend. A bearish signal occurs when price closes downward through an enabled Fibonacci level during a bearish trend.
🟠 FEATURES
Adaptive Fibonacci Profile — Displays five configurable Fibonacci levels between the active volatility band and trend midline.
Trend Continuation Signals — Shows bullish and bearish markers when price closes through an enabled Fibonacci level in the direction of the active trend.
Current Level Labels — Shows the current price value of each enabled Fibonacci level at the latest bar.
Trend Change Markers — Marks the Fibonacci structure when a new bullish or bearish trend begins.
🟠 HOW TO USE
Identify the active trend structure — A bullish structure projects Fibonacci levels from the lower band toward the midline, while a bearish structure projects them from the upper band toward the midline.
Watch price during a retracement — Use the displayed Fibonacci zones to see how far price has moved through the active trend range.
Look for continuation signals — An upward triangle shows that price crossed above an enabled Fibonacci level during a bullish trend. A downward triangle shows the equivalent bearish close below a level.
Compare signals with price structure — Use nearby swing points, support, resistance, or your existing confirmation method before acting on a continuation signal.
Adjust Midline Length, Pivot Length, and Band Width to control how quickly the trend framework responds to price and how wide its outer boundaries are.
Enable or disable individual Fibonacci levels to keep only the retracement levels relevant to your method.
🟠 CONCLUSION
Fibonacci Trend Continuation Signals combines volatility-based trend detection with adaptive Fibonacci retracement levels and directional continuation signals. It gives traders a moving reference for measuring pullbacks and identifying closes that resume movement in the active trend direction. Indicador

Multi-MA Trend Ribbon [MarkitTick]💡 A fully adaptive moving-average ribbon that lets you choose from 30 different smoothing algorithms — from classic SMA/EMA to advanced adaptive filters like Kalman, JMA, KAMA, and a custom volatility-responsive method called LLAMA — then builds a multi-line, gradient-colored trend ribbon out of that single chosen method across up to 8 progressively longer lengths. Layered on top is an optional multi-timeframe bias filter, an ADX strength gate, a volume confirmation gate, webhook-ready JSON alerts, and a live diagnostic dashboard.
✨ Originality and Utility
Most ribbon-style indicators on the platform hard-code a single averaging method (usually EMA or HMA) and stack a handful of fixed lengths on the chart. This script takes a different approach: it treats the "ribbon" as a generic container and the "moving average type" as a fully interchangeable engine, with 30 distinct algorithms available from a single dropdown, all built from first principles (not by calling a bundle of pre-packaged libraries). Because every ribbon line is generated by the same underlying function at different lengths, switching the MA Type instantly re-renders the entire ribbon in the new smoothing style, giving traders a single tool to compare how trend-following behaves under drastically different mathematical assumptions (linear vs. exponential weighting, adaptive vs. fixed responsiveness, zero-lag vs. standard lag) without switching indicators.
The script's originality centers on three custom-built components not found in standard built-ins:
A proprietary adaptive length mechanism ("LLAMA") that dynamically expands or contracts each ribbon line's effective lookback based on a short-term directional forecast, rather than using a static length.
A dual-RSI-divergence-weighted directional predictor that feeds that adaptive length engine.
A from-scratch implementation of less commonly available filters (Kalman, JMA, FRAMA, T3, McGinley, Super Smoother) that are not native Pine built-ins, giving traders access to algorithms usually reserved for institutional charting platforms or custom research code.
The mashup of a trend ribbon, a confluence filter stack (ADX + HTF + Volume), and a webhook alert system is justified because these three layers solve three different practical problems traders face together: identifying trend direction (ribbon), avoiding low-quality signals in choppy or thin conditions (filters), and automating execution (alerts) — components that are commonly used in sequence by discretionary and systematic traders alike, making their integration into one tool a genuine workflow simplification rather than an arbitrary bundling.
🔬 Methodology and Concepts
● Core Ribbon Construction
The script computes eight moving averages of the same source (default: close) at lengths that increase by a fixed step from a base length. For example, with a Base of 20 and a Step of 10, the eight lengths used are 20, 30, 40, 50, 60, 70, 80, and 90. The fastest line (MA1) and the slowest visible line (determined by the Lines setting) are compared: when the fast line sits above the slow line, the ribbon is considered to be in a bullish regime; when below, bearish. All eight lines are generated by the exact same averaging function, so the "shape" of the ribbon (how tightly or loosely the lines fan out) becomes a visual proxy for trend strength and consistency across time horizons.
● Selectable Smoothing Engine
The Type input lets you choose the mathematical method used to compute every single line in the ribbon simultaneously. The available families are:
Classic weighted averages: SMA, EMA, RMA (Wilder's smoothing), WMA, Triangular (TRIMA), Volume-Weighted (VWMA), and their double/triple-smoothed variants (DWMA/TWMA, DVWMA/TVWMA) which apply the same weighting function recursively to reduce lag-vs-noise trade-offs.
Zero/reduced-lag filters: Hull MA (HMA) and its extended variants EHMA and THMA, DEMA and TEMA (double/triple exponential smoothing, per Patrick Mulloy's original error-correction concept), and ZLEMA (zero-lag EMA using a momentum-shifted input).
Adaptive/volatility-responsive filters: KAMA (Kaufman's Adaptive MA, which speeds up or slows down based on an efficiency ratio of net movement to total movement), VIDYA (Chande's Variable Index Dynamic Average, which scales its responsiveness using Chande Momentum Oscillator readings), FRAMA (Ehlers' Fractal Adaptive MA, which estimates a fractal dimension from recent high/low ranges to adjust smoothing), and JMA (a Jurik-style adaptive filter using a two-stage predictive/corrective recursive structure).
Specialized/legacy filters: T3 (Tillson's six-pole exponential blend using a volume factor to control overshoot), McGinley Dynamic (a self-adjusting average that speeds up during fast markets and slows down during consolidation via a ratio-based denominator), ALMA (Arnaud Legoux MA, a Gaussian-weighted average with adjustable offset and smoothness), LSMA (least-squares linear regression endpoint), SWMA (a fixed symmetric 4-bar weighted average), Median, and SSF (a two-pole Super Smoother Filter using an Ehlers-style recursive IIR design).
Proprietary adaptive engine — LLAMA: A custom exponential filter whose smoothing constant is derived not from a fixed length, but from a dynamically computed effective length (see below).
• LLAMA and the Directional Predictor
LLAMA (the script's custom adaptive method) works in two stages. First, a directional forecast is built from two RSI readings (14-period and 28-period). Over a lookback window, each prior bar is scored by how closely its RSI signature matches the current bar's RSI signature (using a log-distance similarity weighting), and that similarity is used to weight whether price rose or fell on that historical bar. The weighted average of those historical outcomes produces a forecast value between -1 (strongly bearish precedent) and +1 (strongly bullish precedent). Second, that forecast value is used to stretch or compress each ribbon line's effective length within a configurable percentage range around its base length — a stronger bullish or bearish forecast pushes the effective length toward one end of the range, changing how reactive that specific line is to new price action. This effective length is then converted into a standard exponential smoothing constant to produce the final LLAMA value. The result is a moving average that behaves less like a fixed-parameter tool and more like a filter that continuously recalibrates its own sensitivity based on recent directional evidence.
● Trend Signals
Two categories of signals are generated:
Ribbon Flips: Triggered when the relationship between the fastest line and the slowest visible line changes state (fast crosses from below to above the slow line, or vice versa), using confirmed prior-bar values to avoid intrabar flicker.
Price Crosses: Triggered when price itself crosses the fastest ribbon line (MA1), independent of the broader ribbon state, offering an earlier but noisier entry cue.
● Confluence Filters
Three optional, independently toggleable filters can be layered onto both signal types to suppress low-quality triggers:
ADX Strength Filter: Requires Wilder's Average Directional Index (calculated via the standard DMI/ADX formula) to be above a minimum threshold before a signal is allowed to fire, filtering out signals generated during weak or range-bound conditions.
Higher-Timeframe Bias Filter: Recomputes the entire ribbon logic (fast MA vs. slow MA) on a user-selected higher timeframe and requires the current-timeframe signal to agree with that higher-timeframe bias before firing. This uses a confirmed prior-bar value pulled via request.security() with lookahead explicitly enabled on historical (already-closed) data only, so no future information leaks into the calculation.
Volume Confirmation Filter: Requires the prior bar's volume to exceed a multiple of its recent average volume, ensuring signals are backed by above-average participation rather than occurring on thin, low-conviction bars.
🎨 Visual Guide
Ribbon Lines (MA1–MA8): Up to eight plotted lines, one per configured length, colored on a gradient. When Trend Col is enabled, the gradient runs between your chosen Bull and Bear colors depending on the current trend state; when disabled, it instead runs between the Fast and Slow colors you've set, regardless of trend direction.
Ribbon Fill: The semi-transparent shaded area between each consecutive pair of ribbon lines, colored to match the current trend (bull or bear color) with adjustable transparency via the Fill Transparency setting. A tightly compressed, thin fill indicates the ribbon lines are converging (potential consolidation or transition); a wide, expanded fill indicates strong trend separation.
Bull/Bear Flip Markers: Small triangle shapes below or above the bars marking the exact bar where a confirmed Ribbon Flip occurred — an upward triangle in your Bull color for bullish flips, a downward triangle in your Bear color for bearish flips.
Heatmap Candles (optional): When enabled, replaces standard candle coloring with your chosen Bull/Bear body and border colors based on the ribbon's current trend state, turning the entire chart into an at-a-glance trend heatmap.
Dashboard Table: An on-chart panel (position configurable) summarizing, in real time: signal lock status, current bias, active MA type and lengths, a visual bar-graph readout of the number of active ribbon lines, the fast and slow MA values, the current spread between them, the LLAMA directional prediction strength, the most recent flip direction, the most recent price cross direction, how many filters are currently active, the live ADX reading, the +DI/-DI values, the current volume ratio versus average, and the higher-timeframe bias state.
📖 How to Use
Use the overall ribbon color and fill (bull color vs. bear color) as your primary trend read: a consistently bull-colored, moderately expanded ribbon suggests sustained upward momentum, while contraction or color-flipping suggests indecision.
Treat triangle Flip markers as your core trend-change signal — they only appear once the flip has been confirmed on a closed bar, and (if filters are enabled) only after passing your chosen strength, HTF-agreement, and volume conditions.
Treat Price Cross events (visible in the dashboard's "Price Cross" row) as a faster, more aggressive alternative entry cue for traders who want to react before a full ribbon flip occurs, understanding this comes with a higher likelihood of false signals.
Enable the Lock Signal option to freeze the current bias and temporarily suspend new signal generation — useful when you want to hold a view steady while manually reviewing a setup instead of reacting to every subsequent flip.
Watch the dashboard's Filters and individual ADX / Vol Ratio / HTF Bias rows to understand in real time why a signal is or is not being permitted to fire.
Consider combining a slower Type (e.g., RMA, T3, or a longer-length adaptive filter) for the overall bias with faster Price Cross signals for tactical entries within that bias.
⚙️ Inputs and Settings
Type: Selects which of the 30 supported averaging methods is used to build every line in the ribbon.
Src: The price source fed into all calculations (default: close).
Base / Step: Base sets the length of the fastest ribbon line; Step sets the length increment applied to each subsequent line. Together they define the full spread of lengths across the ribbon.
Shift: Applies a horizontal bar offset to all plotted ribbon lines. A non-zero value shifts the visual plot forward or backward relative to price and does not alter the underlying calculation.
Lines: Sets how many of the eight possible ribbon lines are displayed (2–8), which also determines which line is treated as the "slow" reference line for bias and flip calculations.
ALMA Off / ALMA Sig, T3 Vf, KAMA Fast / KAMA Slow, JMA Phase / JMA Pow, Kal Q / Kal R, LLAMA LB / LLAMA Rng: Method-specific tuning parameters that only take effect when the corresponding Type is selected — these control offset/smoothness for ALMA, volume factor for T3, the fast/slow efficiency bounds for KAMA, phase/power for JMA, process/measurement noise for Kalman, and lookback/range for the custom LLAMA engine.
ADX / HTF / Vol toggles and their sub-settings: Independently enable and configure the three confluence filters described in the Methodology section (strength threshold and length for ADX, target timeframe for HTF, lookback length and multiplier for Volume).
Lock Signal: Freezes the currently displayed bias and suppresses new flip/cross signals until disabled.
Trend Col / Fill / Fill Transparency / Width / Bars / Signals: Visual controls for whether ribbon coloring reflects trend state, whether the fill between lines is shown and how transparent it is, line thickness, whether heatmap candles are shown, and whether flip markers are plotted.
Dashboard Show / Position: Toggles the on-chart dashboard and sets its screen position.
Alert toggles and Action fields: Enable/disable Flip-based and Cross-based alerts independently, and customize the text string sent in each alert's JSON payload for long entry, short entry, close-long, close-short, cross-up, and cross-down events — designed to be dropped directly into webhook-based automation.
⚠️ Confirmation Lag Notice
The Shift input allows ribbon lines to be plotted with a backward or forward bar offset relative to the current price bar. When a non-zero Shift value is used, what you see plotted at a given bar's x-position does not represent that bar's actual calculated value in real time — always verify the Shift setting is at its default (0) if you intend to use the ribbon for real-time signal interpretation, and be aware that a non-zero offset can visually misrepresent how early or late a line's response to price actually was.
🔍 Deconstruction of the Underlying Scientific and Academic Framework
This script draws on several distinct threads of technical and quantitative theory:
Classical trend-following theory: The core "fast MA vs. slow MA" bias mechanism traces back to Dow Theory's premise that trend direction can be inferred by comparing price behavior across different time horizons — approximated here by comparing smoothed averages of different lengths rather than raw price.
Exponential smoothing and digital filter theory: Methods like EMA, DEMA, TEMA, and ZLEMA build on Patrick Mulloy's work on reducing the inherent lag of exponential moving averages through cascaded and momentum-adjusted smoothing, itself grounded in classical infinite impulse response (IIR) filter design from signal processing.
Adaptive filter theory: KAMA (Kaufman), VIDYA (Chande), and FRAMA (Ehlers) all apply the same broader principle from adaptive control theory — that a filter's time constant should not be fixed but should respond to a real-time measurement of market "efficiency" or "noise," whether measured via a directional efficiency ratio, momentum oscillator magnitude, or fractal dimension of price geometry.
State-space estimation theory: The Kalman filter option applies the classical Kalman filtering framework from control and estimation theory — treating the true underlying trend as a hidden state to be recursively estimated from noisy price observations, balancing a process-noise parameter (how much the true state is expected to drift) against a measurement-noise parameter (how much to trust each new observation).
Fractal market theory: FRAMA's dimension calculation is grounded in Mandelbrot's fractal geometry concepts as adapted by John Ehlers, using the scaling relationship between price range measured at different resolutions to infer whether the market is behaving more like a trending (lower fractal dimension) or random-walk (higher fractal dimension) process.
Directional Movement / trend strength theory: The ADX filter implements Welles Wilder's original Directional Movement System, which decomposes price movement into positive and negative directional components and derives a smoothed strength index from their divergence.
Weighted similarity / kernel-based forecasting: The custom LLAMA predictor's weighting scheme is conceptually related to kernel-weighted (locally weighted) regression and nearest-neighbor forecasting methods, in which historical observations are weighted by their similarity to current conditions (here, measured via RSI-signature distance) rather than treated with uniform recency weighting.
⚠️ Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. We expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion. Indicador

Hull ALMAHull ALMA | MisinkoMaster
The Hull ALMA (HALMA) is a low-lag, hybrid moving average engineered to solve one of technical analysis's oldest trade-offs: lag versus smoothness. Classical moving averages like the SMA or EMA suffer from heavy lag during fast trend changes, while ultra-responsive averages like the standard Hull Moving Average (HMA) are notoriously prone to overshooting and producing sharp noise during sideways consolidation.
By replacing the weighted moving average core of the classic Hull algorithm with Arnaud Legoux Moving Averages (ALMA), the Hull ALMA eliminates lag through Gaussian-weighted smoothing rather than simple linear weighting. The result is a fluid, low-latency trend line that tracks price shifts rapidly while filtering out false breakouts and market noise.
How It Works (The Core Architecture)
The indicator combines the mathematical structure of the Hull transformation with Gaussian curve filtering:
Half-Length and Full-Length Gaussian Smoothing: The algorithm calculates two baseline ALMAs—one over half the lookback period (hln_halma) and one over the full lookback period (len_halma).
Lag Reduction Transformation: Following the classic Hull formulation, the full-period ALMA is subtracted from twice the half-period ALMA (2 * ALMA_half - ALMA_full) to project price direction forward and neutralize lag.
Square-Root Gaussian Smoothing: The projected series is smoothed a final time using an ALMA calculated over the square root of the lookback period (sln_halma), producing an ultra-smooth curve without introducing phase delay.
Dual-Confirmation Trend Filter: The algorithm concurrently tracks standard HMA slope alongside HALMA slope to ensure structural alignment before confirming regime shifts.
Key Features
Gaussian-Weighted Lag Elimination: Replaces linear weighting with ALMA's Gaussian curve distribution, providing superior smoothness and reduced overshoot.
Dual-Moving-Average Confluence: Evaluates both HALMA and HMA slope agreement to confirm high-probability trend direction.
On-Chart Candle Morphing: Automatically recolors main price candles (vibrant cyan for bullish trends, vivid red for bearish trends) to maintain clear visual alignment with active indicator state.
Multi-Line Overlay: Plots both the primary HALMA curve and the complementary HMA baseline directly on your price pane for easy visualization of moving average dynamics.
Input Parameters & Optimization Guide
Source: Sets the input price series used for calculations (Default: OHLC4).
HALMA Length: Sets the baseline lookback window. A default of 70 bars balances macro trend tracking with short-term responsiveness (Default: 70).
Offset: Controls the Gaussian distribution offset within the ALMA engine. Higher values increase responsiveness to recent price changes (Default: 0.85).
Sigma: Controls the width of the Gaussian filter. Higher values sharpen the smoothing focus, while lower values broaden the window (Default: 6).
Trading Strategies & Execution
Dual-Slope Regime Shifts
Bullish Alignment: Confirmed when both the HALMA and standard HMA are sloping upward, turning price chart candles cyan.
Bearish Alignment: Confirmed when both the HALMA and standard HMA are sloping downward, turning price chart candles red.
Dynamic Support & Resistance
In established trends, the HALMA line serves as dynamic trailing support during bull moves and dynamic resistance during bear moves. Look for pullbacks toward the HALMA curve for low-risk continuation entries in the direction of the active trend state.
Disclaimer: Trading financial markets involves high risk. This technical script is designed as an informational analytical tool to support your rule-based mechanical execution system and does not constitute financial advice. Indicador

Setup Scanner [GBB]SETUP SCANNER
Most scanners tell you a setup fired and stop there. This one attaches a full trade plan to every signal: ATR stop, three R-multiple targets, an expiry and then tracks the outcome and keeps score per setup. New strategies can also be easily added to the scanner, so you do not have 20 different chart tabs open anymore at the same time.
How does it work?
On every confirmed bar the script evaluates six independent setups. Each one reports a state in the panel: off, dormant, forming, LONG or SHORT.
When a setup fires, a simulated trade opens at the close of the signal bar with:
- a stop at ATR(14) × 1.2 (configurable)
- TP1 / TP2 / TP3 at 1R / 2R / 3R
- an expiry after 60 bars
The trade is drawn as a risk box, a reward box, an entry line and a three-rung target ladder. As targets fill, their rungs promote from dashed to solid, so you can read how far a trade got at a glance. When it resolves, the whole drawing fades and gets an outcome tag: stop, TP3, or expired.
The panel counts, per setup, how many trades it opened and what share of them reached TP1.
Included Strategies in v1.0:
1. VWAP RECLAIM
Price must spend at least N consecutive closes (default 6) on one side of session VWAP, then close back across it. Volume filter applies. Forming state triggers when the run is mature and price is drifting back within 0.4 ATR of VWAP.
2. EMA PULLBACK (9/21)
Trend is defined by EMA21 vs EMA50 with EMA50 sloping in the same direction over three bars. Price must have touched EMA21 within the last N bars (default 3), then close back beyond EMA9 on a directional bar that takes out the previous bar's extreme. Volume filter applies.
3. BREAK AND RETEST
A confirmed swing pivot (length 5 either side) is broken on a close. Within the retest window (default 20 bars), price returns to within 0.3 ATR of the broken level and closes back beyond it on a directional bar. Pivots that form while a break is still live are queued rather than overwriting the level — the retest gets to finish before the reference moves. No volume filter.
4. LIQUIDITY SWEEP REVERSAL
A wick takes out the highest high or lowest low of the last 20 bars, the body closes back inside, and the rejection wick is larger than the opposite wick. Volume filter applies.
5. RSI DIVERGENCE
Consecutive confirmed pivots with a lower price low against a higher RSI low (or the inverse for shorts), within a maximum pivot gap of 60 bars. This confirms five bars after the pivot by construction. It is late, on purpose, and it has no forming state.
6. OPENING RANGE BREAK
The range is built from the session open for N minutes (default 15) in your chosen session and timezone, then the first close beyond either edge fires. One break per session, in either direction. The range levels plot once the range closes. For 24h crypto, set the timezone to UTC and pick your own anchor session.
TRADE COUNTING
Entry is the close of the signal bar. Risk is one ATR unit × the stop multiple, and the ladder is measured in multiples of that risk.
Exit accounting is deliberately conservative. If a bar touches both the stop and a target, the stop wins — intrabar sequence is unknowable from OHLC, so the outcome is on purpose counted as pessimistic. A trade that reaches TP1 or TP2 marks the rung and keeps running, only TP3 or the stop or the expiry closes it.
Three controls decide which signals become trades:
- Max concurrent trades (default 1)
- Block opposite-direction entries (default on)
- Re-entry cooldown in bars (default 0)
With the default of one concurrent trade, setups are evaluated in a fixed order — VWAP, EMA, break and retest, sweep, divergence, opening range — so when two fire on the same bar, the earlier one in that order takes the slot. Turn on "Mark blocked signals too" if you want to see the ones the limit swallowed.
The cooldown defaults to 0, which keeps every signal. That is why stops sometimes cluster back to back on an impulse bar. Raising it changes the record, so reset your counts when you change it.
READING THE SCOREBOARD — AND WHAT IT IS NOT
The "fired" column counts trades the engine actually opened, not raw setup fires. Signals blocked by the concurrency limit, the direction lock or the cooldown are not counted.
The "→TP1" column is trades that reached TP1 divided by trades fired. Reached, not captured: a trade that touches TP1 and later stops out still counts in the numerator. Read it as "how often does this setup get moving in my favour", not as a win rate and definitely not as an expectancy.
IMPORTANT
This is not a backtest. Counts accumulate forward over the bars loaded on your chart, they reset on every settings change and chart reload, and they include no commission, no spread, no slippage and no partial fills.
DEFAULTS AND TUNING
The defaults are not optimised. They are round numbers chosen to be readable and to avoid fitting a parameter set to whatever symbol happened to be on the chart during development. The ATR stop, the R ladder, the pivot length and the setup-specific windows are all exposed so you can adapt them to your instrument and timeframe, but every change invalidates the counts already on the panel.
If you tune, tune on one instrument at a time, and treat any improvement that does not survive on data you did not tune on as noise.
DISPLAY
- Trade zones can be turned off entirely if you only want the panel.
- Signal labels come in Full, Short, Arrow only, or Off.
- Closed trades fade by an adjustable amount; filled targets always fade less than unfilled ones, so a resolved trade still shows how far it ran.
- Keep last N drawings caps the chart clutter without affecting the counts.
- Panel position and text size are configurable; colours default to a dark-chart palette and should be dimmed for white backgrounds.
ALERTS
Every trade the engine opens fires an alert() call carrying the setup name, direction and price, once per bar close. Two alertcondition entries are also available for any long setup and any short setup. Note that those fire on the raw signal, whether or not the engine had room to take it.
LIMITATIONS
- Signals evaluate on confirmed bars only. Nothing is drawn or counted on an unclosed bar.
- Break and retest and divergence depend on pivots, which confirm five bars after the fact.
- The VWAP setup requires volume data and stays dormant on symbols that have none. The volume filter also passes automatically where volume is unavailable.
- The opening range setup depends on your session and timezone inputs being correct for the instrument.
- Designed for intraday timeframes. It will run on higher timeframes but the trade model and expiry are not calibrated for them.
Indicador

MTF S&R Confluence DetectorMTF S&R Confluence Detector
OVERVIEW
MTF S&R Confluence Detector automatically maps support and resistance across three independently configurable timeframes, then highlights the spots where those levels stack on top of one another. Confluence — the alignment of multiple structural levels in the same price area — is one of the more reliable ways to identify zones where price is likely to react, and this script does the work of tracking it in real time instead of requiring you to flip between chart timeframes and eyeball it yourself.
Alongside the multi-timeframe pivots, the script also plots Previous Day High/Low and Today's High/Low, and checks those session levels for confluence with your MTF pivots — surfacing "high conviction" areas where intraday structure and prior-session structure line up.
Built and tested on Pine Script v6.
HOW IT WORKS
For each of the three timeframes, the script finds swing highs and swing lows using pivot detection (ta.pivothigh / ta.pivotlow) with independently adjustable lookback and lookahead periods. Each pivot is only confirmed once price has moved the required number of bars past it, so the levels you see are based on confirmed swing points, not predictions.
The most recently confirmed support and resistance level from each timeframe is held on the chart as a line until a new pivot forms and replaces it. A percentage-based "range" is drawn around each level (also configurable per timeframe) to represent a zone rather than a single exact price.
CONFLUENCE DETECTION
The script compares the current support level (and separately, the current resistance level) across all three timeframes. If two levels sit within your chosen confluence threshold (a percentage distance you control), they're flagged as confluent and both lines turn gold. If all three timeframes agree, that's flagged as a "triple confluence" — the strongest signal the script can produce. Confluent zones also get a soft gold fill so they stand out visually from ordinary single-timeframe levels.
The same confluence logic is applied to Previous Day High/Low against your MTF levels, so you can immediately see when a prior session extreme is reinforced by higher-timeframe structure.
KEY FEATURES
- Three independent, fully configurable timeframes for support/resistance detection (defaults: 1H, 4H, Daily)
- Adjustable pivot lookback/lookahead for support and resistance detection separately
- Per-timeframe color, and adjustable percentage "zone" width around each level
- Automatic confluence detection between any two timeframes, plus triple-confluence detection
- Adjustable confluence threshold (%) to control how close levels need to be to count as aligned
- Gold highlighting and zone fills on confluent levels so they stand out at a glance
- Previous Day High/Low and Today's High/Low overlays, each independently toggleable
- Increasing visual weight by timeframe — the highest timeframe is drawn thicker and dashed so higher-timeframe structure reads as more significant
- Clean price-scale labels identifying which timeframe each level belongs to
ALERTS
The indicator ships with a full set of ready-to-use alert conditions, including:
- Pairwise support/resistance confluence for every timeframe combination
- Triple confluence (all three timeframes aligned) for both support and resistance
- Price entering a confluent support or resistance zone
- Price breaking above Previous Day High or below Previous Day Low
- Price making a new session high or low
- Previous Day High/Low aligning with multi-timeframe resistance/support (high-conviction setups)
HOW TO USE IT
1. Set your three timeframes under the "Timeframe 1/2/3" input groups. By default these are 1H, 4H, and Daily, but you can set them to whatever combination fits your trading style (e.g., 15m/1H/4H for intraday, or 4H/D/W for swing trading).
2. Tune the pivot lookback/lookahead under "S&R Detection" to control how sensitive the swing detection is — shorter values find levels faster but produce more of them; longer values are more selective.
3. Adjust the "Confluence Threshold" to set how close levels from different timeframes need to be before they're treated as the same zone. Tighter for precision, wider to catch near-misses.
4. Toggle Previous Day High/Low and Today's High/Low on or off depending on whether you trade session-based levels.
5. Set alerts on any of the built-in alert conditions to get notified the moment a confluence zone forms or price reaches one.
NOTES
- Support and resistance levels are based on confirmed pivots — a pivot only appears after the lookahead period has elapsed, which is standard practice for pivot-based tools and avoids false, unconfirmed levels, but it also means levels are inherently a few bars behind the most recent swing.
- Because the script pulls data from higher timeframes via request.security, values on historical bars from an unclosed higher-timeframe candle can adjust intrabar until that higher-timeframe candle closes — as with any multi-timeframe tool, always wait for confirmation on the current higher-timeframe bar before treating a fresh level as final.
- This indicator is a visual and analytical tool for identifying areas of interest; it does not generate buy or sell signals and should be combined with your own risk management and analysis. Nothing here is financial advice. Indicador

Previous Day, Week & Month Levels [ITA]🟠 OVERVIEW
Previous Day, Week & Month Levels plots the high and low of each completed higher timeframe period and keeps them on the chart until price trades through them. Once a level is taken, it fades to grey instead of disappearing, so the chart separates liquidity that is still resting from liquidity that has already been collected.
The indicator covers daily, weekly and monthly periods independently, with optional midpoints for each range. This lets an intraday trader run daily levels alone, or stack all three groups to see how short-term and higher timeframe references line up.
🟠 CONCEPTS
* Previous Level - The high or low of the last completed daily, weekly or monthly candle, pulled from the higher timeframe regardless of the chart timeframe in use.
* Untaken Level - A level that price has not traded through since its period closed. Drawn at full opacity because the orders resting behind it are still there.
* Taken Level - A level that price has traded through during the current period. Recolored grey to show the liquidity has been collected and the level has lost its role as a target.
* Level Reset - Each group tracks its own taken state and resets when a new period begins. Daily flags clear every session while weekly and monthly flags run on their own cycles.
* Midpoint - The 50% level of a previous range, marking the equilibrium of that period rather than its extremes.
🟠 FEATURES
* Multi-Period Levels - Plots previous day, week and month highs and lows, each group toggleable on its own.
* Taken Level Fading - Automatically recolors any level that price trades through, leaving untouched levels highlighted.
* Optional Midpoints - Adds the 50% level of each enabled range for equilibrium reference.
* Level Labels - Tags each line with its name on the right edge of the chart, with configurable size.
* Level Alerts - Fires when price trades above a previous high or below a previous low.
🟠 HOW TO USE
* Run daily levels alone for intraday work, or enable weekly and monthly for a broader structural view.
* Treat bright levels as unfinished business and faded levels as history. What stays highlighted is where liquidity has not yet been taken.
* Watch for clusters where a daily level sits close to a weekly one. A single move that clears both tends to produce a sharper reaction than clearing either alone.
* Use midpoints as a filter. Price rotating around the midpoint of the previous day often points to balance rather than direction.
* Adjust Extend Right if the levels project too far past the current candle or stop short of it.
🟠 CONCLUSION
Previous Day, Week & Month Levels combines multi-period reference levels with automatic tracking of which levels have already been traded through. Instead of showing every level identically, it separates active liquidity from collected liquidity, giving traders a clear view of which reference points are still relevant to the current session. Indicador

TrendShift | Supertrend + ADX Regime-Adaptive StrategyOverview
Most Supertrend strategies use one fixed ATR multiplier for every market condition — which means it's either too tight (whipsawed in chop) or too wide (late to catch real trends). TrendShift fixes this by reading market regime in real time with ADX and automatically shifting the Supertrend multiplier to match: tight and responsive when the market is trending, wide and defensive (or disabled entirely) when it's choppy. The strategy essentially "changes gears" as conditions change, and shows you exactly which gear it's in.
Features
ADX-based regime detection — classifies the market as Trending, Choppy, or Neutral, with a built-in hysteresis zone so the regime doesn't flicker back and forth near the threshold.
Dynamic Supertrend multiplier — automatically tightens (fast entries) in trends and widens (fewer false signals) in chop, recalculated live every bar.
Signal gating — Supertrend flips during choppy conditions are suppressed by default; no trades fire on noise.
Risk-based position sizing — every trade risks a fixed % of equity, sized off the actual stop distance (the Supertrend line), so trade size adapts to current volatility automatically.
Trailing stop + optional R-multiple take profit — the Supertrend line itself trails the stop; an optional fixed reward-to-risk target can close the trade early.
Optional chop-flatten & max-bars-in-trade exits — extra safety nets for getting out of dead trades.
Clean, glowing trend line with gradient fill — colored green/red by direction, turns gray and flat in chop, with minimal arrow labels only on actual signal flips (no clutter).
Live dashboard — a small on-chart table showing current Regime, ADX value, Active Multiplier, and Position status, so you can literally watch the strategy shift gears.
How it works
ADX is calculated each bar and compared against two thresholds (default: 25 trending / 20 choppy).
Based on that regime, the strategy picks a tight multiplier (trending) or a wide one (choppy) for the Supertrend calculation — held steady in the neutral zone to avoid jitter.
Supertrend is recalculated using this adaptive multiplier, and a flip in trend direction becomes a trade signal only if the current regime allows new entries.
Position size is calculated from your risk % input and the distance from price to the Supertrend line, so every trade risks roughly the same account %, regardless of how wide the current band is.
The Supertrend line trails your stop; an optional R-multiple limit order banks profit early if enabled.
Tips
Start with the default ADX thresholds (20/25) and multipliers (1.75 tight / 4.5 wide) — they're tuned to be reasonable across timeframes, but always re-check on your specific instrument.
On lower timeframes or noisier symbols, consider raising the choppy threshold or widening the "wide" multiplier further — chop is more common intraday.
Leave "Disable new entries in choppy regime" ON for cleaner equity curves; turn it off if you want to see how the strategy performs without the filter (useful for comparison).
The dashboard's ADX/Multiplier readout is the fastest way to sanity-check whether the strategy is behaving as expected on a given chart — if it feels like it's not trading, check whether it's stuck in "CHOPPY."
Combine with your own higher-timeframe bias filter if you want extra confluence; the strategy doesn't currently check higher-timeframe trend.
This is a strategy script (has backtest results), not just a visual indicator — use the Strategy Tester tab to evaluate performance before live use.
Estratégia

RS Leader - Early Breakout RadarRS Leader - Early Breakout Radar identifies stocks demonstrating exceptional relative strength before a conventional price breakout occurs.
The indicator compares the current symbol with a selectable market benchmark, using SPY by default. It searches for situations in which the relative-strength ratio is near a long-term high while the stock remains in a tight consolidation beneath its previous price high. This combination can help identify securities outperforming the broader market before that leadership becomes obvious from price alone.
RS Leader is different from the RSI oscillator. Its relative-strength calculation is:
Stock Price ÷ Benchmark Price
RS Leader Score
Each stock receives a dynamic score from 1 to 100:
• Relative-strength leadership: 40 points
• Proximity to the breakout level: 20 points
• Price-range contraction: 15 points
• Moving-average structure: 15 points
• Volume behavior: 10 points
A default minimum score of 70 is required before an RS Leader signal can appear. All requirements and scoring thresholds can be adjusted in the indicator settings.
Signal Interpretation
• Blue RS LEADER label: Relative strength is near a long-term high while price remains tightly consolidated below resistance.
• Blue line: The nearby price level that must be exceeded for a potential breakout.
• Green BREAKOUT label: Price closed above the prior resistance level following an active RS Leader setup.
• Blue background shading: Optional highlighting of bars that currently satisfy the complete setup.
Dashboard Colors
• Green: Condition is favorable or confirmed.
• Blue: An active RS Leader setup meets the minimum score.
• Orange: Condition is developing, neutral or requires caution.
• Red: Condition is not currently satisfied.
The dashboard displays the current RS Leader Score, relative-strength status, distance from the price high, consolidation width, moving-average alignment, relative volume and selected benchmark.
The indicator uses confirmed closing-bar information and does not intentionally use future data. Signals can still fail, and historical relationships do not guarantee future results. Relative strength may deteriorate, apparent breakouts may reverse, and market or company-specific events can materially affect price behavior.
RS Leader is provided solely for educational and informational purposes. It does not constitute investment advice, a recommendation to buy or sell any security, or a guarantee of future performance. Users should independently evaluate market conditions, liquidity, earnings dates, volatility and personal risk tolerance before making any financial decision. Indicador

Trend Quality Index [StrixEDGE]📊 WHAT IT DOES
StrixEDGE Trend Quality Index answers the question most trend indicators ignore: not just whether a trend exists, but how good it is. It produces a 0-100 composite score measuring trend quality across four dimensions — velocity, strength, clarity, and multi-timeframe agreement.
🔬 WHY IT'S DIFFERENT
ADX tells you trend strength. Supertrend tells you direction. Neither tells you the complete quality picture. TQI combines four independent metrics: LSMA velocity (how fast the trend moves), ADX with DI gap analysis (how strong and directionally clear), Vortex Indicator separation (how unambiguous the direction), and triple Supertrend agreement (how many timeframe perspectives agree). A trend scoring 90+ on all four dimensions is far more tradeable than one scoring well on just one.
⚙️ HOW IT WORKS
Four scores, each 0-25 points, summed and smoothed:
• LSMA Velocity: Linear regression slope speed, normalized by ATR. Faster trends score higher.
• ADX Strength: ADX value mapped to 0-20, plus a bonus for wide DI+/DI- gap (clearer direction).
• Vortex Clarity: Distance between VI+ and VI- lines. Wider = more decisive trend.
• Supertrend Agreement: Three Supertrends (fast/medium/slow) — all aligned = 25, two = 15, split = 5.
📈 HOW TO USE
• TQI 80-100: EXCELLENT — aggressive trend-following, wide targets
• TQI 60-80: GOOD — standard trend trades, normal position sizing
• TQI 40-60: FAIR — cautious entries, tight stops, reduced size
• TQI below 40: POOR — avoid trend strategies, consider range setups instead
• Direction arrows show which way the quality trend points
🎛️ INPUTS & DEFAULTS
LSMA: 20/5 | ADX: 14 | Vortex: 14 | Supertrend: 7/2, 10/3, 14/4 | Smooth: 3
═══════════════════════════════════════════════════════
🔧 CUSTOMIZATION
All parameters are fully adjustable through the indicator settings panel. Inputs are grouped logically:
• ⚙️ Core Parameters — main calculation settings
• 📊 Table Settings — table size (Tiny to Huge), position (4 corners), visibility toggle
• 🎨 Visual Settings — colors, show/hide elements
• 🔔 Alert Settings — threshold values for notifications
📊 DATA TABLE
A built-in data table displays all key metrics in real-time. Adjust the table size from Tiny to Huge to match your chart layout. Position it in any corner. Toggle visibility on/off.
🔔 ALERTS
Pre-built alert conditions for all major signals. Set up alerts via TradingView's alert dialog — select this indicator and choose from the available conditions.
⏱️ RECOMMENDED TIMEFRAMES
Works on all timeframes. Recommended: 1H, 4H, Daily for best signal quality. Lower timeframes produce more signals but with higher noise. Weekly/Monthly for position trading context.
✅ COMPLIANCE
• No repainting — all signals based on confirmed bar close data
• No future data references
• Open-source code — verify the logic yourself
⚠️ DISCLAIMER
This indicator is a technical analysis tool, not financial advice. It does not predict future price movements. Past patterns and signals do not guarantee future results. Trading involves substantial risk of loss. Always use proper risk management, including stop losses and appropriate position sizing. Never risk more than you can afford to lose. Indicador

Universal Trade Manager Template ATR Trailing SL TP with AlertsA modular, signal-agnostic trade management engine. This template does not generate trade entries itself. Instead, it takes a Long/Short trigger from any compatible TradingView indicator and handles everything downstream — initial stop-loss placement, ATR-based trailing, TP1/TP2 tracking, trade timeouts, and webhook-ready JSON alerts for automated execution.
It is designed as a reusable management layer: connect the same tested trade-management logic to different signal-generating indicators without duplicating the underlying code.
HOW IT WORKS
Connect any signal source Point the Long Trigger and Short Trigger inputs to the corresponding alert conditions from your signal indicator.
Controlled entry timing By default, the template applies a one-bar offset: a signal confirmed on bar N triggers the entry on the open of bar N+1. This follows standard non-repainting execution. The offset can be disabled when the connected indicator generates its trigger after bar close.
Flexible initial stop-loss Set the initial SL using an ATR multiple, or pull it from an external structural level such as a swing high/low or FVG edge. An optional opposite-level input can widen the stop to a structural floor/ceiling, but will never tighten it.
A third Initial SL Mode, Last Pivot High/Low, is also available: instead of only ATR-based or external-source stops, the stop can be set to the highest high (shorts) / lowest low (longs) over a lookback window. At 1x multiplier it sits exactly on that level, with the multiplier available to tighten or widen from there. Falls back to the ATR stop if the lookback window isn't fully available yet.
Two trailing modes Choose between:
Continuous: re-evaluates the trailing stop on every eligible bar after the configured delay.
Stepped: updates only at fixed bar intervals, useful for reducing SL-update noise in choppy markets. Stepped trailing now has its own configurable alert, with a message ready to use with platforms that can consume webhook signals to execute orders on your broker or prop account.
VISUALS
Entry Zone Displays the initial SL/TP1 range at the moment of entry. The zone remains frozen even when the trailing stop subsequently moves.
Live trade status Entry zones are color-coded:
Gray — trade still open or closed BE
Green — TP1 reached
Red — initial SL breached
Zone Stats Table Tracks the results of the most recent entry zones, including TP, SL and neutral/BE outcomes, together with the hit rate. This provides a quick view of how the connected signal is performing without relying on the Strategy Tester.
Live management levels Separate trailing SL, TP1 and TP2 lines are plotted on the chart, with pip-distance labels for both the entry zone and current trailing stop, plus a display label for the trailing stop itself.
ALERTS & AUTOMATION
The template provides seven alert conditions:
Long Entry
Short Entry
Stop Loss Update
Stop Loss Hit
TP1 Hit
TP2 Hit
Timeout Exit
Each alert includes a pre-built JSON payload with TradingView placeholders, capturing the relevant values at the exact moment the alert fires.
The payload is designed as a starting point for integration with platforms which can consume webhook signals to execute orders on your broker or prop account. Fields such as traderIdKey, tradeSide, relativeTakeProfit, and relativeStopLoss can be adapted to match the configuration and credentials required by your chosen platform.
This allows the trade-management layer to send automated execution instructions directly from TradingView to your broker or prop firm account, without any manual order entry.
NON-REPAINTING DESIGN
All internal trade-management logic uses confirmed-bar data and proper offsetting.
There is no lookahead in the entry/exit logic, and the alert payload captures values when the event actually occurs rather than relying on values that may change later as the chart updates.
IMPORTANT
This is a trade-management layer, not a signal generator.
It will not produce entries or plot trade-management levels until it is connected to a compatible indicator source through input.source().
For educational and informational purposes only. This template is not financial advice. Test thoroughly in TradingView and on a demo account before connecting it to any live automated execution system. Indicador

Trend Trail, Trailing Stop & Buy Sell Signals [LunqFX]An ATR trailing stop — the trend-following construction most traders know as SuperTrend — breaks in the same place every time. Price stops trending, the trailing stop gets clipped from both sides, and it prints a buy, a sell, a buy and a sell inside twenty bars. Every one of those is a false trend reversal, and the logic is not wrong: it is being asked a question the market is not answering.
This is an open-source modification of the classic ATR based SuperTrend, and it asks that question first. Before it will give you a buy or sell signal it measures whether there is a trend to trail at all. When there is not, the whole chart goes dark — the trailing stop disappears, the fill drops, the candles fall to grey, and no long entry or short entry prints.
And it does not ask you to take that on trust. A plain fixed-distance ATR trailing stop runs alongside it on the same data, and the panel shows both counts side by side with the difference worked out for you.
Included: an average true range trailing stop with adaptive distance, a self-calibrating trend regime filter, buy and sell signals with the stop level printed on every label, a dormant state that switches the chart off in ranges, a live dashboard, and alerts on every trend reversal.
❶ THE REGIME FILTER — what this adds to a SuperTrend
Trend strength is measured with the Kaufman Efficiency Ratio: the ground price actually covered, divided by the distance it travelled getting there. A clean leg scores near 1. The same distance walked back and forth scores near 0.
That raw ratio is useless as a threshold on its own, and this is where most attempts at this fail. Gold on a 30-minute chart runs an efficiency around 0.01 while the euro daily runs 0.40 — any fixed cutoff leaves the fast charts permanently asleep and the slow ones permanently awake. So the reading is scored as a PERCENTILE of the symbol's own recent history. The trail arms when efficiency reaches the top third of what this instrument normally manages, whatever that happens to be. One setting, no per-symbol tuning.
Two guards keep the state from flickering, because they catch different things. Hysteresis handles wobble around the threshold: once armed, the regime stays armed until efficiency drops clearly below the line. A minimum dwell time handles the other case — a clean spike that clears the threshold by a mile and drops straight back. Without both, a filter opens hundreds of regimes and ends up emitting more marks than the raw trail it was meant to quieten.
❷ DORMANCY — the trail does not exist in a range
This is stronger than dimming a colour. When no regime is live the trail is torn down completely, and it is rebuilt from the current price when one opens, taking its side from the move that woke it.
The reason is not cosmetic. A trail left running through a range turns over inside it, unseen, and the market then re-opens onto a direction that was decided while nobody was watching — a position with no entry behind it. Destroying and rebuilding means every segment on the chart begins with a real event, and every event gets a label.
What you see is a chart that is either lit or switched off. Grey candles, no line, no signal: there is nothing here to do, and you can read that from across the room.
❸ THE ATR TRAILING STOP AND ITS ADAPTIVE DISTANCE
The average true range sets the band width, and the trailing stop ratchets in the direction of the trend and never loosens — the same dynamic support and resistance line a SuperTrend gives you, flipping to a trend reversal when price closes through it. The stop level is printed on every buy and sell label, so the one number you need at the moment of a long entry or short entry is already on the chart.
The distance is not fixed. One multiple has to be either too tight for choppy conditions or too loose for a clean run — it cannot be right for both, so the distance widens as efficiency falls and tightens as it rises. Turn it off in the settings for a constant multiple.
❹ THE RECEIPT — a filter you can audit
A second trailing stop is computed on the same bars: fixed distance, no regime filter, nothing else — what an ordinary trailing stop would have done here. Its flip count sits in the panel next to this one's signal count, with the reduction calculated:
Signals here · plain trail 164 · 236 Noise removed −31%
Both numbers count the same thing — entries against entries. A state is not counted as a trade on either side. And when the result goes the wrong way the panel says "Noise ADDED" in red rather than quietly dropping the sign, because a panel that flatters its own script is worse than no panel.
Read it as what it is: a measure of how much less often this fires, not a claim about money. Fewer signals is not automatically better signals, and this number does not pretend otherwise.
❺ THE DASHBOARD
Direction and stop price in the header, trend strength as a 0–100 reading with a bar and the arming threshold beneath it, current stop distance in price and in ATR, and the two comparison rows. In the dormant state the header says so plainly and the stop row reads "no stop — dormant" rather than printing a number that does not exist.
HOW TO USE IT
1 — Trade the lit stretches, ignore the grey ones. That is the whole discipline the tool is built around, and it is the part most trend systems leave to you.
2 — Use the trail as the stop, not just as a signal line. The level on the label is where the stop goes; the panel keeps showing the distance in ATR as the trade runs, so you can see when the trail has tightened to the point of being one bar away.
3 — Set the arming threshold to your patience. At 65 you get the top third of this symbol's clean moves. Raise it to 75 and you will trade far less on far cleaner legs. This is the one setting worth changing.
4 — Read the comparison rows on your own instrument. If the reduction on your symbol and timeframe is small, the filter is not finding much to remove there — which is itself information about the instrument, not a reason to distrust the reading.
HOW IT WORKS
The average true range sets the band width; the mid price plus and minus that width form the raw bands, exactly as in a classic ATR trailing stop. Each band ratchets in the trend's favour and never against it, and price closing through the opposite band flips the direction — the trend reversal. Efficiency is the net move over the lookback divided by the summed absolute bar-to-bar movement, ranked as a percentile against its own history. The regime arms above the threshold with hysteresis and a minimum dwell, and outside a regime the trail is not computed at all.
Works on any symbol and any timeframe. The regime filter needs the self-calibration window to fill before it can arm, so the first stretch of a fresh chart stays dormant by design.
SETTINGS
▸ Trail — ATR length, base distance, adaptive distance and its strength. ▸ Regime Filter — on or off, efficiency lookback, self-calibration window, arming percentile, hysteresis, minimum bars per regime. ▸ Signals — buy and sell signals, labels or arrows, stop level on the label. ▸ Visuals — glow, fill, candle dimming, dashboard position.
ALERTS — buy, sell, any signal, regime opened and regime closed. All fire on closed bars.
NON-REPAINTING — the trail is built from closed-bar values and every signal fires on bar close. A printed signal never moves and never disappears.
WHY THESE PARTS ARE ONE SCRIPT
The trail alone is an ordinary trailing stop and will chop you up in a range. The regime filter alone has nothing to gate. The comparison exists only because a filter nobody can check is just a claim, and it needs both of the others to have something to measure. Take any one away and the other two stop making a point.
This indicator is an educational market-analysis tool, not financial advice. It does not predict price. The comparison figures describe how often each version of the trail changed direction on the loaded chart; they say nothing about profit or loss. Always confirm with your own analysis and manage your risk. Indicador

HEK Auction Response Field [ARF]HEK Auction Response Field
Auction Response Field (ARF) is a stateful market-structure indicator designed to describe how price is responding to market effort, rather than predict the next candle.
ARF combines three ideas into one coherent framework:
Response Field — a continuous directional measure of realized price response relative to normalized market effort.
Persistent auction regimes — a confirmed-bar state engine classifying the market as Balance, Bull Drive, Bear Drive, Bull Absorption, Bear Absorption, Churn or Transition.
Orthogonal modifiers — contextual labels such as Vacuum-like displacement, Effort-Supported behavior and Low Efficiency. Modifiers add context without replacing the primary regime.
What makes ARF different?
Many indicators classify price using a single threshold or a collection of independent signals. ARF instead treats market behavior as a state-ownership problem.
A new active regime must earn ownership through evidence and separation. Existing regimes use asymmetric persistence rules to avoid one-bar state flicker. Balance has its own entry, hold and escape behavior. Bull and Bear Drive states also use a two-confirmed-bar Semantic Field Guard: if realized Response Field becomes directionally incompatible with the current Drive state for two confirmed bars, Drive ownership is released.
This architecture is intended to separate:
direction from effort,
state from modifier,
live response from confirmed regime ownership,
visual presentation from the validated state engine.
Primary regimes
Bull Drive
Directional upside response is efficiently controlling the auction.
Bear Drive
Directional downside response is efficiently controlling the auction.
Bull Absorption
Selling pressure is present, but the auction is responding with relative bullish resilience.
Bear Absorption
Buying effort is present, but upside response is being absorbed.
Balance
No active directional regime has sufficient evidence to own the auction and balanced behavior is persistent.
Churn
Effort is elevated relative to realized directional progress, indicating contested or inefficient auction behavior.
Transition
No primary state currently has enough ownership evidence. Transition is intentionally valid information, not a missing signal.
Response Field
The center panel is the continuous Response Field.
Positive values indicate bullish realized response.
Negative values indicate bearish realized response.
Values near equilibrium indicate limited directional response.
The displayed Field is visually compressed for readability across different instruments. Display smoothing and compression are presentation-only controls and do not alter the regime engine.
Regime timeline
The lower ribbon provides a compact visual history of confirmed auction regimes. Its debounce is presentation-only. It does not delay state transitions or alerts.
Semantic dashboard
The dashboard translates internal evidence into a compact interpretation:
Response Field — Bullish / Neutral / Bearish
Market Effort — High / Normal / Low
Price Response — High / Normal / Low
Path Quality — Orderly / Mixed / Low
Modifier — current orthogonal context, when present
Raw diagnostic values can be enabled from Advanced display.
Signal detail
ARF offers three visual signal levels:
Essential — Drive regime entries only. Recommended default.
Selective — Drive entries plus high-significance Absorption and Vacuum-like events.
Research — broader event visibility for analysis.
These settings change presentation only. They do not alter primary regime ownership.
Confirmed-bar behavior and repainting
The continuous Response Field can move on the live bar because current OHLCV values are still changing.
Primary regime transitions, regime counters and state alerts are committed only when the bar is confirmed. ARF does not use future-looking data or lookahead logic.
A live-bar Field movement should therefore not be confused with a confirmed regime transition.
How to use ARF
ARF is best used as a market-context layer rather than as an isolated entry system.
Examples:
distinguish directional Drive from Balance before evaluating a setup,
identify when directional effort is being absorbed,
recognize contested Churn conditions,
use Vacuum-like or Low-Efficiency modifiers to qualify the primary regime,
track whether a directional regime persists or loses semantic ownership.
ARF does not provide profit guarantees, price targets or certainty about future price movement. A regime describes the current auction structure; it is not a forecast that price must continue in the same direction.
Suggested chart setup
For the cleanest view:
use standard candles,
keep Signal detail = Essential initially,
keep the semantic dashboard and regime timeline enabled,
leave research evidence plots disabled unless inspecting the model,
evaluate multiple instruments and timeframes rather than optimizing visual settings for one chart. Indicador

CandelaCharts - HTF Candle Anticipation📝 Overview
The CandelaCharts - HTF Candle Anticipation indicator provides a multi-timeframe analysis view by rendering higher timeframe (HTF) candles directly on your current chart, offset to the right. Not only does it show historical HTF candles, but it also generates an Anticipated Candle representing the expected future price action based on liquidity sweeps, structure breaks (BOS), and lower timeframe Changes of Character (CHoCH).
The indicator analyzes the relationship between the two most recently closed HTF candles. Based on how the current candle interacts with the high and low of the previous candle, the indicator projects the next candle's bias:
Sweep: Piercing the previous candle's extreme (high or low) but closing back in range signals a liquidity grab (targeting the opposite side).
BOS: Closing beyond the previous candle's extreme (high or low) signals continuation.
CHoCH: If no sweep or BOS occurs, the script relies on a specified Lower Timeframe (LTF). A bearish CHoCH in the top 50% of the HTF candle anticipates a bearish move, while a bullish CHoCH in the bottom 50% anticipates a bullish move.
Respect: The current candle's body respects the previous candle's equilibrium (50% level), signaling continuation.
Disrespect: The current candle's body disrespects the previous candle's equilibrium (50% level), signaling reversal.
📦 Features
Multi-Group Display: Supports up to 4 different HTF groups simultaneously (e.g., 1H, 4H, 1D, 1W), allowing top-down analysis without switching charts.
Customizable LTF CHoCH: Explicitly define the Lower Timeframe and pivot length to use for CHoCH detection for each HTF group.
Interactive Dashboard: An on-chart dashboard tracks the current Anticipation Stage for all active groups, including the progression of stages (e.g., Sweep ↓ → CHoCH ↑).
Clean Visuals: Highly customizable visuals including offsets, spacing, label sizes, and colors. The anticipated candle is drawn with a customizable opacity to distinguish it from historical candles.
⚙️ Settings
General: Global settings for text size, font, and the CHoCH Swing Length used for detecting LTF pivots.
HTF Groups (1-4): Toggle visibility, set the timeframe, the number of historical candles to show, and the specific LTF used for CHoCH.
Styling & Labels: Customize colors for bullish/bearish anticipated candles, spacing, margins, label display, and rendering offsets.
Dashboard: Toggle the stage tracking dashboard and set its position on the chart.
⚡️ Showcase
Next Candle
HTF Dividers
Dashboard
🚨 Alerts
Anticipation Formed: Triggered when a new anticipated scenario is confirmed on any active HTF group.
⚠️ Disclaimer
Trading involves significant risk, and many participants may incur losses. The content on this site is not intended as financial advice and should not be interpreted as such. Decisions to buy, sell, hold, or trade securities, commodities, or other financial instruments carry inherent risks and are best made with guidance from qualified financial professionals. Past performance is not indicative of future results.
Indicador

Cyber Matrix [Spatial Sync]◆Overview
The "Cyber Matrix " is a next-generation analytical tool that integrates Spatial Volume Profiling, real-time Momentum (RSI) tracking, and Spatial Geometry into a single, highly optimized Head-Up Display (HUD). Expanding upon traditional price action analysis, it renders order flow as a live ASCII matrix to synchronize market liquidity with spatial coordinates.
This allows traders to objectively verify hidden support/resistance zones and momentum accumulation before the market makes its move.
◆ System Modules and Execution Flow
Holographic VP & ASCII Matrix: Scans a defined historical window and reconstructs volume distribution as a dynamic ASCII terminal rather than standard boxes. Projects price levels, the Point of Control (POC), and momentum density directly onto the chart's spatial background. Dynamic Geometric Anchoring: An algorithmic coordinate system that tracks market structure. Users can seamlessly toggle between "Auto Pivot" (snaps to structural swing highs/lows), "Rolling Lookback" (fluidly trails the current price), or "Step Profile" (archives historical matrices).
Spatial Geometry (Hexagonal Matrix) Engine: Automatically projects Hexagonal boundaries anchored to dynamic pivot points. Inspired by W.D. Gann's Hexagon Chart and the mathematical efficiency of honeycomb structures (perfect packing), this visualizes where market liquidity is optimally constrained. Confluence Signal Engine: Fuses the Madrid EMA (baseline trend) with RSI crosses. Emits strict, algorithmic buy/sell signals colored in Neon Cyan (Bullish) and Neon Magenta (Bearish).
◆Configuration and Filtering Options
HUD Resolution & Boundaries: Defines the vertical row count and horizontal text width. Adjusting this allows traders to scale the ASCII projection seamlessly from high-timeframe macro views down to 1-minute scalping environments. Geometry Toggles: Independent visibility controls for Hexagonal polygons, Parallel Channels, and Mathematical Labels, ensuring the UI remains pristine.
Cyber Theme Opacity: Fully customizable Alpha (transparency) controls for grid overlays and glowing polylines, optimized for dark-mode trading environments.
◆Trading Strategy and Practical Applications
The Spatial Sync Setup: Do not trade in the void. Wait for the price to compress near the edge of a Hexagonal boundary. If the ASCII HUD at that exact price level shows thick Volume blocks (█) and the Status reads "OVERRIDE (CYAN)", execute a Long position. The geometry provides the exact spatial entry, while the HUD confirms the liquidity.
Momentum Divergence via ASCII Pulse: Monitor the "TEMPORAL MOMENTUM" array at the bottom of the HUD. If the price is making a new high, but the pulse blocks degrade from solid (█) to hollow (░), algorithmic momentum is bleeding out. Prepare for a reversal.
◆Architecture and Quantitative Logic (Code Breakdown)
This script relies on multi-dimensional array processing and polyline rendering to synthesize geometry and volume.
RSI-Weighted Volume Bins: Standard Volume Profiles only show "how much" was traded, ignoring trend aggression. This engine multiplies the local RSI momentum by the volume traded at that specific price bucket, effectively mapping momentum into a spatial dimension. The output dictates the visual density of the HUD strings.
ASCII Block Normalization: Drawing hundreds of individual boxes per price level crashes TradingView's memory limits. By mathematically normalizing the volume against a maximum width integer and utilizing the str.repeat() function, the script bypasses graphical limits to render an infinitely scalable histogram using raw text strings.
◆Capabilities & Limitations
Capabilities (System Advantages):
Bypassing Draw Limits for High-Res Profiling: By relying on string manipulation (str.repeat) and a minimal number of labels (label.new) instead of heavy box drawings (box.new), the system avoids TradingView's object limits. This deploys a lightweight, steplessly scalable histogram without freezing the browser.
Dimensional Integration of Momentum & Volume: Expresses the RSI strength formed at a specific price tier as visual text density (█, ▒, ░). This allows instant, intuitive analysis of whether buyers or sellers were more aggressive at a specific node.
Dynamic Volatility Tracking & Archiving: The Auto Pivot mode (ta.pivothigh/low) automatically scales geometric shapes to match recent market swings, eliminating manual drawing. The Step Profile mode projects up to 5 historical sessions side-by-side to track liquidity migration.
Limitations (Platform Constraints):
Finite Historical Archiving: Pine Script enforces strict hard limits per script (max 100 polylines, 500 labels). Increasing the archive count (profile_count) to the absolute limit or selecting excessively long periods will trigger hardcoded garbage collection, clipping the oldest HUD elements first.
Mitigations (Practical Countermeasures):
Aggressor Estimation via Alternative Logic: To compensate for the lack of tick data, the script uses a proprietary "Volume × Local RSI Momentum" weighting algorithm. This statistically approximates relative buyer/seller aggression at specific price tiers, achieving accuracy highly viable for live trading without perfect order flow data.
Memory Management & Scope Optimization: Traders are advised to focus analysis on the most recent liquidity (1 to 3 sessions) that directly impacts the current trade. The code features explicit garbage collection (array.pop and delete loops) to safely purge old objects, ensuring the latest market structure is always projected stably without rendering bugs. Indicador

[SkuldX] Market Structure BOS & CHoCHSkuldX Market Structure — BOS & CHoCH
by SkuldX Trading Systems
What is it?
SkuldX Market Structure automatically maps the structural flow of price action by detecting Break of Structure and Change of Character events in real time. Instead of manually identifying swing highs and lows and drawing trend lines, the indicator does it for you — classifying every significant price move as either a trend continuation or a reversal signal, and labeling the market's structural state at every step.
Core concepts
Market structure is the sequence of swing highs and swing lows that defines whether price is trending up, trending down, or transitioning between the two. Reading structure correctly is the foundation of ICT, Smart Money, and most institutional trading methodologies.
HH / HL / LH / LL — the four structural labels that appear at every confirmed swing point:
HH Higher High — price makes a new high above the previous swing high. Bullish continuation.
HL Higher Low — price makes a higher low before pushing up again. Confirms bullish structure.
LH Lower High — price fails to reach the previous high. First sign of bearish pressure.
LL Lower Low — price breaks below the previous swing low. Bearish continuation.
BOS — Break of Structure
A BOS confirms that the existing trend is continuing. It fires when price breaks through the most recent swing extreme in the direction of the current trend.
BOS ▲ — price closes above the last swing high in an already bullish market. Institutions are adding to longs. The trend is intact and likely to continue.
BOS ▼ — price closes below the last swing low in an already bearish market. Sellers remain in control. The trend is intact.
BOS signals are ideal for trend-following entries — entering after a confirmed pullback when the BOS confirms trend resumption.
CHoCH — Change of Character
A CHoCH signals a potential trend reversal. It fires when price breaks through the swing extreme in the opposite direction of the current trend — the first structural evidence that the dominant side is losing control.
CHoCH ▲ — price breaks above a swing high while the market was in a bearish structure. Buyers have stepped in with enough force to break the bearish sequence. A new bullish trend may be beginning.
CHoCH ▼ — price breaks below a swing low while the market was in a bullish structure. Sellers have overwhelmed the existing uptrend. A new bearish trend may be starting.
CHoCH is not a guarantee of reversal — it is the first structural signal that conditions are changing. It becomes high probability when combined with additional confluence such as a key S&R level, an SFP, or an OI signal.
Two detection modes
Close mode — signals fire as soon as price closes beyond the structural level. Faster, more responsive, better for intraday trading on 15m and lower. May produce slightly more signals.
Pivot mode — signals fire only when a confirmed pivot point (N bars on each side) breaks the previous pivot extreme. Slower but structurally cleaner. Better for higher timeframes where false breaks are filtered naturally by requiring full confirmation.
Both modes can be used simultaneously on different chart instances for a multi-perspective view.
What you see on the chart
HH / HL / LH / LL labels — appear at every confirmed pivot point showing whether each swing is making higher or lower extremes. Reading the sequence of these labels from left to right tells the full structural story of price action.
BOS / CHoCH labels — appear at the bar where the structural break occurs. Color-coded by direction and type — green for bullish BOS, red for bearish BOS, aqua for bullish CHoCH, orange for bearish CHoCH.
Dashed line — extends from the broken structural level to the right, marking the exact price that was breached. This level often acts as support or resistance on subsequent retests.
Zone box — shaded area between the broken level and the current close. Shows the range of the structural break — wider boxes indicate more decisive moves, tighter boxes indicate marginal breaks that deserve extra scrutiny.
Structure background — a very subtle background tint showing the current structural state across the chart. Green tint for bullish structure, red tint for bearish. Immediately visible even when zoomed out.
Settings reference
Pivot Lookback — how many bars on each side a swing point must be the extreme to qualify as a pivot. Default 5. Lower values find more frequent swings, higher values require more significant structure. On 15m charts, 5 bars covers approximately 1.25 hours.
Detection Mode — Close for faster signals, Pivot for confirmed structure only
Show BOS — toggle Break of Structure signals
Bullish / Bearish BOS Color — independent color control
Show CHoCH — toggle Change of Character signals
Bullish / Bearish CHoCH Color — independent color control
Show Zone Box — toggle the shaded zone between level and close
Show Labels — toggle BOS/CHoCH text labels
Show HH/HL/LH/LL — toggle structural pivot labels
Show Structure Background — toggle the subtle trend tint
Box Transparency — opacity of the zone fill
Line Width — thickness of the broken level line
Label Size — tiny, small, or normal
Zone Extend — how many bars right the zone and line extend
How to use it in practice
Reading the sequence — scan the HH/HL/LH/LL labels from left to right before looking at any signals. A clear sequence of HH → HL → HH → HL tells you the market is in a clean bullish structure. Any interruption of that sequence is a warning.
BOS as entry confirmation — after a pullback in a trending market, wait for a BOS in the direction of the trend. This confirms the pullback is over and the original direction is resuming. Enter at the close of the BOS candle with a stop below the previous HL for longs.
CHoCH as reversal alert — when a CHoCH appears, switch your bias. Do not immediately enter against the trend — wait for the new structure to develop. Ideally wait for the first BOS in the new direction after the CHoCH to confirm the reversal is gaining momentum.
Combining BOS and CHoCH — the most powerful setups occur when a CHoCH is followed by a BOS in the same new direction. CHoCH establishes the reversal intent. The subsequent BOS confirms it. Enter on the BOS, stop below the CHoCH swing low for longs.
Timeframe selection — on 15m and 1h the indicator works well for intraday structure. On 4h and daily it maps the larger swing structure that defines the week's directional bias. Running both simultaneously — 4h for bias, 15m for entry — is a common and effective approach.
Part of the SkuldX Suite
SkuldX Market Structure integrates naturally with the full SkuldX indicator suite:
A bullish CHoCH that coincides with a bullish SFP at a key S&R level from SkuldX SFP + Auto S&R is one of the strongest reversal confluences available — structure is changing and institutional players have swept liquidity at the same time
A BOS that fires while price is between the VAL and POC zone confirms trend resumption from a high-value area
A bearish CHoCH during the London+NY Overlap session with Bearish Trend OI Delta from SkuldX OI Delta signals institutional repositioning with full structural and flow confirmation
The Structure Background tint aligns with the London Bias logic in SkuldX session strategies — bullish structure during London session = continuation long bias, bearish structure = short bias
Indicador

Gaussian Filter Trend [QuantAlgo]🟢 Overview
The Gaussian Filter Trend passes price through a multi-pole Gaussian filter and holds the result inside an adaptive volatility deadband, producing a stepped trend path that advances only once a move has cleared the band. That band is sized by an Efficiency Ratio, tightening when price travels directionally and widening through chop, so the line tracks sustained moves and sits still through noise. Around that path, a star field orbits at two volatility-scaled radii that fade with distance, echoing the decay of the filter's own weighting and making the current trend distinctly recognizable at a glance on any instrument or timeframe.
🟢 How It Works
The indicator's core methodology combines two mechanisms: a cascaded Gaussian filter that smooths the source series, and an efficiency-driven deadband that governs when that smoothed value is permitted to move the trend line.
First, the selected source is passed through one to four cascaded single-pole stages. A beta term derived from the filter length and the pole count sets the smoothing coefficient. Because pole count enters that calculation directly, adding poles rescales the filter response rather than layering more averaging onto the same curve:
beta = (1 - math.cos(2 * math.pi / length)) / (math.pow(1.414, 2.0 / poleCount) - 1)
alpha = -beta + math.sqrt(beta * beta + 2 * beta)
Next, efficiency is measured by comparing net directional movement against the total distance traveled over the efficiency window. The ratio moves toward one when travel is more directional and toward zero when price covers ground without net progress. It is then smoothed, so the deadband width is less likely to shift sharply from one bar to the next:
efficiency_ratio = path_length == 0 ? 0.0 : net_move / path_length
smoothed_efficiency = ta.ema(efficiency_ratio, efficiency_smooth)
The smoothed reading blends between a wider chop multiplier and a tighter trend multiplier, and that result scales Average True Range into the deadband width. Higher readings pull the envelope in, so the line can follow a move more closely. Lower readings push it out, which is intended to reduce flips in conditions where they are more likely. Disabling Adaptive Width bypasses the blend and applies a single fixed multiplier:
width_multiplier = adaptive_width ? chop_multiplier + (trend_multiplier - chop_multiplier) * smoothed_efficiency : fixed_multiplier
trend_width = ta.atr(atr_length) * width_multiplier
Finally, the trend line carries its previous value forward and steps only when the envelope has moved past it. It drops when the upper band falls below the current level and rises when the lower band climbs above it, producing a stepped path rather than a continuous curve:
if upper_band < trend_line
trend_line := upper_band
if lower_band > trend_line
trend_line := lower_band
A persistent direction state records the last step and carries it through flat segments, so the line color, star field, bar coloring and alerts all read from the same value rather than diverging while the line is stationary. The star field orbits that path at a distance scaled to recent average bar range, spreading as ranges expand and drawing in as they compress, so the trend and the volatility it is being measured against are visible in one read.
🟢 Signal Interpretation
▶ Bullish Trend (Long/Buy): When the lower band climbs above the trend line, the line steps higher and the indicator enters bullish state. The trend line and star field switch to the bullish color. This condition identifies potential long or buy opportunities and remains active until the upper band falls below the line and confirms a bearish step.
▶ Bearish Trend (Short/Sell): When the upper band falls below the trend line, the line steps lower and the indicator enters bearish state. The visual elements switch to the bearish color. This condition identifies potential short or sell opportunities and holds until the lower band climbs above the line and confirms a bullish step.
▶ Flat Path (Hold): When price stays inside the deadband, neither band displaces the line and it holds level. Color does not change, so the prior state is carried rather than reconfirmed. Extended flat runs indicate the efficiency reading has widened the band against choppier conditions, and the state resolves only when one side of the envelope clears the line.
🟢 Features
▶ Preconfigured Presets: Three parameter sets cover a range of trading styles and timeframes. "Default" uses four poles over a fourteen bar window for a balanced configuration aimed at swing trading on 1-hour and daily charts. "Fast Response" shortens the filter length and drops to two poles for a tighter path on 5-minute to 1-hour charts, which may suit intraday work at the cost of more frequent steps in choppier conditions. "Smooth Trend" lengthens the filter and widens the chop multiplier for a steadier baseline on daily and weekly charts, aimed at position trading. Selecting any preset other than Default overrides every Gaussian Filter and Trend Width input beneath it.
▶ Built-in Alerts: Three alert conditions support automated monitoring of trend transitions. "Bullish Trend Signal" fires on the bar the direction state flips to bullish. "Bearish Trend Signal" fires on the bar it flips to bearish. "Any Trend Change" triggers on either transition for traders who want a single unified alert regardless of direction. All alerts include the exchange, ticker, and timeframe in the message for immediate context.
▶ Visual Customization: Six color presets, Custom, Classic, Aqua, Cosmic, Cyber, and Neon, provide coordinated bullish and bearish color pairings suited to different chart themes and personal preferences. Selecting Custom exposes independent color pickers for both states, alongside an adjustable neutral color used during the initial warmup before the first directional step. Line width is configurable from one for a minimal look up to eight for a heavier path, and the star field toggles separately from the line so either element can be displayed on its own. Optional bar coloring and background shading tint the candles and chart field with the active trend color at configurable transparency levels, reflecting the current state without reading the line directly.
Indicador

Time-Based Range Sweep (DTR)SUGGESTED TITLE
Time-Based Range Sweep (TBRS)
SHORT TITLE
TBRS
---
OVERVIEW
Time-Based Range Sweep builds a price range from two user-defined intraday time windows, waits for price to sweep one side of that range after the window closes, and then looks for a specific reversal confirmation before marking an entry, a stop area, and a target area.
The idea behind it is simple: a fixed block of time produces a high and a low. Once that block is finished, those two levels sit on the chart as reference liquidity. Price often runs one side of them before moving in the opposite direction. This script automates the bookkeeping around that sequence — drawing the range, flagging which side was swept, waiting for a confirmation you select, and projecting the resulting levels forward so you are not measuring them by hand.
Each range is independent and each range produces at most one signal per day.
---
HOW IT WORKS
1. RANGE CONSTRUCTION
Two session windows can be enabled independently. Both are interpreted in a timezone you choose (default America/New_York), so the ranges stay anchored to the same clock time regardless of your chart's display timezone.
While a window is open, the script tracks the running highest high and lowest low of every bar inside it, drawing a live box and two solid boundary lines that expand as the window develops. When the window closes, the box is finalized, and dotted or dashed projection lines carry the high and the low forward for a configurable number of bars. Optional labels mark the range title, TBR RANGE HIGH, and TBR RANGE LOW.
Defaults are 01:12–02:12 and 08:12–09:12 New York time, but both windows are fully editable — any two intraday blocks can be used.
2. SWEEP DETECTION
Sweep logic only becomes active after the window has closed. The first bar that trades beyond either boundary is registered as the sweep for that range:
- A bar trading below the range low is a low sweep, which sets a long bias.
- A bar trading above the range high is a high sweep, which sets a short bias.
"Sweep must reclaim range" is on by default. With it enabled, a wick through the level is not enough — the bar must also close back inside the range for the sweep to count, which filters out bars that simply break the level and keep going. Turning it off accepts any penetration of the boundary.
Only the first sweep after each window is used. Once a side has been taken, the range stops looking for further sweeps until the next session.
3. CONFIRMATION MODELS
After a sweep is registered, the script waits for one of three confirmations. You pick which one is active, or choose Any Confirmation and take whichever appears first.
3 Candle Reversal — After the sweep, the script counts consecutive bars closing against the anticipated direction (down closes following a low sweep, up closes following a high sweep) and records the high and low of that sequence. The counter resets if the run is broken before it reaches three. Once at least three have accumulated, the signal fires on a close beyond the sequence extreme — above the sequence high for longs, below the sequence low for shorts.
CISD — A close through the three-bar structural extreme: above the highest high of the previous three bars for longs, below the lowest low of the previous three bars for shorts.
IFVG — A displacement gap in the direction of the bias. For longs, the current bar's low prints above the high from two bars back; for shorts, the current bar's high prints below the low from two bars back.
All confirmations are evaluated on confirmed bar closes, so signals do not appear and disappear intrabar.
4. STOP PLACEMENT
When a signal fires, the stop reference is the most recent confirmed swing pivot that formed at or after the sweep bar — a pivot low for longs, a pivot high for shorts. Pivot strictness is set by the left and right bar inputs.
Because a confirmed pivot requires a fixed number of bars on both sides, fast setups can trigger before one exists. In that case the script falls back to the lowest low or highest high over a configurable lookback. A tick buffer is then applied beyond whichever reference was used.
5. PROJECTION
Three objects are drawn forward from the confirmation bar for a set number of bars:
- Entry level — a horizontal line at the confirmation close, labeled with which confirmation produced it.
- Stop zone — a shaded area between the entry and the calculated stop.
- Target zone — a shaded area between the entry and the opposite side of the range. A long that came from a low sweep targets the range high; a short that came from a high sweep targets the range low.
The target zone is a reference for the measured objective of the setup, not a projection of where price will go.
---
SETTINGS
SESSIONS
- Show London range / Show New York range — enable each window independently.
- Range time — the time window for each range.
- Range label — text shown in the center of each finished box.
- Session timezone — IANA timezone used to interpret both windows.
- Projection bars — how far entry, stop, and target objects extend.
- Extended range line bars — how far the dotted or dashed boundary lines extend past the window.
SWEEP AND CONFIRMATION
- Confirmation mode — 3 Candle Reversal, IFVG, CISD, or Any Confirmation.
- Sweep must reclaim range — require a close back inside the range for a valid sweep.
- Pivot left bars / Pivot right bars — swing strictness for stop placement.
- Stop fallback lookback — used when no confirmed pivot exists between sweep and entry.
- Stop buffer ticks — additional distance beyond the stop reference.
VISUALS
- Entry markers with independent long and short colors and five size options.
- Toggles for target and stop zones, range labels, entry level, and entry type text.
- Label vertical offset and label size.
STYLE
- Colors for range fill, range border, target zone, stop zone, and entry level.
- Extended line style: dotted or dashed.
---
HOW TO USE IT
Set both windows to the time blocks you actually trade and confirm the session timezone matches how you think about those times. The defaults are New York time, so a window entered as 01:12–02:12 is 01:12 New York regardless of where your chart is set.
Intraday timeframes are required, and the timeframe should divide cleanly into the window length so the range is built from a sensible number of bars. A 60-minute window on a 1, 3, 5, or 15 minute chart works; the same window on a 4-hour chart does not.
Start with a single confirmation mode rather than Any Confirmation. The three models have different characteristics: 3 Candle Reversal is the slowest and requires a developed base, CISD is the most immediate, and IFVG requires visible displacement. Any Confirmation takes whichever fires first, which will usually be the fastest of the three.
Tune the pivot inputs to your timeframe. Wider pivot settings produce more meaningful swing stops but increase how often the fallback lookback is used instead.
---
ALERTS
Five alert conditions are available:
- London range confirmation long
- London range confirmation short
- New York range confirmation long
- New York range confirmation short
- Any range confirmation signal
Each fires on the close of the confirmation bar and includes ticker and interval placeholders.
---
NOTES AND LIMITATIONS
- One signal maximum per range per day. Once a range has produced a confirmation, it stops evaluating until the next session.
- Range boxes and boundary lines update live while a window is open. Signals, zones, and entry levels are drawn on confirmed closes only.
- Drawing objects are capped at 500 boxes, lines, and labels. On very long chart histories the oldest objects will be removed by TradingView automatically.
- Sessions are evaluated with the chart's own bars, so illiquid symbols with gaps inside a window may produce ranges built from very few bars.
- Stop and target areas are geometric references derived from the range and recent structure. They are not orders, not backtested results, and carry no assumption about outcome.
---
ORIGINALITY
This is an original implementation written from scratch in Pine Script v6. The individual concepts it draws on — session ranges, liquidity sweeps, change in state of delivery, and inverse fair value gaps — are widely discussed public trading concepts, and no claim of ownership is made over them. What this script contributes is the specific pipeline that links them: an arbitrary time-defined range, an optional reclaim-filtered first sweep, a selectable confirmation stage, a pivot-based stop with a lookback fallback, and a target anchored to the opposite range boundary — all handled per-session with independent state for two windows.
---
DISCLAIMER
This indicator is provided for educational and informational purposes. It does not produce financial advice, and nothing it draws should be treated as a recommendation to buy or sell. Signals are historical observations of price behavior and do not predict future movement. Test any tool thoroughly on your own instruments and timeframes before risking capital, and manage your own risk.
Indicador

Dual TEWMA Ribbon - [JTCAPITAL]' Dual TEWMA Ribbon - ' is a modified way to use multiple Triple Exponential Moving Average calculations, Weighted Moving Average smoothing, proportional length scaling, and multi-timeframe-style trend confirmation for Trend-Following.
Instead of relying on a single Moving Average, this indicator calculates six separate TEWMA-based trend lines . Each line operates at a progressively longer calculation length, allowing the ribbon to represent different levels of market responsiveness. The shorter calculations react more quickly to changes in price, while the longer calculations respond more slowly and can help represent the broader underlying trend.
The core idea behind the indicator is that a trend can be evaluated across multiple smoothing speeds at the same time. When the faster and slower TEWMA calculations begin pointing in the same direction, the ribbon can provide a broader view of directional momentum. When the individual lines disagree, this can visually represent a market where shorter-term and longer-term trend calculations are not aligned.
The indicator also calculates an overall score based on the directional state of all six TEWMA lines. This score is then used to determine the script's overall bullish or bearish signal state. BUY and SELL labels are only plotted when the overall state transitions from bearish to bullish or from bullish to bearish according to the specific thresholds defined in the code.
The indicator works by calculating in the following steps:
Selecting the Price Source
The first step is selecting the price source used for all calculations. The default source is the closing price, but TradingView allows the source to be changed to other available price series.
Every subsequent calculation in the indicator begins with this selected source. This means that changing the source changes the underlying data used by all six TEWMA calculations.
Defining the Base Length and Multiplier
The script uses two primary parameters:
-The base length, which defaults to 36.
-The multiplier, which defaults to 1.4.
The multiplier is applied to the base length to create a second adjusted calculation length.
The first adjusted length is calculated as:
Adjusted Length = Base Length × Multiplier
The result is rounded to the nearest whole number because Moving Average lengths must be used as integer values.
With the default settings:
36 × 1.4 = 50.4
After rounding, the second length becomes approximately 50.
Creating Progressively Longer Ribbon Lengths
The script does not only use the original base length. It progressively scales the base length from one times the base value to six times the base value.
The six primary lengths are:
-1 × Base Length
-2 × Base Length
-3 × Base Length
-4 × Base Length
-5 × Base Length
-6 × Base Length
Each of these lengths is then multiplied by the selected multiplier to create a corresponding second calculation length.
This creates six pairs of Moving Average calculations.
The first pair represents the fastest portion of the ribbon, while the sixth pair represents the slowest portion.
Weighted Moving Average Smoothing
For every individual calculation length, the selected source is first processed using a Weighted Moving Average, or WMA.
The WMA gives greater weight to more recent price data and less weight to older observations.
This creates an initial layer of smoothing while still allowing newer price information to have a stronger influence on the result.
Applying the Triple Exponential Moving Average
After the WMA is calculated, the result is passed into TradingView's Triple Exponential Moving Average function.
This creates the TEWMA structure used throughout the indicator:
TEWMA = TEMA(WMA(Source, Length), Length)
The same length is used for both the initial WMA and the following TEMA calculation.
Each individual TEWMA therefore applies two stages of smoothing:
-First, the source is smoothed with a WMA.
-Second, the WMA output is processed through a TEMA.
The combination is designed to create a smoothed trend-following calculation while using TEMA as the final smoothing stage.
Calculating Two TEWMAs for Each Ribbon Level
Each of the six ribbon levels contains two separate TEWMA calculations.
The first uses the primary length.
The second uses the same primary length multiplied by the selected multiplier.
For example, the first ribbon level calculates:
-TEWMA using the base length.
-TEWMA using the base length multiplied by the multiplier.
These two TEWMA values are then averaged together.
The calculation is:
Final TEWMA = Average(TEWMA Primary Length, TEWMA Adjusted Length)
This same process is repeated for all six progressively longer ribbon levels.
Creating the Six Final Ribbon Lines
After the paired calculations are averaged, the indicator produces six final TEWMA lines.
These lines represent increasingly slower trend calculations.
The first line uses the shortest pair of lengths and is therefore the most responsive.
The following lines use progressively longer lengths:
-Ribbon 1: Base Length and Base Length × Multiplier
-Ribbon 2: Base Length × 2 and Adjusted Length × 2
-Ribbon 3: Base Length × 3 and Adjusted Length × 3
-Ribbon 4: Base Length × 4 and Adjusted Length × 4
-Ribbon 5: Base Length × 5 and Adjusted Length × 5
-Ribbon 6: Base Length × 6 and Adjusted Length × 6
Because the lengths become progressively larger, the ribbon contains calculations that can respond to both relatively recent price movement and more slowly developing directional movement.
Measuring the Direction of Every TEWMA
The trend direction of each ribbon line is determined by comparing its current value with its value one bar earlier.
A line is considered bullish when:
Current TEWMA > Previous TEWMA
A line is considered bearish when:
Current TEWMA < Previous TEWMA
This means the script is not using the position of price above or below the TEWMA to determine the trend direction.
Instead, it specifically evaluates the slope of the TEWMA itself .
If the TEWMA is rising, the corresponding signal is bullish.
If the TEWMA is falling, the corresponding signal is bearish.
Assigning a Persistent Directional State
Each of the six ribbon lines receives its own persistent signal variable.
When a TEWMA is rising, its signal is assigned a value of 1.
When a TEWMA is falling, its signal is assigned a value of -1.
These values are stored using Pine Script's var functionality.
The persistent signal state is used to control both the visual color of the ribbon and the overall directional score.
Coloring the Ribbon According to Direction
Every ribbon line changes color depending on whether its corresponding TEWMA is currently rising or falling.
A rising TEWMA is assigned the bullish blue color.
A falling TEWMA is assigned the bearish purple color.
The transparency differs between the ribbon levels.
The outer portions of the ribbon are displayed with greater transparency, while the central lines are displayed with less or no transparency.
This creates a visual ribbon structure in which the middle calculations are more prominent and the surrounding calculations create a layered trend display.
Creating the Ribbon Fill
Each TEWMA line is also paired with a hidden secondary plot.
The hidden plot is calculated as:
TEWMA × 0.9
The area between the TEWMA and this lower hidden plot is then filled using the color assigned to that particular TEWMA.
The lower fill is fully transparent, which causes the visual emphasis to remain closer to the main TEWMA line.
This calculation is repeated individually for all six ribbon levels.
Calculating the Overall Trend Score
After all six directional states have been determined, the indicator calculates an overall score.
Every bullish ribbon signal contributes:
+1
Every bearish ribbon signal contributes:
-1
Since there are six TEWMA lines, the total score can range from:
+6
when all six lines are bullish, to:
-6
when all six lines are bearish.
This creates a simple directional consensus measurement across the complete TEWMA ribbon.
Defining the Overall Bullish State
The overall signal is set to bullish when the score is greater than 3.
Because each bullish line contributes +1 and each bearish line contributes -1, a score above 3 requires a strong bullish majority.
The possible bullish scores that satisfy this condition are:
+4, +5, and +6.
This means that at least five of the six ribbon calculations must be bullish before the script assigns the overall bullish state.
Defining the Overall Bearish State
The overall signal is set to bearish when the score is less than -5.
The only possible score satisfying this condition is -6.
Therefore, all six TEWMA lines must be bearish before the script assigns the overall bearish state.
This creates an asymmetric signal structure.
The bullish state requires a strong bullish majority, while the bearish state requires complete bearish agreement across all six ribbon calculations.
Generating BUY Labels
A BUY label is plotted when the overall signal becomes bullish while the previous overall signal was bearish.
The exact transition condition is:
Current Signal > 0 AND Previous Signal < 0
This means a BUY label is not continuously plotted while the bullish state remains active.
It is only plotted at the moment the stored overall signal transitions directly from bearish to bullish.
Generating SELL Labels
A SELL label is plotted when the overall signal becomes bearish while the previous overall signal was bullish.
The exact transition condition is:
Current Signal < 0 AND Previous Signal > 0
Like the BUY condition, this prevents continuous label generation while the bearish state remains active.
The SELL label is only created when the overall directional state transitions directly from bullish to bearish.
Buy and Sell Conditions:
The indicator uses the directional slope of six individual TEWMA calculations to determine its overall trend state.
Bullish Direction
Each TEWMA line is considered bullish when its current value is higher than its value on the previous bar.
Every bullish line contributes +1 to the overall score.
The script assigns a bullish overall signal when:
Score > 3
Because the score can only move in whole-number increments, this means the score must be +4, +5, or +6.
In practical terms, at least five of the six TEWMA calculations must be rising before the bullish overall state is assigned.
A BUY label is only plotted when this bullish state is reached directly after the previous stored overall state was bearish.
Bearish Direction
Each TEWMA line is considered bearish when its current value is lower than its value on the previous bar.
Every bearish line contributes -1 to the overall score.
The script assigns a bearish overall signal when:
Score < -5
Since the minimum possible score is -6, all six TEWMA calculations must be falling simultaneously for the bearish overall state to be assigned.
A SELL label is only plotted when this bearish state is reached directly after the previous stored overall state was bullish.
Signal Persistence
The overall signal uses a persistent variable.
The script explicitly changes the overall signal to bullish when the bullish threshold is met and changes it to bearish when the bearish threshold is met.
When the score falls between these thresholds, the script does not assign a new neutral value.
As a result, the previously assigned overall state remains stored until one of the opposite threshold conditions is met.
This means the indicator can continue displaying its previously established overall direction during periods where the six TEWMA calculations are mixed and neither threshold is currently satisfied.
Features and Parameters:
* Source - Selects the price source used for every WMA and TEWMA calculation. The default setting is Close.
* Length - Defines the base calculation period used to construct the fastest TEWMA pair and acts as the foundation for all progressively longer ribbon calculations.
* Multiplier - Multiplies every primary calculation length to create the second TEWMA in each pair. The default value is 1.4.
* Six TEWMA Ribbon Levels - The indicator calculates six progressively slower trend lines using multiples of the base length from 1× through 6×.
* Dual-Length Averaging - Every ribbon level averages two separate TEWMAs: one based on the primary length and one based on the multiplier-adjusted length.
* WMA Pre-Smoothing - Every TEWMA begins by applying a Weighted Moving Average to the selected source.
* TEMA Processing - The WMA output is subsequently processed using a Triple Exponential Moving Average.
* Slope-Based Trend Detection - Trend direction is determined by whether each final TEWMA is rising or falling compared with the previous bar.
* Individual Ribbon Direction - Each of the six TEWMA lines independently receives a bullish value of +1 or bearish value of -1.
* Consensus Score - The directional values of all six TEWMA lines are added together to create a score ranging from -6 to +6.
* Bullish Threshold - The overall bullish state is activated when the score is greater than +3.
* Bearish Threshold - The overall bearish state is activated when the score is less than -5.
* Persistent Overall Signal - The most recent bullish or bearish overall state remains active until the opposite threshold condition is explicitly met.
* BUY Labels - A BUY label is plotted when the persistent overall signal transitions from bearish to bullish.
* SELL Labels - A SELL label is plotted when the persistent overall signal transitions from bullish to bearish.
* Dynamic Ribbon Colors - Every TEWMA line changes between bullish blue and bearish purple according to its individual directional state.
* Layered Transparency - Different ribbon levels use different transparency values to create a layered visual structure.
* Ribbon Fill - Each TEWMA line is paired with a hidden plot at 90% of its value, creating a filled area beneath the line.
Specifications:
Weighted Moving Average (WMA)
The Weighted Moving Average is the first smoothing calculation applied to the selected source.
Unlike a Simple Moving Average, where every value inside the lookback period receives equal weight, a WMA assigns progressively greater importance to more recent data.
This means recent price movement has a larger influence on the resulting average than older observations.
Within this indicator, the WMA acts as the first smoothing layer before the data is passed into the TEMA calculation.
Using a WMA before the TEMA means that the Triple Exponential Moving Average is not applied directly to raw price data. Instead, it processes an already smoothed representation of the selected source.
Triple Exponential Moving Average (TEMA)
The Triple Exponential Moving Average is the second major smoothing component used by the indicator.
TEMA is designed as a Moving Average calculation that uses multiple Exponential Moving Average stages and combines them to reduce the lag commonly associated with traditional smoothing methods.
In this script, the TEMA is applied directly to the output of the Weighted Moving Average.
The resulting structure can therefore be represented as:
Source → WMA → TEMA
This creates the TEWMA calculation used throughout the ribbon.
The benefit of combining these two stages is that the initial WMA gives more importance to recent price movement, while the subsequent TEMA provides the final trend-following calculation.
TEWMA Structure
The core calculation of the indicator is:
TEMA(WMA(Source, Length), Length)
The same calculation length is used for both the WMA and TEMA stages.
This process is repeated multiple times using different lengths.
Rather than using only one TEWMA, the indicator creates twelve individual TEWMA calculations in total: two for every one of the six ribbon levels.
Those pairs are subsequently averaged to produce the six displayed TEWMA lines.
Base Length
The base length is the fundamental period from which the entire ribbon structure is built.
The first ribbon level uses the base length directly.
The remaining ribbon levels use multiples of the base length.
The progression is:
Length
Length × 2
Length × 3
Length × 4
Length × 5
Length × 6
Changing the base length therefore changes the responsiveness of the complete ribbon rather than only changing one individual Moving Average.
A shorter base length causes all six ribbon calculations to use shorter periods, while a longer base length increases the smoothing periods throughout the entire structure.
Length Multiplier
The multiplier creates a second calculation length for every ribbon level.
For each primary length, the script calculates:
Primary Length × Multiplier
The result is rounded to the nearest whole number.
This produces a second TEWMA calculation that operates at a proportionally adjusted smoothing speed.
The two TEWMA calculations are then averaged.
Because the multiplier is applied to every primary ribbon length, it affects the complete ribbon consistently.
For example, with a multiplier above 1, the second TEWMA in every pair uses a longer period than the first.
Progressive Length Scaling
The six ribbon levels are constructed using progressively larger multiples of the base length.
This creates a spectrum of trend calculations ranging from relatively responsive to progressively slower.
The shorter TEWMA calculations can react earlier to changes in price direction.
The longer calculations require movement to influence a larger smoothing window and therefore represent a slower directional calculation.
Combining multiple calculation lengths allows the script to evaluate whether directional movement is limited to the faster part of the ribbon or whether it is also present across the slower calculations.
Dual TEWMA Averaging
Each displayed ribbon line is created by averaging two separate TEWMAs.
The calculation is:
Final Ribbon Line = (TEWMA Primary + TEWMA Adjusted) ÷ 2
The primary TEWMA uses the standard length for that ribbon level.
The adjusted TEWMA uses that length multiplied by the selected multiplier.
Averaging the two calculations creates a single line positioned between the two underlying TEWMA values.
This also means that each ribbon level is not dependent on only one specific calculation period.
Instead, it incorporates two proportionally related smoothing periods.
The Six Ribbon Calculations
The script creates six final averaged TEWMA calculations.
The first is based on the base length and multiplier-adjusted base length.
The second is based on twice the base length and its multiplier-adjusted equivalent.
This pattern continues until the sixth calculation, which uses six times the base length and six times the multiplier-adjusted length.
As a result, the indicator evaluates directional movement across six progressively slower trend calculations.
Slope-Based Trend Direction
The indicator determines the direction of each TEWMA by comparing the current value with the previous value.
The bullish condition is:
Current Value > Previous Value
The bearish condition is:
Current Value < Previous Value
This makes the directional logic slope-based.
The indicator does not require price to cross a TEWMA in order for that TEWMA to become bullish or bearish.
Instead, the TEWMA itself must change direction.
This approach focuses on whether the underlying smoothed calculation is rising or falling.
Individual Signal Values
Every one of the six ribbon levels receives a directional value.
A rising line receives:
+1
A falling line receives:
-1
These values are stored individually and later combined into the overall score.
The use of individual directional values makes it possible to measure the degree of agreement across the entire ribbon.
Multi-Line Consensus
The overall score is created by adding together the directional values of all six ribbon lines.
If all six are rising:
+1 + +1 + +1 + +1 + +1 + +1 = +6
If all six are falling:
-1 + -1 + -1 + -1 + -1 + -1 = -6
Mixed directional conditions produce values between these two extremes.
This creates a simple consensus measurement showing whether bullish or bearish directional movement dominates across the ribbon.
Bullish Consensus Threshold
The bullish overall state requires:
Score > 3
Since each line contributes either +1 or -1, the script requires at least five bullish lines.
A score of +4 represents five rising lines and one falling line.
A score of +6 represents complete bullish agreement.
This threshold allows one of the six calculations to remain bearish while the overall bullish state can still be activated.
Bearish Consensus Threshold
The bearish overall state requires:
Score < -5
The only possible score below -5 is -6.
Therefore, every TEWMA line must be falling.
This means the bearish threshold requires complete agreement across the full ribbon.
The bullish and bearish thresholds are intentionally not symmetrical in the code.
The script therefore applies different consensus requirements to establish bullish and bearish states.
Persistent Signal Logic
The overall signal variable is declared using var .
This allows the value to persist from one bar to the next.
The signal changes to +1 when the bullish threshold is satisfied.
It changes to -1 when the bearish threshold is satisfied.
When neither threshold is satisfied, the script does not reset the signal to zero.
Instead, the previously assigned value remains active.
This means that mixed ribbon conditions do not automatically remove the existing bullish or bearish overall state.
A new opposite state must satisfy its own threshold before the stored signal changes.
BUY Signal Transition
The BUY label requires two conditions simultaneously:
-The current persistent signal must be bullish.
-The previous persistent signal must have been bearish.
The label is therefore event-based.
It marks the transition rather than continuously marking every bar during an existing bullish state.
The BUY label is placed above the corresponding candle using the script's defined label settings.
SELL Signal Transition
The SELL label also requires a transition.
The current persistent signal must be bearish while the previous persistent signal was bullish.
The label is therefore only created when the stored directional state switches directly from bullish to bearish.
The SELL label is placed below the corresponding candle according to the label settings used in the script.
Bullish and Bearish Colors
The indicator defines a blue color for bullish conditions and a purple color for bearish conditions.
Each individual ribbon line uses its own directional state to determine which color is displayed.
This means it is possible for different parts of the ribbon to display different colors when the faster and slower TEWMA calculations are not aligned.
The ribbon therefore visually communicates both directional agreement and directional disagreement between the different calculation lengths.
Transparency Structure
The ribbon does not apply identical transparency to every line.
The fastest and slowest outer lines use greater transparency.
The next inner lines use less transparency.
The central lines are displayed without additional transparency.
This creates a layered visual appearance in which the middle portion of the ribbon is emphasized more strongly.
The transparency does not affect the underlying calculations. It is purely a visual representation method.
Ribbon Fill Calculation
Every displayed TEWMA line is accompanied by a hidden plot calculated at:
TEWMA × 0.9
The script fills the area between the main TEWMA line and this lower hidden value.
The fill uses the directional color assigned to the TEWMA.
The lower side of the fill is fully transparent.
This creates a visual extension beneath each line while keeping the calculation itself hidden from the chart.
Combining Fast and Slow Trend Calculations
One of the central characteristics of the indicator is the combination of multiple calculation speeds.
The shorter calculations respond more quickly because they use fewer historical bars.
The longer calculations change more gradually because they incorporate longer lookback periods.
When several calculations begin rising together, the score can move toward the bullish threshold.
When all six calculations are falling, the score reaches the bearish threshold.
This structure allows the indicator to compare directional movement across different smoothing horizons without using separate chart timeframes.
Combining WMA and TEMA
The TEWMA structure combines two different smoothing stages.
The WMA emphasizes more recent observations during the initial smoothing process.
The TEMA then processes this smoothed series.
The result is used as the trend measurement for each calculation length.
Because this process is repeated across twelve separate TEWMA calculations, the final ribbon combines both multi-stage smoothing and progressive length scaling.
Combining Dual-Length Calculations
Every ribbon level combines a primary TEWMA with a multiplier-adjusted TEWMA.
Instead of selecting only one length for each level, the script averages two related calculation periods.
The multiplier maintains a proportional relationship between the two lengths.
Changing the multiplier therefore changes the distance between the primary and adjusted calculations across all six ribbon levels simultaneously.
Combining Individual Signals Into a Score
The six directional states are converted into numerical values and summed.
This converts the visual ribbon into a measurable consensus value.
A higher positive score represents greater bullish agreement.
A lower negative score represents greater bearish agreement.
The score is then used to control the persistent overall signal.
This creates a distinction between the individual direction of each TEWMA and the overall directional state used for the BUY and SELL labels.
Asymmetric Signal Requirements
The script uses different thresholds for bullish and bearish states.
The bullish threshold can be reached with five or six rising TEWMAs.
The bearish threshold can only be reached when all six TEWMAs are falling.
This asymmetry is directly defined by the conditions:
scores > 3
and:
scores < -5
Users should be aware that these exact thresholds mean bullish and bearish state changes do not require the same degree of ribbon agreement.
What the BUY and SELL Labels Represent
The BUY and SELL labels are generated from the overall persistent signal rather than from an individual Moving Average crossover.
A BUY label represents a transition from the script's stored bearish state to its stored bullish state.
A SELL label represents a transition from the stored bullish state to the stored bearish state.
The labels therefore depend on:
-The directional slope of all six averaged TEWMA lines.
-The numerical score created from those six directional states.
-The bullish and bearish thresholds defined in the script.
-The previous value of the persistent overall signal.
Important Interpretation of the Signals
The indicator is designed to visualize directional changes and agreement across multiple smoothed calculations.
The BUY and SELL labels are generated according to the exact mathematical conditions defined in the script and should be interpreted within the context of the selected source, base length, multiplier, market, and timeframe.
Different parameter values will change the lengths used by every TEWMA calculation and can therefore change the responsiveness of the complete ribbon.
The indicator does not use future price data in its calculations. Each WMA, TEMA, directional comparison, score, and label condition is calculated from the available chart data at the corresponding bar.
As with any trend-following calculation, the behavior of the indicator can differ depending on market conditions. Strong directional movement and mixed or rapidly changing price movement can produce different levels of agreement between the faster and slower components of the ribbon.
Enjoy!
Indicador

Indicador

Square Bar/Calendar Count Verticals (Gann)█ OVERVIEW
Square Bar/Calendar Count Verticals plots vertical time lines on the chart at squared counts measured from user-selected pivot anchors, in two independent units: trading bars and calendar days. The thesis, drawn from W.D. Gann's time-counting methods, is that elapsed time from a significant price extreme reaching a perfect square (81, 100, 121, 144, 289, 361) marks a date of elevated probability for a trend pause, inflection, or termination, and that the strongest of these dates occur where a bar-count square and a calendar-day square coincide.
█ HISTORY / BACKGROUND
Counting time in squares from major highs and lows originates with W.D. Gann, who treated time and price as interchangeable quantities and used the squares of small integers as recurring measures of trend duration. Constance Brown's published work on Gann analysis demonstrates the method in modern markets: bar counts of 9², 10², 11², and 12² projected from a swing extreme, a 17² calendar-day count from a significant low, repeats of the 144 count monitored from key pivots, and the square of 19 tracked as a separate helix cycle. This indicator implements that specific working set as a chart tool.
The conceptual basis is that these verticals are time factors only. They carry no directional information. Their value is realized when a squared count expires while price is simultaneously at a level identified by independent price-based methods.
█ HOW IT WORKS
1 — The user supplies a comma-separated list of roots (default 9,10,11,12,17,19). At the first bar the script parses the list and computes the square of each root.
2 — Each of up to three anchors is a timestamp selected on the chart. The anchor is resolved to a bar by containment: the anchor bar is the first bar whose closing time exceeds the anchor timestamp. This makes resolution independent of exchange timezone and safe when the timestamp falls on a weekend or holiday.
3 — For every anchor and every square s, the script computes two targets:
- a trading-bar target at anchor bar index + s (bar unit follows the chart timeframe), and
- a calendar-day target at anchor time + s days (independent of timeframe).
With inclusive counting enabled (default) the anchor bar or anchor day is counted as 1, so targets land at s minus 1 units after the anchor.
4 — When the root 12 is present and the repeat setting exceeds 1, additional verticals are drawn at 288, 432, and further multiples of 144, in both units, up to the chosen repeat count.
5 — On the last bar the script draws the verticals once: solid lines in bar-index coordinates for bar squares (projected up to roughly 490 bars into the future) and dashed lines in time coordinates for calendar squares (projectable to any future date). Each line carries a label naming the root, the square, and the unit. The anchor itself is marked with a heavier line and a date label.
6 — A status table reports, per active anchor, the elapsed count in both units and the next upcoming square in each unit, with the bars remaining and the calendar date.
7 — Three alert conditions fire on the bar that completes a bar-count square, the bar that contains a calendar-day square date, and the bar on which both occur together.
█ HOW TO USE
The verticals are appointments in time, not signals. The intended workflow:
- Anchor each slot on a significant swing extreme. Significance is an analytical judgment; the script deliberately performs no automatic pivot detection.
- Validate an anchor by inspecting the verticals already in the past. If historical squared counts from that anchor align with real pivots, the anchor is worth keeping. If they align with nothing, move or disable it.
- When price approaches an upcoming vertical, consult independent price analysis. A squared count expiring while price sits at a level derived from other methods is the condition of interest. A squared count expiring in open space warns at most of a pause or stall.
- The highest-weight event this tool can flag is the third alert: a bar square and a calendar square completing on the same bar.
Bar counts are timeframe-relative by design: the same anchor produces different bar-square dates on daily and weekly charts, and both are legitimate counts on their own timeframe. Calendar-day counts are identical on every timeframe. The tool is designed for daily and weekly swing analysis, where Gann's counts were applied; on intraday charts the calendar counts remain valid but bar counts become session-dependent.
Visual elements: solid vertical lines are trading-bar squares, dashed vertical lines are calendar-day squares, the heavy line with a date label is the anchor, labels above price name bar counts, labels below price name calendar counts, and the top-right table summarizes elapsed and upcoming counts.
█ SETTINGS
- Square roots: comma-separated integer roots to square. Default 9,10,11,12,17,19.
- Inclusive count: anchor bar or day counts as 1 when enabled. Default on.
- Trading-bar squares: show or hide bar-count verticals. Default on.
- Calendar-day squares: show or hide calendar-count verticals. Default on.
- 144-cycle repeats: number of 144 multiples to project; 1 disables repeats. Default 3.
- Anchor 1, 2, 3: enable flag, pivot timestamp (Anchor 1 prompts for a chart click on load), and line color per anchor. Defaults: Anchor 1 enabled, Anchors 2 and 3 disabled.
- Status table: show or hide the summary table. Default on.
- Label size: tiny, small, or normal. Default small.
█ WHAT MAKES IT ORIGINAL
Most Gann-count scripts plot a single count series in a single unit. This implementation differs in three specific ways. First, it runs trading-bar and calendar-day counts in parallel from the same anchor and explicitly detects their coincidence, which is the confluence condition emphasized in the source methodology rather than an afterthought. Second, anchor resolution uses closing-time containment instead of naive date equality, so anchors survive timezone differences, weekends, and holidays without silently shifting by one bar. Third, projection is handled correctly per unit: calendar squares are drawn in time coordinates and can therefore mark dates arbitrarily far in the future, while bar squares are drawn in bar coordinates and are projected only within the platform's future-bar range, keeping both unit systems accurate to their own definition.
█ NOTES / LIMITATIONS
- Drawings are created once per script load on the last bar. As new realtime bars form, elapsed counts in the table and newly reachable verticals refresh only when the script recalculates, for example after a settings change or chart reload.
- Bar-count verticals can be projected at most about 490 bars beyond the current bar, a platform ceiling on future bar-index coordinates. Calendar-day verticals have no such ceiling.
- The script draws up to 500 lines and 500 labels. Many roots combined with three anchors, both units, and repeats can reach this ceiling, at which point the oldest objects are removed.
- If an anchor timestamp predates the symbol's available history, the anchor resolves to the first available bar and every count measures from there, which is unlikely to be the intended pivot.
- Bar counts depend on the chart timeframe and on the symbol's session definition. Symbols with irregular sessions or many holidays will show bar squares and calendar squares diverging substantially, which is expected behavior, not an error.
- The indicator plots time factors only. It produces no directional forecast, and no claim is made about the outcome of price at any vertical. Indicador
