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.
Estrategia

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

TURKS - Tiered Unit Risk Kernel StrategyTURKS decides how much of a long position to hold. Exposure is a graded function of where the close sits against four moving averages (20/50/100/200), so it moves in rungs rather than switching on and off. That function is monotone in price, which means it inverts: every rung has exactly one price. The panel prints those prices before they are reached — a ladder of levels at which the position gets larger or smaller, readable today.
Long-only, 0 to 1, no shorting and no leverage.
📊 THE RESULT
Twelve symbols, shipped defaults, 4-hour charts, full available history. Commission $1.50 per order, slippage 0.01xATR per side, idle cash credited nothing. b&h is buy-and-hold over the identical bars, charged nothing at all. The comparison is deliberately rigged against the strategy.
CAGR MAX DRAWDOWN CAGR / maxDD
symbol sample TURKS b&h TURKS b&h TURKS b&h
SNDK 1.3y +1406.3% +1899.0% -37.2% -56.8% 37.82 33.43
ETH 9.5y +117.3% +71.9% -54.4% -94.1% 2.16 0.76
BTC 9.5y +70.0% +54.2% -62.3% -83.9% 1.12 0.65
ARM 2.7y +62.5% +72.9% -39.8% -55.8% 1.57 1.31
TSLA 15.9y +32.7% +41.7% -57.0% -74.9% 0.57 0.56
NVDA 22.4y +25.3% +36.4% -77.0% -85.2% 0.33 0.43
AMD 21.4y +20.2% +17.3% -69.3% -96.1% 0.29 0.18
AVGO 16.8y +16.9% +39.0% -36.9% -50.3% 0.46 0.78
MU 22.4y +9.3% +19.7% -81.4% -90.9% 0.11 0.22
GOLD 13.5y +7.2% +7.7% -20.0% -35.0% 0.36 0.22
SPY 20.4y +4.4% +9.1% -40.5% -56.7% 0.11 0.16
INTC 20.4y +2.2% +8.5% -73.3% -74.2% 0.03 0.11
CAGR / maxDD is the column that settles it — return earned per unit of drawdown suffered. On that measure TURKS wins on 7 of 12. It cut maximum drawdown on 12 of 12, and beat buy-and-hold on raw return on 3.
▸ ETH — 117.3% against 71.9%, at −54.4% drawdown against −94.1%. Nearly double the return on barely half the pain.
▸ BTC — 70.0% against 54.2%, at −62.3% against −83.9%.
▸ AMD — 20.2% against 17.3%, turning a −96.1% hole into −69.3% across 21.4 years.
These are assets that spent their entire sample inside a historic bull market, measured against a benchmark paying no commission and no slippage. Halving a drawdown is ordinary. Halving it and finishing ahead is not.
BTCUSD 4h at the shipped defaults. The ladder is the green and red boxes; the envelope is the pair of curves around the mean. Bottom left is the BOOK panel reading 70.0% against 54.2% buy-and-hold at −62.3% drawdown against −83.9%, on 58.0% average exposure. Right side is the live state: what the rule targets now, where the next rung sells, where it buys back.
MU, SPY, TSLA and INTC are in that table because they were chosen to be difficult, and they behave exactly as the mechanism predicts. The rule sells strength and holds cash: it pays when a price path is violent relative to its drift, and it costs when the drift is high and the path is smooth. On a broad index it is the wrong tool — SPY 9.1% becomes 4.4%, and that number is in the table rather than left out of it.
📖 HOW TO USE IT
1 — Set your costs before you read anything. Commission ($ per order) and Typical position size ($) are the only two numbers the cost model needs; every other cost figure is a rate derived from them. A flat $1.50 is 1.9bp on an $8,000 position and 7.5bp on a $2,000 one. Leave these wrong and the panel lies to you.
2 — Pick the instrument. Single names and crypto whose drawdowns are violent relative to their drift. The table above is the guide, including the four rows that say don't.
3 — Read the ladder, not the arrows. The SELL / BUY ENGINE block prints three live numbers:
▸ Sell next above — the price at which the next rung comes off
▸ Buy back below — the price at which it goes back on
▸ Rungs sold — how much the envelope has already taken off, e.g. 12 of 20
Both prices exist now, before the move. They are not marks that appeared after one.
4 — Read the dial. The THE RULE block prints Target weight, which is what the rule says you should be holding at this instant, and Dial c / f. The POSITION block prints what you actually hold, your entry, your open return, and the round-trip cost you are currently carrying — so the gap between intention and position is always visible.
5 — Size it with c and f, not by fighting the rungs. c scales the whole position down. f is the floor you keep while the rule is off; raising it walks the book continuously toward buy-and-hold. Both tooltips print the measured frontier — the whole curve of what each step costs in return and buys in drawdown, including the region where the rule loses to simply holding less.
6 — Verify on your own symbol before trusting any of this. The BOOK panel prints Sample, CAGR against b&h, Max drawdown against b&h, CAGR/maxDD, Sharpe, Exposure and Turnover for whatever chart you are on, net of your own cost settings. Change the symbol and the whole table above regenerates for your instrument in one bar.
7 — Alerts. alert() messages ship on; JSON webhook format is a checkbox away.
🪜 HOW THE EXPOSURE IS SET
Exposure Shape picks the weighting rule. Ensemble 20/50/100/200 (graded) is the default: a slice is sold as the close drops below one more mean, bought back the same way, flat only below all four. Graded (continuous) uses one mean with an ATR ramp. Binary gate (legacy) is the original all-or-nothing rule.
Risk dial c scales the entire position down. Risk dial f is how much you keep while the rule is off. These two are the real levers, and nothing about their trade-off is hidden behind a paywall or a marketing claim — the full measured frontier is printed in the settings dialog.
Quantise Steps rounds the target to N reachable weights and requires price to clear 75% of a step before acting, so orders do not fire every bar. Ramp Width (xATR) sets how far above the mean price must travel to earn full size.
✂️ THE NADARAYA-WATSON SELL ENGINE
A trend weight cuts into weakness by construction, so it sells low: 59% of every unit the dial sells goes out below its own average cost, at 12.4 round trips a year. That is the flaw this block exists to fix. It replaces or constrains the sell side with a Gaussian kernel-regression envelope that only sells into genuine extension.
Sell Engine Mode — Dial, NWE-gated (default) keeps the dial's targets but forbids cutting while price sits below the smoother; it may still add. NWE band only turns the dial's sells off entirely. Dial + NWE (both cut) lets either one sell. Dial only leaves the envelope drawn but inert.
Sell Rungs is how much leaves on each upper-band cross: 1/N of the position. Going from 3 to 10 halved turnover, cut the share sold below basis from 16.7% to 8.9%, and pulled out-of-sample drawdown from −32.6% to −18.3%. It ships at 20, one step further along the same gradient; 10 is the last value with a formal table behind it.
Band Multiplier (3.0) and Buy-back Multiplier (2.5) set the upper and lower halfwidths in mean-absolute-deviation units. The asymmetry is the point: buying back nearer the mean than you sold restores the position before price has fully round-tripped, which is what keeps the overlay from bleeding in a chop. Bandwidth h widens and slows the smoother; it ships at 5.
🔬 HOW THIS WAS BUILT
Nine candidate signal families were tested against a matched-exposure control across 140 markets and 8,793 sessions: moving-average and momentum structure, cross-sectional relative strength, short-horizon mean reversion, volatility-of-volatility and regime transitions, drawdown state, volume, range compression, multi-timeframe agreement, and calendar seasonality. Not one was positive both in and out of sample. All nine were deleted from the codebase rather than left in as decoration.
The cleanest demonstration: take the original engine's own weight path and fire it 60 trading days late — same trades, same sizes, same turnover, same average exposure, only the dates broken. It scores better late than on time. Block-shuffling the path also beats it. A rule whose dates carry information cannot survive having them destroyed, so that engine was removed and what remains is geometry.
The stretch-proportional alternative to fixed rungs was then built and measured across 44 configurations. None beat rungs = 10. The project's pre-registered five-clause acceptance test passed all 20 graded cells — but a constant weight of 1.0 also passes three of five clauses, exactly one cell of twenty reaches p < 0.05 uncorrected (the null expectation for twenty tests), that p fails Bonferroni, and the cells are 0.985-correlated. It was reported as a failed test.
Everything left in this script survived a process designed to kill it. What remains is a sizing rule with no forecast in it: it does not predict the retest, it tells you at a price you can read now exactly what happens when one arrives.
⚙️ COSTS, AND THE SETTINGS THAT DECIDE THEM
Initial capital 150,000; commission $1.50 cash per order; no pyramiding; orders processed on bar close. Sell Engine Mode Dial, NWE-gated, Exposure Shape Ensemble 20/50/100/200 (graded), c = 1.00, f = 0.00, Quantise Steps 3, Ramp 1.0 ATR, Trend Mean 200, Cash Yield 0.00%. Envelope: bandwidth 5, multiplier 3.0, buy-back 2.5, MAE window 499, Sell Rungs 20.
TradingView's strategy() slippage is denominated in ticks, and a tick is an absolute price — one tick cannot be simultaneously correct for a $20 stock and a $1,600 one, nor for the same stock at $0.21 and at $224. It is therefore left at 0, and a proportional Slippage (xATR per side) input, shipped at 0.01, charges the cost in-script where it scales with the instrument.
Cash Yield ships at 0.00%. The rule spends much of its life partly in cash, so any yield credited lands straight on the CAGR, and one constant cannot represent a twenty-year sample where real cash paid about 0.1% for eight years and about 5% for two. Every figure in the table above was measured with it at zero.
Exits are close-only by construction — no strategy.exit, no stop=, no limit= anywhere in the shipped path, and nothing resting at a broker. The printed ladder is the memoryless level; the live quantiser is hysteretic, so the executed switch can sit up to 0.75 steps from the printed one.
© CREDIT
The envelope is a port of "Nadaraya-Watson Envelope " by LuxAlgo (www.tradingview.com), published open-source under CC BY-NC-SA 4.0. The kernel, the MAE band construction and the crossover logic are theirs. This script is published under the same licence.
Only the non-repainting, one-sided causal branch was ported. LuxAlgo's script defaults to the repainting branch, which rebuilds its curve inside barstate.islast with a two-sided kernel, so the value at bar i averages bars on both sides of i — including bars that had not happened when i closed. That branch is deliberately absent here. The measured gap between the two is about 21% of the band halfwidth, which is why the repainting version's arrows look cleaner than any live rule can be. The sizing, the rung logic and the position accounting are new.
Estrategia

Hunter Channel• Overview
Hunter Channel is a technical analysis indicator designed to identify structured price channels, evaluate their geometry and price interaction, monitor confirmed boundary breaks, and provide sequential post-breakout projections.
The indicator combines several related stages in one workflow. The channel engine identifies the price structure, the quality model evaluates characteristics of that structure, the breakout engine monitors interaction with the channel boundaries, the target system follows price after a breakout, and the Radar provides a separate view of the current smoothed directional environment.
These components are intended to answer different questions about the same market structure rather than operate as independent trading systems.
• Channel Construction
The channel engine uses confirmed pivot highs and pivot lows.
A potential channel can be constructed from two relevant pivot highs with an intervening pivot low, or from two relevant pivot lows with an intervening pivot high.
The two same-side pivots establish the slope of one boundary. The intervening opposite pivot is then used to position the parallel boundary, creating an equidistant channel structure.
The search is controlled by three principal settings:
• Maximum Lookback Limit — determines how far back the script can consider a qualifying pivot structure.
• Minimum Channel Length — specifies the minimum number of bars required before a candidate structure can qualify.
• Pivot Length — controls the sensitivity used to confirm pivot highs and lows.
A shorter Pivot Length generally reacts to smaller price swings, while a larger value requires broader swing structures.
• Channel Validation
Connecting pivots alone is not sufficient for the script to accept a channel.
After constructing a candidate, the indicator checks price behavior across the formation period. If price has moved excessively beyond the projected boundaries relative to the height of the channel, the candidate is rejected.
This validation is intended to distinguish a channel that has contained the relevant price structure from a geometric connection that does not adequately represent the intervening price action.
Once a qualifying newer channel is detected, the script begins tracking that structure and updates its projected boundaries as new bars are formed.
• Channel Display
A qualified structure contains an upper boundary and a parallel lower boundary.
An optional dashed midline represents the center of the channel, and the area between the outer boundaries can be shaded for visual reference.
Channel, midline, fill, and breakout-candle colors can be adjusted from the indicator settings.
• Channel Quality
After a candidate passes structural validation, Hunter Channel evaluates several characteristics of the detected structure.
The quality model considers channel width relative to recent ATR conditions, normalized channel slope, channel angle, and the amount of price movement that occurred outside a narrow tolerance around the projected boundaries.
These measurements are combined into a 0–100 structural score.
The resulting classifications are:
• Elite — score of 85 or higher.
• Strong — score from 70 to 84.
• Good — score from 50 to 69.
• Weak — score below 50.
Only structures meeting the script's qualifying threshold are activated as channels.
The score evaluates characteristics of the detected channel. It is not a historical win rate, statistical probability, or prediction of future performance.
• Channel Angle
The slope of the channel is normalized relative to recent volatility before its angle is evaluated.
The dashboard then describes the structure as Flat/Ranging, Healthy Trend, or Too Steep according to the measured angle.
This provides information about channel geometry independently of whether price will eventually break upward or downward.
• Channel Width
Channel height is also compared with recent ATR conditions.
This allows the script to identify structures that are unusually narrow, unusually wide, or within the script's normal width range.
Width is one component of the structural quality assessment and is not by itself a directional signal.
• Breakout Detection
Once a channel is active, the script continuously evaluates the current upper and lower projected boundaries.
Three breakout methods are available:
• Conservative (Close) — requires the candle to close beyond the relevant channel boundary.
• Aggressive (Wick) — reacts when the candle high or low crosses the relevant boundary.
• 10% Body Breakout — requires price to extend beyond the boundary by an additional amount derived from the channel height.
These alternatives allow users to choose how strict the boundary-break confirmation should be.
A bullish breakout state represents a confirmed break above the upper channel boundary according to the selected method. A bearish breakout state represents the corresponding break below the lower boundary.
A breakout state describes the programmed boundary condition; it does not represent a recommendation to enter a position.
• Sequential Targets
Following a confirmed breakout, the indicator uses the height of the detected channel as the reference for its projection system.
Target levels progress in half-channel-height increments from the breakout reference.
When price reaches the active target, the script advances to the next target and retains completed target levels on the chart.
This creates a sequential projection process rather than displaying only one fixed objective.
The targets are geometric extensions of the detected channel. They do not estimate the probability that price will reach a particular level.
• Retest Monitoring
After a breakout, Hunter Channel continues monitoring the relationship between price and the projected channel boundary.
After the initial breakout bars have passed, the script checks whether price revisits the relevant boundary area and then closes back on the breakout side of that boundary.
When those programmed conditions occur, the indicator marks the event as a retest.
A retest describes price interaction with the former channel boundary and does not guarantee continuation.
• Failed Breakout
The script also defines a condition for invalidating the active breakout state.
If price closes sufficiently back inside the projected channel after the breakout, relative to the height of the channel, the breakout is treated as failed.
The current channel graphics and associated target sequence are then cleared, allowing the channel engine to continue evaluating subsequent structures.
This creates a state-based workflow in which the indicator moves from channel identification to breakout monitoring and then either target/retest tracking or breakout invalidation.
• Radar Context
Hunter Channel includes a separate Radar overlay to provide directional context alongside the geometric channel structure.
The Radar uses two differently smoothed price-midpoint series. The default lengths are 11 and 33, followed by additional short smoothing.
The relative position of the faster and slower Radar lines determines the color of the area between them. A center line is also plotted between the two structures.
Radar does not determine the channel pivots, channel boundaries, channel quality score, or breakout condition.
It is included because the two components describe different aspects of price behavior: the channel represents geometric structure and boundary interaction, while Radar provides a smoothed view of the current directional environment.
This allows users to compare a channel or breakout with the surrounding directional context without merging the two calculations into a single signal.
• Analytical Dashboard
The dashboard summarizes the currently tracked channel using Quality Score, Channel Angle, Channel Width, breakout-context classification, and the next active target.
The quality and breakout-context fields are descriptive outputs derived from the script's structural measurements. They should not be interpreted as empirical probabilities, statistical success rates, or expected trading returns.
• Dashboard Language
The dashboard supports both English and Arabic.
The language can be selected from:
Settings → Dashboard → Table Language / لغة الجدول
Changing the dashboard language only changes displayed text. It does not modify channel detection, scoring, breakout conditions, targets, or Radar calculations.
• Alerts
The script includes alerts for several programmed events, including detection of a new qualifying channel, a confirmed boundary breakout, achievement of a target level, completion of a retest, and detection of a failed breakout.
An alert only indicates that the corresponding programmed condition has occurred. It does not represent an order or personalized trading instruction.
• Suggested Use
A practical way to read Hunter Channel is to begin with the channel itself: review its boundaries, width, angle, and structural quality.
Next, observe how price interacts with the upper and lower boundaries and apply the preferred breakout-confirmation method.
If a breakout occurs, the sequential targets and retest state provide information about subsequent price development.
Radar can then be used as additional directional context rather than as a requirement for channel detection or breakout confirmation.
• Limitations
Hunter Channel is a technical analysis tool and not an automated trading system.
Pivot-based structures require confirmed swing points, so a channel can only be identified after the required pivot information becomes available.
A valid historical channel does not guarantee that its boundaries will continue to contain price.
Breakouts can fail, reverse, or produce limited follow-through.
Channel-quality scores describe the characteristics of detected structures and do not measure future profitability.
Sequential targets are geometric projections and do not guarantee future price levels.
Radar describes smoothed price behavior and does not predict future direction with certainty.
Because the script displays directional breakout states, it is intended for use on standard price charts. Synthetic chart types such as Heikin Ashi, Renko, Kagi, Point & Figure, and Range charts can produce different price data and should not be used to interpret the script's breakout behavior as realistic trading performance.
• Disclaimer
Hunter Channel is provided for technical analysis and educational purposes.
It does not provide investment advice, financial advice, or a recommendation to buy or sell any financial instrument.
No channel, quality score, breakout state, retest, target, Radar condition, or other script output guarantees future market direction or trading results.
Users remain responsible for their own analysis, execution, position sizing, and risk management.
________________________________________
• نظرة عامة
Hunter Channel هو مؤشر للتحليل الفني صُمم لاكتشاف القنوات السعرية المنظمة، وتقييم خصائصها الهندسية وتفاعل السعر معها، ومتابعة اختراق حدودها، ثم عرض مستويات إسقاط متتابعة بعد تحقق الاختراق.
يجمع المؤشر عدة مراحل مترابطة ضمن سير عمل واحد. يتولى محرك القنوات تحديد البنية السعرية، ويقيّم نظام الجودة خصائص القناة المكتشفة، ويراقب محرك الاختراق تفاعل السعر مع حدودها، بينما يتابع نظام الأهداف تطور السعر بعد الاختراق. ويقدم Radar قراءة منفصلة للسياق الاتجاهي الممهد للسعر.
هذه المكونات تقيس جوانب مختلفة من البنية نفسها، ولا تعمل باعتبارها أنظمة تداول مستقلة عن بعضها.
• تكوين القناة
يعتمد محرك القنوات على قمم وقيعان Pivot مؤكدة.
يمكن تكوين قناة محتملة باستخدام قمتين Pivot مناسبتين مع وجود قاع Pivot بينهما، أو باستخدام قاعين Pivot مناسبين مع وجود قمة Pivot بينهما.
تحدد نقطتا الارتكاز الواقعتان في الجهة نفسها ميل أحد حدود القناة، ثم تستخدم نقطة الارتكاز المقابلة لوضع الحد الموازي الآخر، وبذلك تتكون قناة متساوية الأبعاد.
وتتحكم في عملية البحث ثلاثة إعدادات رئيسية:
• Maximum Lookback Limit — يحدد أقصى نطاق تاريخي يمكن للسكربت البحث داخله عن بنية Pivot مناسبة.
• Minimum Channel Length — يحدد الحد الأدنى لعدد الشموع المطلوبة قبل قبول القناة المرشحة.
• Pivot Length — يتحكم في حساسية اكتشاف القمم والقيعان.
القيم الأصغر لـ Pivot Length تتفاعل عادة مع تحركات سعرية أصغر، بينما تتطلب القيم الأكبر تكوينات Swing أوسع قبل تأكيد نقاط الارتكاز.
• التحقق من القناة
مجرد توصيل نقاط Pivot لا يكفي لاعتماد القناة.
بعد تكوين قناة مرشحة، يفحص المؤشر حركة السعر خلال فترة تكوينها. وإذا تجاوز السعر الحدود المتوقعة بدرجة كبيرة مقارنة بارتفاع القناة، يتم رفض البنية.
الغرض من هذا الفحص هو التفريق بين قناة احتوت الحركة السعرية ذات الصلة وبين مجرد اتصال هندسي بين نقاط منفصلة لا يمثل حركة السعر الواقعة بينها بصورة مناسبة.
وعند اكتشاف قناة أحدث مستوفية للشروط، يبدأ السكربت في متابعة تلك البنية وتحديث حدودها المتوقعة مع تكوّن الشموع الجديدة.
• رسم القناة
تتكون البنية المؤهلة من حد علوي وحد سفلي متوازٍ معه.
ويمكن عرض خط متقطع في منتصف القناة، إضافة إلى تظليل المنطقة الواقعة بين الحدين الخارجيين.
كما يمكن التحكم في ألوان القناة وخط المنتصف والتظليل وشمعة الاختراق من الإعدادات.
• تقييم جودة القناة
بعد اجتياز القناة لفحص البنية، يقيم Hunter Channel مجموعة من خصائصها.
يأخذ التقييم في الاعتبار عرض القناة مقارنة بظروف ATR الأخيرة، وميل القناة بعد التطبيع، وزاويتها، ومقدار خروج حركة السعر عن نطاق ضيق حول الحدود المتوقعة.
يتم دمج هذه القياسات في تقييم هيكلي من 0 إلى 100.
وتقسم النتائج إلى:
• Elite / ممتاز — من 85 فأعلى.
• Strong / قوي — من 70 إلى 84.
• Good / جيد — من 50 إلى 69.
• Weak / ضعيف — أقل من 50.
ولا يتم تفعيل القناة إلا عندما تحقق الحد المطلوب في نموذج التقييم.
هذا الرقم يصف خصائص القناة المكتشفة، ولا يمثل نسبة نجاح تاريخية أو احتمالًا إحصائيًا أو توقعًا للأداء المستقبلي.
• زاوية القناة
يتم تطبيع ميل القناة مقارنة بالتذبذب الأخير قبل تقييم زاويتها.
ثم تصف لوحة التحليل البنية بحالات مثل أفقي/عرضي، ترند صحي، أو حاد جدًا بحسب الزاوية المقاسة.
توفر هذه الخانة معلومات عن الشكل الهندسي للقناة بصورة مستقلة عن اتجاه الاختراق الذي قد يحدث لاحقًا.
• عرض القناة
يقارن السكربت ارتفاع القناة بظروف ATR الأخيرة.
ويتيح ذلك التمييز بين القنوات الضيقة بصورة غير معتادة، والقنوات ذات العرض المناسب وفق النموذج، والقنوات الواسعة بصورة كبيرة.
ويمثل العرض أحد مكونات تقييم البنية ولا يشكل بمفرده إشارة اتجاهية.
• اكتشاف الاختراق
بعد تفعيل القناة يراقب السكربت بصورة مستمرة الحدود العلوية والسفلية المتوقعة.
وتتوفر ثلاث طرق لتحديد الاختراق:
• Conservative (Close) — تتطلب إغلاق الشمعة خارج حد القناة ذي الصلة.
• Aggressive (Wick) — تعتمد على تجاوز أعلى أو أدنى سعر داخل الشمعة للحد المناسب.
• 10% Body Breakout — تتطلب امتداد السعر خارج الحد بمسافة إضافية مشتقة من ارتفاع القناة.
وتسمح هذه الخيارات للمستخدم بتحديد درجة الصرامة المطلوبة في تأكيد كسر حدود القناة.
الحالة الصاعدة تعني أن شرط اختراق الحد العلوي قد تحقق وفق الطريقة المختارة، والحالة الهابطة تعني تحقق الشرط المقابل أسفل الحد السفلي.
وصف الاختراق يعني تحقق الشرط البرمجي المرتبط بحد القناة، ولا يمثل توصية بالدخول في صفقة.
• الأهداف المتتابعة
بعد تأكيد الاختراق يستخدم المؤشر ارتفاع القناة المكتشفة باعتباره مرجعًا لنظام الإسقاط السعري.
تتقدم الأهداف بمراحل تعادل نصف ارتفاع القناة انطلاقًا من مرجع الاختراق.
وعند وصول السعر إلى الهدف النشط ينتقل السكربت إلى المستوى التالي، مع الاحتفاظ بمستويات الأهداف التي تم الوصول إليها على الشارت.
وبذلك تتم متابعة امتداد الحركة على مراحل بدل الاعتماد على هدف واحد ثابت.
هذه المستويات عبارة عن إسقاطات هندسية مشتقة من القناة، ولا تقيس احتمال وصول السعر إلى أي مستوى معين.
• متابعة إعادة الاختبار
بعد الاختراق يستمر Hunter Channel في مراقبة العلاقة بين السعر والحد المتوقع للقناة.
بعد مرور الشموع الأولى من الاختراق، يفحص السكربت ما إذا كان السعر قد عاد إلى المنطقة القريبة من الحد ذي الصلة ثم أغلق مرة أخرى في جهة الاختراق.
وعند تحقق الشروط المبرمجة تظهر حالة إعادة الاختبار.
وتمثل إعادة الاختبار وصفًا لتفاعل السعر مع حد القناة السابق ولا تضمن استمرار الحركة.
• فشل الاختراق
يحتوي السكربت كذلك على شرط لإبطال حالة الاختراق النشطة.
إذا أغلق السعر بدرجة كافية مرة أخرى داخل القناة المتوقعة بعد الاختراق، مقارنة بارتفاع القناة، تتم معاملة الحالة باعتبارها اختراقًا فاشلًا.
بعد ذلك يتم مسح القناة وأهدافها المرتبطة بها، ويستمر محرك القنوات في تقييم البنى اللاحقة.
وبذلك يعمل المؤشر وفق دورة حالة تبدأ باكتشاف القناة، ثم متابعة الاختراق، ثم متابعة الأهداف أو إعادة الاختبار، أو إبطال الاختراق عند تحقق شروط الفشل.
• سياق Radar
يتضمن Hunter Channel مكونًا مستقلًا باسم Radar لتوفير سياق اتجاهي إضافي إلى جانب البنية الهندسية للقناة.
يعتمد Radar على بنيتين سعريتين بتنعيم مختلف. الأطوال الافتراضية هي 11 و33، يليهما تنعيم قصير إضافي.
ويحدد الموقع النسبي بين خطي Radar لون المنطقة الواقعة بينهما، كما يتم رسم خط في منتصف البنيتين.
Radar لا يحدد نقاط Pivot الخاصة بالقناة، ولا حدودها، ولا تقييم جودتها، ولا شروط الاختراق.
سبب وجوده إلى جانب القناة هو أن كل مكون يصف جانبًا مختلفًا من حركة السعر. القناة تصف البنية الهندسية والتفاعل مع الحدود، بينما يقدم Radar قراءة ممهدة للبيئة الاتجاهية الحالية.
وبذلك يستطيع المستخدم مقارنة القناة أو الاختراق بالسياق الاتجاهي المحيط دون دمج الحسابين في إشارة واحدة.
• لوحة التحليل
تلخص لوحة التحليل حالة القناة التي تتم متابعتها من خلال تقييم الجودة، وزاوية القناة، وعرض القناة، والتقييم السياقي للاختراق، والهدف النشط التالي.
هذه القراءات عبارة عن أوصاف مشتقة من قياسات البنية داخل السكربت، ولا ينبغي تفسيرها على أنها احتمالات إحصائية أو نسب نجاح أو عوائد تداول متوقعة.
• لغة لوحة التحليل
تدعم لوحة المؤشر اللغتين الإنجليزية والعربية.
يمكن تغيير اللغة من:
Settings → Dashboard → Table Language / لغة الجدول
تغيير اللغة يؤثر فقط في النصوص المعروضة ولا يغير اكتشاف القنوات أو تقييمها أو شروط الاختراق أو الأهداف أو حسابات Radar.
• التنبيهات
يتضمن السكربت تنبيهات لعدد من الأحداث المبرمجة، ومنها اكتشاف قناة جديدة مستوفية للشروط، وتأكيد اختراق أحد الحدود، والوصول إلى هدف، واكتمال إعادة الاختبار، واكتشاف فشل الاختراق.
ظهور التنبيه يعني أن الشرط البرمجي المقابل قد تحقق، ولا يمثل أمر تداول أو توجيهًا شخصيًا للدخول أو الخروج.
• طريقة مقترحة لقراءة المؤشر
يمكن البدء بمراجعة القناة نفسها من خلال حدودها وعرضها وزاويتها وتقييم بنيتها.
بعد ذلك تتم مراقبة تفاعل السعر مع الحدين العلوي والسفلي واستخدام طريقة تأكيد الاختراق التي يختارها المستخدم.
إذا تحقق الاختراق، توفر الأهداف المتتابعة وحالة إعادة الاختبار معلومات إضافية عن تطور السعر بعد الحدث.
أما Radar فيمكن استخدامه باعتباره سياقًا اتجاهيًا إضافيًا، وليس شرطًا لاكتشاف القناة أو تأكيد الاختراق.
• حدود الاستخدام
Hunter Channel أداة للتحليل الفني وليس نظام تداول آليًا.
تعتمد البنية على نقاط Pivot مؤكدة، ولذلك لا يمكن تحديد القناة إلا بعد توفر بيانات الارتكاز المطلوبة.
وجود قناة صحيحة تاريخيًا لا يعني أن السعر سيستمر في احترام حدودها.
وقد يفشل الاختراق أو ينعكس أو ينتج عنه امتداد محدود.
تقييم الجودة يصف خصائص القناة المكتشفة ولا يقيس الربحية المستقبلية.
الأهداف عبارة عن إسقاطات هندسية ولا تضمن وصول السعر إلى المستويات المعروضة.
كما أن Radar يصف حركة سعرية ممهدة ولا يستطيع تحديد الاتجاه المستقبلي بصورة مؤكدة.
ونظرًا إلى أن السكربت يعرض حالات اختراق اتجاهية، فهو مخصص للاستخدام على الشارتات السعرية القياسية. أنواع الشارت الاصطناعية مثل Heikin Ashi وRenko وKagi وPoint & Figure وRange قد تنتج بيانات سعرية مختلفة، ولذلك لا ينبغي استخدام نتائجها لتقييم سلوك إشارات الاختراق باعتباره أداء تداول واقعيًا.
• إخلاء المسؤولية
Hunter Channel مخصص للتحليل الفني والأغراض التعليمية.
ولا يقدم نصيحة استثمارية أو مالية أو توصية بشراء أو بيع أي أداة مالية.
ولا تضمن أي قناة أو تقييم جودة أو حالة اختراق أو إعادة اختبار أو هدف أو قراءة Radar أو أي مخرج آخر من السكربت اتجاه السوق المستقبلي أو نتائج التداول.
ويبقى المستخدم مسؤولًا عن تحليله وقرارات التنفيذ وحجم المراكز وإدارة المخاطر.
Indicador

Swing Portfolio Trim Dashboard v1.5**Swing Portfolio Trim Dashboard**
A technical portfolio-ranking tool designed for swing traders who typically hold positions for roughly **1–3 months** and need a systematic way to decide which holdings to trim, exit, hold, or continue riding.
The indicator is designed for portfolios containing many positions and focuses entirely on **price action, momentum, trend strength, volatility-adjusted performance, and technical deterioration** rather than fundamentals.
### Technical Score
Every holding receives a **0–100 Technical Score** based on:
* **10-day raw momentum — 5%**
* **20-day raw momentum — 10%**
* **50-day raw momentum — 15%**
* **10-day volatility-adjusted momentum — 2.5%**
* **20-day volatility-adjusted momentum — 7.5%**
* **50-day volatility-adjusted momentum — 15%**
* **10/20/50 EMA trend structure — 20%**
* **ATR-normalized trend health — 25%**
Raw momentum captures absolute leadership, while volatility-adjusted momentum helps normalize comparisons between securities with very different volatility profiles.
This is particularly useful when comparing ordinary stocks, ETFs, and higher-volatility instruments within the same portfolio.
### Portfolio Relative Ranking
Momentum components are converted into **cross-sectional percentile ranks relative to the other securities in the portfolio**.
A stock ranking highly therefore means it is technically stronger than most of the alternatives currently held.
**Tech#** represents this overall ranking:
* **#1 = strongest holding**
* Higher numbers = progressively weaker holdings
### Multi-Horizon Momentum
The model uses three time horizons:
* **10D** — short-term acceleration/deceleration
* **20D** — current swing momentum
* **50D** — broader swing trend
The shorter 10-day horizon receives less weight to reduce sensitivity to temporary price noise.
### Volatility Normalization
The dashboard uses realized volatility and ATR so that securities with very different volatility characteristics can be compared more fairly.
For example, a +10% move in a low-volatility ETF may represent much stronger risk-adjusted momentum than the same +10% move in a highly volatile leveraged product.
### Trend Score
Trend strength is evaluated using:
* Price above EMA10
* Price above EMA20
* Price above EMA50
* EMA10 above EMA20
* EMA20 above EMA50
* Rising EMA20
* Rising EMA50
A **Trend score of 100** represents a very strong and well-structured swing trend.
### ATR20
**ATR20** measures the stock's distance from its 20-day EMA in ATR units:
`(Price - EMA20) / ATR(14)`
Examples:
* **+2.0** = price is 2 ATR above EMA20
* **+0.2** = slightly above EMA20
* **-0.5** = modestly below EMA20
* **-1.0** = meaningful technical damage
* **-2.0** = severe deterioration relative to normal volatility
Using ATR allows the model to distinguish normal volatility from genuinely abnormal price deterioration.
### Score Deterioration
The dashboard tracks how Technical Score changes over time.
**Δ5**
`Current Score - Score 5 trading days ago`
**Δ10**
`Current Score - Score 10 trading days ago`
Negative values indicate deterioration.
For example:
`Δ5 = -12`
means the Technical Score has fallen 12 points during the last five trading sessions.
### RankΔ5
**RankΔ5** measures how the security's portfolio ranking changed during the last five sessions.
Negative values mean the stock is being overtaken by other holdings.
This can help distinguish between:
* a stock whose own technical condition is breaking down, and
* a stock that remains healthy but is losing relative leadership.
### Action Engine
Each security receives an Action classification:
**EXIT**
Severe technical weakness with confirmed longer-term trend damage.
**TRIM**
Weak portfolio ranking combined with confirmed EMA/ATR deterioration.
**TRIM WATCH**
A weak holding approaching or beginning a technical breakdown.
**DETERIORATING**
Momentum or relative ranking is deteriorating, but the underlying price trend has not yet broken enough to justify an automatic trim.
**HOLD**
Technical condition remains acceptable.
**RECOVERING**
A historically weak holding whose technical score is improving materially.
**LEADER**
A top-ranked holding with strong trend structure.
### Trim Priority
Technical Score and Trim Priority are deliberately separate.
**Technical Score** answers:
> How strong is this holding today?
**Trim Priority** answers:
> If I need to reduce positions, which holding deserves attention first?
Trim Priority combines:
* **65% current technical weakness**
* **25% 5-day score deterioration**
* **10% 10-day score deterioration**
However, the dashboard does **not** blindly rank positions by this number.
The Action Engine takes priority.
Sell-eligible states are considered first:
**EXIT → TRIM → TRIM WATCH**
Trim Priority then helps rank securities within those groups.
This prevents an improving laggard from being sold before a genuinely broken position.
### Trim# vs Tech#
The dashboard contains two different rankings:
**Tech#**
Ranks holdings from technically strongest to weakest.
**Trim#**
Ranks holdings according to which positions should be reviewed first when reducing exposure.
These numbers may differ substantially because Trim# also considers deterioration, trend damage, and recovery.
### SPY / QQQ Comparison
The Diagnostics view also displays relative 20-day performance versus:
* SPY
* QQQ
These values are informational and currently **do not affect the Technical Score**, allowing securities from different sectors and asset exposures to compete primarily on their own technical characteristics.
### Portfolio Management Use
The dashboard is designed to answer a practical question:
> If I own 30–40 positions and need to remove 3–4 names, where should I look first?
Rather than manually reviewing every chart, the trader can begin with the highest-ranked **EXIT / TRIM / TRIM WATCH** candidates and then examine the underlying technical evidence.
The indicator is calculated from **daily data** and is intended primarily for decisions made after the daily close rather than intraday trading.
The portfolio ticker list can be edited directly from the indicator settings, allowing holdings to be added or removed without rewriting the Pine Script.
**This indicator is a technical decision-support and portfolio-ranking tool. It is not financial advice and should not be used as a standalone trading or risk-management system.**
Indicador

MFx Trend Vitality Engine V4Trend Vitality Engine V4
Trend Vitality Engine is a market-analysis indicator designed to describe the evolving condition of buyer and seller campaigns rather than generate entry, exit, top, bottom, or price-prediction signals.
The underlying concept is to treat an active directional move as a developing campaign. Instead of asking only whether price is moving up or down, TVE evaluates several characteristics of the buyer and seller sides and organizes them into an instrument-panel view of trend condition.
Core framework
TVE evaluates several related but distinct aspects of campaign health:
Vitality represents the overall aliveness and condition of the active buyer or seller campaign.
Structural Vitality represents the slower structural condition underlying that campaign.
Live Vitality represents its more immediate condition.
Power represents current applied directional pressure.
Efficiency / Transmission represents how effectively campaign energy is being converted into directional progress.
Durability represents recent structural resilience or accumulated wear.
Reserve / Fuel is a composite measure of usable campaign capacity derived from Power, Efficiency and Durability.
Dominance identifies which side currently holds greater control according to the TVE framework.
State and Phase describe the current internal condition of the buyer-versus-seller contest.
Lifecycle is a heuristic evidence-voting model that describes campaign evolution through stages such as expansion, maturity, distribution, fatigue, capitulation, repair, accumulation and emergence.
Market Health is a composite summary of underlying TVE measurements. It should not be interpreted as an additional independent confirmation signal.
Timeframe cascade
TVE evaluates market condition in the context of a higher-timeframe cascade . The dashboard displays the chart timeframe and the corresponding higher-timeframe context so that the current campaign can be interpreted within a broader market structure.
This allows the indicator to be used as an instrument panel rather than reducing market condition to a single directional reading.
What changed in V4
V4 preserves the established TVE architecture while correcting the live Durability mechanism.
In the previous version, lifetime accumulated damage could continue building across campaign history until the usable Durability range became saturated. This could cause Durability to remain at or near its lower boundary and reduce its ability to represent current structural wear.
V4 retains lifetime accumulated damage as historical diagnostic information but uses rolling live damage for the active Durability calculation. This allows current structural wear to increase during deterioration and recover as damaging evidence leaves the active measurement window.
Repaired Durability is then passed through the existing Reserve calculation and existing downstream TVE systems. The Reserve equation itself was not redesigned for this release.
Because Durability is once again an active input, users should expect some Reserve, Market Health, Lifecycle and related downstream readings to differ from the previous version.
Lifecycle interpretation
Lifecycle stages describe campaign evolution and should not be interpreted as direct forecasts of immediate price direction.
In particular, stages such as Bear Repair, Bear Accumulation and Bear Emergence describe developments occurring within, or emerging from, a bearish campaign context. The word "Bear" identifies the campaign context and does not necessarily mean that the indicator is forecasting an immediate price decline.
Lifecycle Evidence Score represents the strength of evidence supporting the selected lifecycle classification. It is not a calibrated probability or statistical confidence level.
How to use TVE
TVE is intended to be read as a collection of related gauges rather than as a single signal.
A user can begin with Dominance and the higher-timeframe context to understand which side currently controls the campaign. Vitality and Power describe campaign condition and applied pressure. Efficiency describes conversion quality. Durability and Reserve provide information about structural wear and usable capacity. Lifecycle provides context about campaign evolution, while Market Health summarizes the broader condition represented by the underlying gauges.
Divergence, decay, structural events and warning conditions provide additional context when the internal condition of a campaign begins to differ from its surface behavior.
The Command Center summarizes these measurements in plain-language descriptions while the detailed dashboard exposes the underlying buyer and seller measurements.
Alerts
V4 includes alert conditions for Trend Vitality Critical, Trend Vitality Rapid Decay, Critical Vitality plus Structural Event, Late Cycle Divergence, and Silent Damage Accumulating.
These alerts identify TVE conditions. They are not automated trade recommendations.
Research and limitations
TVE was developed as an experimental framework for observing trend health and buyer-versus-seller campaign behavior across multiple timeframes.
V4 follows a validation process that included comparison of internal measurements across multiple instruments and timeframes and investigation of the Durability mechanism. The V4 Durability change addresses an identified mechanical behavior in the previous implementation.
This validation should not be interpreted as evidence that TVE predicts future returns. Individual TVE measurements can overlap because several gauges intentionally summarize related aspects of the same underlying campaign.
TVE does not claim to predict market tops or bottoms, forecast future prices, identify guaranteed reversals, or provide statistically guaranteed entries or exits.
It is intended as an analytical instrument panel that helps users observe the evolving health, pressure, efficiency, wear, reserve, lifecycle and control of buyer and seller campaigns.
Version continuity
V4 is the current version of the Trend Vitality Engine. V3 remains the legacy version so existing charts and previous observations can be preserved and compared without silently changing the historical implementation. Indicador
