SMC Liquidity Sweep Swing High/Low [JPT]🔷 OVERVIEW
Liquidity Sweep Reversal Engine is a price-action indicator designed to identify potential reversal setups after price sweeps confirmed swing highs or swing lows and rejects the liquidity level.
The indicator combines swing structure, liquidity sweep detection, rejection candles, trend confirmation, displacement, and optional volume analysis to filter potential LONG and SHORT setups.
After a confirmed signal, the indicator automatically provides a trade plan with:
• Entry level
• Stop Loss
• TP1 / TP2 / TP3
• Risk-Reward levels
• Signal score
🔷 CONCEPTS
Liquidity Sweep Detection
The indicator tracks confirmed swing highs and lows as potential liquidity areas.
• Buy-side liquidity sweep → price takes a previous swing high and rejects below it → SHORT bias.
• Sell-side liquidity sweep → price takes a previous swing low and rejects above it → LONG bias.
Rejection Confirmation
A sweep can be filtered using:
• Close back through the liquidity level
• Rejection wick
• Minimum wick percentage
• Candle direction
Trend Confirmation
An optional EMA filter helps align signals with the current market direction.
Displacement
The indicator can require a minimum candle-body size relative to ATR to help filter weak price movements.
Volume Filter
Optional relative-volume confirmation can be enabled to identify sweeps occurring with increased market participation.
🔷 FEATURES
1. Swing Liquidity Detection
• Automatic swing high/low detection
• Buy-side and sell-side liquidity levels
2. Liquidity Sweeps
• High sweep detection
• Low sweep detection
• Rejection confirmation
3. Signal Filtering
• EMA trend filter
• Displacement filter
• Optional volume filter
• Signal score from 1–5
4. Trade Management
• Automatic Entry
• ATR-based Stop Loss
• TP1 / TP2 / TP3
• Custom Risk-Reward ratios
5. Visuals
• Liquidity lines
• Swing labels
• LONG / SHORT labels
• Entry / SL / TP levels
6. Alerts
• LONG signal
• SHORT signal
• TP1 / TP2 / TP3
• Stop Loss
🔷 APPLICATIONS
1. Liquidity Sweep Reversals
Identify potential reversal opportunities after price takes liquidity above a swing high or below a swing low.
2. Market Structure Mapping
Use confirmed swing levels to visualize important liquidity areas and potential reaction zones.
3. Signal Filtering
The optional trend, displacement, volume, and score filters can help reduce weaker setups.
4. Trade Planning
The built-in Entry, Stop Loss, and multiple Take Profit levels provide a structured framework for evaluating trades.
🔷 NOTES
• Lower pivot settings generate more signals and may produce more noise.
• Higher pivot settings identify larger structural liquidity levels.
• Liquidity sweeps do not guarantee reversals.
• Signal confirmation occurs on the closed candle.
• Always evaluate signals within the broader market structure and apply appropriate risk management. Indicator

Bollinger-Fibonacci Trend Extension [MarkitTick]💡 This tool automates the identification of three-point corrective price structures (A-B-C swings) and projects a suite of Fibonacci-based extension targets from them, filtered through a Bollinger Band mean-reversion confirmation layer and an optional trend-strength gate. Rather than requiring a trader to manually draw retracement/extension tools every time price forms a pullback, the script continuously scans pivot structure in real time, validates the geometry of each swing against strict corrective-wave rules, and projects a set of forward-looking price zones — including a shaded "Golden Zone" between the 1.5 and 1.618 extensions — the moment a qualifying structure is confirmed.
✨ Originality and Utility
Fibonacci extension tools are common on PulseWire, but most require manual anchor placement on every swing and provide no objective criteria for which swings are valid setups. This script closes that gap by fully automating structure detection: it runs a custom zigzag engine with a significance threshold (ATR-based or percentage-based) to filter noise, then validates any three consecutive pivots against explicit corrective-structure rules (alternating high/low sequence, with the C-point required to retrace between the A and B extremes) before it will draw anything.
Two independent confirmation layers are stacked on top of raw structure detection: a Bollinger Band basis-cross filter that requires price to be trading on the correct side of its short-term mean before a new structure is accepted, and an optional ADX/DMI filter that suppresses structures formed during low directional-strength conditions. A configurable "adaptive filter" further lets traders pre-smooth the high/low series feeding the pivot engine using one of eight smoothing methods — including a Kalman filter and an LLAMA (linear-regression-slope-adjusted moving average) implementation — before pivots are ever detected, changing the sensitivity and lag characteristics of what counts as a swing point. The combination of automated, rule-based structure validation, dual confirmation filters, and selectable pre-smoothing is what differentiates this from a static or manually-drawn extension tool.
🔬 Methodology and Concepts
• Adaptive Pivot Detection
The script identifies swing highs and lows using a symmetric lookback/lookforward window (the "Pivot Lookback Depth" input): a bar qualifies as a pivot high only if no other bar within that window on either side has a higher value, and analogously for pivot lows. Traders can choose to feed this detection engine either raw high/low price or a smoothed version of it via the Adaptive Filter setting. Available smoothing methods include standard SMA, EMA, and RMA; a Double WMA (a WMA applied twice in succession, sharpening lag reduction); a Triple VWMA (volume-weighted MA applied three times); HMA (Hull Moving Average); LLAMA, a custom method that adds a linear slope projection (calculated from the change in price over the lookback window) on top of a simple average; and a lightweight Kalman filter that recursively updates a state estimate based on a fixed process/measurement noise ratio. Smoothing the pivot source changes which swings register as significant, effectively tuning the sensitivity of the whole structure-detection pipeline.
• Significance Threshold
Not every alternating high/low pair is kept — a new pivot only replaces the prior point of the same type, or is added as a new leg, if it clears a minimum distance threshold from the last opposite-type point. This threshold can be set as a multiple of ATR (Average True Range, over a configurable period) or as a fixed percentage of the current close, letting the sensitivity of the zigzag scale with volatility or stay fixed in percentage terms.
• A-B-C Structure Validation
Once at least three qualifying zigzag points exist, the script inspects the most recent three (A, B, C) to determine whether they form a valid corrective structure. A bullish setup requires the sequence low → high → low (A is a low, B a high, C a low), with the additional geometric constraint that point C must close above point A but below point B — meaning the pullback from B did not fully retrace into new lows and did not exceed the origin of the move. The bearish case is the mirror image (high → low → high, with C bounded between A and B). Structures that don't satisfy these geometric constraints are rejected outright; the script will not draw a structure from just any three consecutive swings.
• Bollinger Band Confirmation Filter
When enabled, a newly detected A-B-C structure is only accepted if the prior confirmed close is positioned correctly relative to the Bollinger Band basis (an SMA of price, with upper/lower bands built from standard deviation multiples): bullish structures require the close to be above the basis, bearish structures require it to be below. This filters out structures forming against the prevailing short-term mean, reducing the incidence of countertrend triggers.
• ADX/DMI Trend-Strength Filter (optional)
When the ADX filter is enabled, new structures are only confirmed if the ADX value (calculated from the Directional Movement Index over a configurable length) meets or exceeds a user-defined threshold. This is intended to suppress structure formation during ranging, low-momentum conditions where corrective patterns are statistically less reliable.
• Fibonacci Extension Projection
Once a structure is confirmed, the script projects forward price targets from the A-B-C swing using the standard extension formula: target = C + ((B − A) × ratio). An optional logarithmic-scale calculation is available, which performs the equivalent projection in log-price space before converting back — useful on instruments or timeframes where percentage moves are more meaningful than absolute point moves. Selectable extension ratios include 0.618, 1.000, 1.272, and 1.618, each independently toggleable, plus a fixed internal 1.5 ratio used only to bound the shaded "Golden Zone." Each level is optionally annotated with a loose Elliott Wave association label (e.g., the 1.618 level is labeled "Wave 3") purely as a descriptive reference point for traders familiar with that framework — the script does not perform full Elliott Wave counting or degree analysis.
• Structure Invalidation
Active structures are continuously monitored: a bullish structure is invalidated if the close trades back below point A, and a bearish structure is invalidated if the close trades back above point A. This uses the point-A extreme as a structural stop level, consistent with the idea that a valid corrective pattern should not be revisited past its origin. On invalidation, the trader can choose to have the structure's drawings grayed out in place (to preserve chart history) or fully deleted.
🎨 Visual Guide
Gold and blue lines plotted directly on price represent the Bollinger Bands: the basis (gold, an SMA of price) and the upper/lower bands (blue, basis ± a standard-deviation multiple). These can be hidden independently of the confirmation filter itself.
Solid colored lines connect point A to point B, and dashed colored lines connect point B to point C, forming the visual "A-B-C" skeleton of each detected structure. Color reflects direction: the Bullish Structure Color for up-setups and the Bearish Structure Color for down-setups (both user-configurable, default green/red).
Small labeled tags marked "A," "B," and "C" are placed at each swing point, color-matched to the structure's direction, with their vertical orientation (label above or below price) automatically flipped depending on whether the point is a high or a low.
Dotted horizontal lines extending from point C represent each active Fibonacci extension level (0.618, 1.000, 1.272, 1.618, as enabled). The 1.618 level is rendered as a solid line rather than dotted, distinguishing it as the primary extension target. Each line carries a right-aligned label showing the ratio, its optional Elliott Wave tag, and the exact price level.
A shaded rectangular zone between the 1.5 and 1.618 extension levels — tinted in the structure's directional color — marks the "Golden Zone," a commonly-referenced confluence area for potential reversals or profit-taking, with a "Golden Zone" text label at its midpoint.
When a structure is invalidated and the "Gray Out" invalidation action is selected, all of the above elements (lines, labels, the zone fill) desaturate to the Invalidated Structure Color, visually distinguishing historical, no-longer-valid structures from the currently active one without removing them from the chart.
An on-chart dashboard (top-right by default, repositionable) displays: the current symbol and timeframe, an overall directional Bias read from the most recent structure, the current ATR value, the active significance threshold in price terms, a visual bar-gauge showing how many structures are currently tracked relative to the configured maximum, the pass/block state of the Bollinger Band filter, the live ADX reading and pass/fail state, the selected Adaptive Filter method, and a log of the last structural event (new bullish/bearish structure, or bullish/bearish invalidation).
📖 How to Use
Wait for a complete A-B-C structure to be drawn and confirmed — the script only finalizes structures on confirmed bar closes, so no signal will repaint intrabar.
A newly confirmed bullish structure (green by default) suggests the recent pullback (B to C) may extend toward the plotted Fibonacci levels; the 1.618 extension and the shaded Golden Zone are commonly treated as primary target/reaction areas.
A newly confirmed bearish structure works symmetrically to the downside.
Point A acts as the structural invalidation level: if price closes back through point A against the direction of the setup, treat the structure as void — the script will automatically flag this via graying-out or deletion, along with a dashboard "Last Event" update and an optional alert.
Use the Bollinger Band filter to avoid structures forming against the short-term mean, and the ADX filter to avoid trading corrective setups during flat, low-momentum conditions.
The dashboard's Bias, Threshold, and filter-status rows are designed to be checked at a glance before acting on any newly drawn structure.
Built-in alerts are available for new bullish/bearish structures and for bullish/bearish invalidations, each firing a JSON-formatted payload (ticker, timeframe, direction, entry, TP, SL) suitable for direct use with webhook-based automation, with the action keywords for each alert type fully customizable in the Alerts group.
⚙️ Inputs and Settings
Pivot Lookback Depth — the number of bars checked on each side of a candidate bar when detecting swing highs/lows. Larger values produce fewer, more significant pivots and slower reaction time; smaller values increase sensitivity and structure frequency.
Use ATR-Based Threshold / ATR Period / ATR Multiplier — when enabled, the minimum move required to register a new zigzag leg scales with recent volatility (ATR × multiplier) rather than a fixed percentage.
Fixed Deviation % — used instead of the ATR threshold when ATR-based thresholding is disabled; sets the minimum percentage move required between opposite-type pivots.
Enable Structure Invalidation — toggles whether structures are automatically invalidated when price closes back through point A.
Keep Last N Structures — caps how many structures remain tracked/drawn simultaneously; older structures are cleaned up once the cap is exceeded.
Enable BB Confirmation Filter / BB Length / BB StdDev Mult — controls the Bollinger Band basis-cross requirement for new structures, and the parameters of the underlying Bollinger Band calculation.
Use ADX Filter / ADX Threshold / ADX Length — controls the optional trend-strength gate and its calculation parameters.
Adaptive Filter / Adaptive Filter Length — selects the smoothing method (if any) applied to the high/low series before pivot detection, and its lookback length.
Invalidation Action — choose whether invalidated structures are grayed out in place or deleted from the chart.
Show Bollinger Bands / Use Logarithmic Scale — visual toggle for the BB plots, and whether extension targets are computed in log-price space.
Show 0.618 / 1.000 / 1.272 / 1.618 Level — independently toggle each Fibonacci extension line.
Extend Lines Right — extends extension lines indefinitely to the right instead of stopping at the current bar.
Show A-B-C Labels / Show Structure Lines / Show Elliott Wave Labels — independent visibility toggles for each drawing category.
Show Dashboard / Position — toggles the on-chart dashboard table and sets its screen corner.
Alert action fields (Open Long/Short, Close Long/Short) — customizable text keywords embedded in the JSON alert payloads, matching the syntax expected by the trader's automation/webhook setup.
Enable Test Alert — fires a payload on every confirmed bar close, intended only for verifying webhook routing before disabling it.
Color inputs — full control over structure colors, label backgrounds, invalidated-structure color, Bollinger Band plot colors, and dashboard styling.
🔍 Deconstruction of the Underlying Scientific and Academic Framework
The script's structural core rests on the concept of a zigzag transformation, a standard technique in technical analysis for reducing noisy price series into a simplified sequence of significant turning points, filtered here by a volatility-normalized (ATR-scaled) or percentage-based significance threshold rather than a fixed tick count — a design choice that keeps the sensitivity of the transformation consistent across instruments and volatility regimes.
The A-B-C labeling convention and the specific extension ratios offered (0.618, 1.000, 1.272, 1.618) draw on the Fibonacci sequence and its derived ratios, which have a long history of application in corrective-wave analysis, most notably within Elliott Wave Theory and W.D. Gann's work on proportional price projections. The mathematical basis is the golden ratio (φ ≈ 1.618) and its reciprocal/power relationships, which recur in the ratios above; their use in this script is descriptive and pattern-based rather than derived from any claim of causal market structure — the script projects targets from these ratios but does not assert that price is mechanically obligated to reach them.
The optional Bollinger Band filter is grounded in the standard statistical definition of a Bollinger Band: a moving-average basis with bands set at a multiple of the rolling standard deviation, functioning here as a simple mean-reversion/trend-context gate rather than a full volatility-breakout system.
The ADX/DMI filter derives from Welles Wilder's Directional Movement System, which measures trend strength independently of trend direction by comparing the magnitude of directional price movement to overall volatility (true range) over a smoothing period; using it as a pre-condition for structure confirmation is consistent with its original design purpose of distinguishing trending from non-trending regimes.
The adaptive smoothing options span several distinct estimation philosophies: SMA/EMA/RMA represent classical fixed- and exponentially-weighted moving averages; the Double WMA and Triple VWMA apply cascaded weighted/volume-weighted averaging to reduce lag at the cost of some smoothness; HMA (Hull Moving Average) is a weighted-average construction specifically designed to reduce lag while preserving smoothness; the Kalman filter implementation applies a simplified recursive Bayesian estimation approach (balancing a process-noise and measurement-noise ratio to continuously re-weight new observations against the prior estimate), a technique originally developed for state estimation in control systems and adapted here for price smoothing; and the LLAMA method combines a simple average with a linear slope term derived from the net change in price over the lookback window, a basic linear-regression-style adjustment for trend drift.
⚠️ 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. Indicator

Smart Trend Filter Confirmation [MarkitTick]💡 A confirmed-bar trend-following system that fuses a volatility-adaptive trailing band with a six-condition consensus filter, designed to suppress the false flips that plague standard trend-following tools when markets stall, chop, or thin out. Rather than reacting to every band cross, the script cross-examines each potential signal against stall detection, slope strength, volume participation, range compression, basis-point movement, and trend strength (ADX) before allowing a flip to display — while retaining a breakout override so genuinely explosive moves are never suppressed by the very filters designed to catch noise.
✨ Originality and Utility
Trailing-band trend systems (Chandelier-style or SuperTrend-style constructs) are common on PulseWire, but nearly all of them share the same weakness: the trailing line flips direction on every price crossover, regardless of whether that crossover reflects a genuine change in market character or simply noise generated during a stalled, illiquid, or compressing market. This script's originality lies in the "Regime Consensus" layer built on top of the adaptive trailing band. Six independent, mathematically distinct filters — measuring band stall, linear-regression slope, relative volume, historical range percentile, basis-point velocity, and ADX-based trend strength — are computed every bar. If any single filter flags a "flat" regime, the display direction is held at its last confirmed state instead of flipping, which materially reduces whipsaw signals in ranging conditions. A dedicated breakout override simultaneously monitors for abnormally large single-bar moves (measured in ATR multiples) and forces the flip through regardless of filter status, ensuring the system does not become sluggish during genuine volatility expansion. This combination — adaptive smoothing of the source price, a volatility- and momentum-weighted dynamic band, a multi-factor flat-market veto, and a breakout bypass — is not a simple mashup of stock indicators but an integrated decision layer where each component directly informs whether the others are permitted to act. The trend line, filters, override, and dashboard are not separable add-ons; they operate as a single signal-gating pipeline.
🔬 Methodology and Concepts
● Adaptive Source Smoothing
Before any band math is applied, the script conditions the underlying HL2-style source price using one of two selectable adaptive filters:
Kalman Filter — a recursive estimator that maintains an internal "belief" about the true price and a corresponding uncertainty (error covariance). Each new bar, the filter computes a gain factor from the ratio of predicted uncertainty to total uncertainty (predicted plus measurement noise, set by the Kalman R input) and blends the new price observation into its estimate proportionally. A higher Kalman Q input allows the estimate to adapt faster to new prices; a higher Kalman R input makes the filter trust new observations less, producing a smoother but slower-reacting line.
LLAMA (an adaptive-length moving average inspired by Kaufman's Efficiency Ratio concept) — measures how efficiently price has moved over the lookback window by comparing net directional change to the sum of all bar-to-bar movement (an efficiency ratio between 0 and 1). This ratio is squared into a smoothing constant that continuously shifts the moving average's responsiveness between a fast EMA-like constant and a slow EMA-like constant, so the average tightens to price during clean directional runs and widens during choppy conditions.
• Dynamic Volatility Band
The core trailing band's half-width is not a fixed ATR multiple. It is calculated from three weighted components: a base multiplier, an ATR-based term scaled by the ATR Weight input, and a normalized recent-price-movement term (capped at its own 95th percentile to prevent single outlier bars from distorting the band) scaled by the Move Weight input. This composite value is then multiplied by the current ATR and smoothed with an exponential moving average (controlled by the Smooth Len input) to prevent the band width itself from jumping erratically bar to bar.
• Trailing Trend Line Construction
The trend line follows classic chandelier-style trailing logic: while price remains above the trend line, the line can only ratchet upward (never retreating below its prior value even if the lower band momentarily dips beneath it); while price remains below the trend line, the line can only ratchet downward. A flip only occurs when confirmed prior-bar closing price crosses to the opposite side of the line.
• Six-Factor Regime Consensus Filter
Before a directional flip is permitted to display, up to six independent conditions are checked. If any active filter flags the market as "flat," the displayed direction holds at its previous confirmed state rather than flipping:
Stall Filter — flags when the trend line's bar-to-bar movement is smaller than a fraction (Flatness input) of current ATR, indicating the line itself has gone quiet.
Slope Filter — runs a short linear regression across recent trend-line values, measures the resulting slope, normalizes it against ATR, and flags when that normalized slope falls below the Slope Thr input.
Volume Filter — flags when confirmed volume falls at or below its own moving average, treating below-average participation as unreliable for a fresh directional call.
Range Filter — flags when the current bar's high-low range falls within the lower percentile band (Range Pct input) of its historical distribution over the Pctile Len lookback, identifying range compression.
BPS Filter — converts the trend line's bar-to-bar movement into basis points relative to price and flags when that figure falls under the Min BPS input, catching moves too small to be economically meaningful.
ADX Filter — computes a standard Directional Movement Index reading and flags when it sits below the ADX Thr input, indicating weak underlying trend strength.
• Breakout Override
Running in parallel to the consensus filters, this component measures the absolute prior-bar price change against a multiple of ATR (Ovr ATR Mult input). If that threshold is exceeded, the override forces the flip through immediately, bypassing every flat-market filter above. This prevents the filter layer from muting the system's response to genuine volatility expansion or breakout conditions.
🎨 Visual Guide
Trend Line — a stepped line plotted along the confirmed trailing band value. It renders in the Bull color when the confirmed direction is up and the Bear color when down; both colors are fully customizable in the Colors group.
Gradient Candles / Bar Coloring — when enabled, chart candles and bars are recolored on a gradient between the Neutral color and the active directional color, with gradient intensity scaled by how far confirmed price has extended from the trend line relative to ATR (capped at 3x ATR for full saturation). A muted candle indicates price sitting close to the trend line; a fully saturated candle indicates an extended move.
Cloud Fill — a semi-transparent fill (opacity set by Cloud Transp) rendered between the trend line and a short moving average of HLC3 (length set by Cloud MA Len), tinted in the active directional color to visually reinforce which side of the trend the market currently occupies.
Bull / Bear Signal Labels — a "Bull" label appears below price the bar a confirmed flip to the up-regime occurs, and a "Bear" label above price on a confirmed flip to the down-regime, provided the Regime Consensus Filter did not veto the flip and Lock Signal is not engaged.
Trade Level Lines and Labels (optional, enabled via Show Trade Levels) — on each new confirmed signal, five lines are drawn forward from the signal bar: an Entry line (at prior confirmed close), a Stop Loss line, and three Take Profit lines (TP1, TP2, TP3), each offset from entry by ATR multiples set in the Trade Tools group. A shaded risk zone connects Entry to Stop Loss, and a shaded reward zone connects Entry to the furthest take-profit line. Each line carries a right-aligned label showing its exact price.
Live Dashboard (optional, position configurable via Dash X / Dash Y) — a compact table summarizing current symbol/timeframe, signal lock state, active direction, current signal status, regime classification (Flat/Trending), breakout override status, active adaptive filter type, current trend-line and ATR values, a visual progress bar for trend strength, and individual on/off/flat status readouts for each of the six regime filters.
Non-Standard Chart Warning — a red-bordered table automatically appears in the top-left corner if the script detects it is being run on a Heikin Ashi, Renko, Line Break, Kagi, or Point & Figure chart, warning that signal reliability is compromised on synthetic chart types.
📖 How to Use
A "Bull" label with the trend line switching to the Bull color signals a confirmed transition to an up-regime that has passed all active consensus filters (or was pushed through by the breakout override).
A "Bear" label with the trend line switching to the Bear color signals the equivalent confirmed down-regime transition.
Because flips are gated by the consensus filter, the absence of a new signal during a period of price consolidation is intentional — the script is treating the move as noise rather than a lack of function. Check the dashboard's individual filter rows to see exactly which condition(s) are currently classifying the market as flat.
The dashboard's "Override" row shows "Engaged" when the Breakout Override has just bypassed the filters — useful for distinguishing a filter-confirmed signal from a volatility-forced one.
When Show Trade Levels is active, treat the Entry/SL/TP lines as a reference risk framework tied to current ATR, not a guaranteed execution plan; always verify levels make sense for the instrument and timeframe before acting on them.
Enable Lock Signal to freeze the current signal state on the most recent bar, useful when reviewing historical signal behavior without new signals interrupting the current view.
If the Non-Standard Chart warning appears, switch to a standard candlestick chart type before relying on any signal from this script.
⚙️ Inputs and Settings
ATR Len — lookback period for the underlying ATR calculation that drives band width and multiple filter thresholds. Shorter values make the band more reactive to recent volatility; longer values smooth it out.
Band Mult, ATR Weight, Move Weight — the three components that combine into the dynamic band multiplier. Band Mult sets a base width, ATR Weight scales the contribution of current ATR relative to price, and Move Weight scales the contribution of recent capped price movement.
Smooth Len — the EMA length applied to the calculated band half-width, controlling how quickly the band itself can widen or narrow.
Adaptive Filter / Filter Type — toggles and selects between Kalman and LLAMA smoothing of the source price feeding the trend line.
Kalman Q / Kalman R — process noise and measurement noise inputs for the Kalman filter; higher Q increases responsiveness, higher R increases smoothing.
LLAMA Len — lookback window for the efficiency-ratio calculation driving the LLAMA adaptive average.
Stall Filter / Flatness — enables the stall check and sets the ATR-relative threshold below which trend-line movement is considered stalled.
Slope Filter / Reg Len / Slope Thr — enables the regression-slope check, sets its lookback window, and sets the normalized slope threshold below which the market is considered flat.
Volume Filter / Vol MA Len — enables the volume check and sets the moving-average length volume is compared against.
Range Filter / Pctile Len / Range Pct — enables the range-compression check and sets the historical lookback and percentile threshold used to classify current range as compressed.
BPS Filter / Min BPS — enables the basis-point movement check and sets the minimum basis-point threshold for a trend-line move to be considered meaningful.
ADX Filter / ADX Len / ADX Thr — enables the ADX-based trend-strength check and sets its calculation length and minimum threshold.
Breakout Ovr / Ovr ATR Mult — enables the override and sets the ATR multiple of single-bar price change required to force a flip through the filters.
Show Trade Levels / SL, TP1, TP2, TP3 ATR Mult — enables the trade-level drawing tool and sets each level's distance from entry as a multiple of ATR.
Bar Coloring, Bull/Bear Marks, Cloud Fill, Cloud MA Len, Cloud Transp — visual toggles and parameters controlling gradient candles, signal labels, and the cloud fill between trend line and reference average.
Show Dash, Dash X, Dash Y — toggles the dashboard and sets its screen position.
Long/Short/Close Action inputs — customizable text strings inserted into the "action" field of each alert's JSON payload, for direct use with automated webhook execution systems.
Colors group — full color customization for bull/bear/neutral states, label text, warning banner, dashboard theme, gradient candle tiers, and trade-level line colors.
🔍 Deconstruction of the Underlying Scientific and Academic Framework
The trailing-band mechanism draws on the same volatility-normalized stop methodology popularized by Chandelier Exit-style systems, which themselves extend J. Welles Wilder's Average True Range concept into an adaptive trailing stop: rather than a fixed price distance, the stop distance breathes with recently realized volatility, tightening in calm markets and widening in turbulent ones.
The Kalman filter option applies a classical state-space estimation technique originally developed for aerospace tracking problems (Rudolf Kálmán, 1960). It treats the "true" price trend as an unobserved state to be estimated from noisy observations, recursively updating a prediction and its uncertainty at each time step and weighting new information by a gain term derived from the relative magnitude of prediction versus measurement uncertainty. Applied to price series, it produces a smoothed estimate that adapts its own responsiveness based on the ongoing balance of signal versus noise.
The LLAMA adaptive average is built on an efficiency-ratio concept in the lineage of Perry Kaufman's Adaptive Moving Average research: the ratio of net directional displacement to total path length over a window quantifies how "efficiently" price has trended, and this ratio is used to interpolate the smoothing constant between fast and slow exponential-average bounds. Markets that trend efficiently receive a fast, responsive average; markets that chop inefficiently receive a slow, heavily smoothed one.
The Slope Filter applies ordinary least squares (OLS) linear regression across a short trend-line window to extract a first-derivative estimate (slope) of the trend line's trajectory, normalizing it by ATR so the threshold behaves consistently across instruments and volatility regimes of different scale.
The ADX Filter is grounded in Wilder's Directional Movement System, which decomposes price movement into positive and negative directional components and derives a smoothed trend-strength oscillator independent of direction — a standard framework for distinguishing trending from ranging conditions.
The Range Filter's use of percentile-rank classification reflects a basic non-parametric statistical approach: rather than assuming a normal distribution of high-low ranges, it empirically ranks the current range against its own recent historical distribution, which is more robust to the fat-tailed, non-normal behavior typically observed in financial return and range series.
Collectively, the six-factor consensus mechanism reflects a general principle from ensemble/multi-condition filtering: requiring independent, structurally uncorrelated confirmations to agree (or, here, requiring none to actively veto) before acting on a signal tends to reduce the false-positive rate relative to any single condition acting alone, at the cost of some responsiveness — a classic precision/recall tradeoff which the Breakout Override is specifically designed to mitigate during high-volatility regimes.
⚠️ 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. Indicator

Reversal Trap Probability Bands Pro [JPT]🔷 OVERVIEW
Reversal Trap Probability Bands Pro is an original Pine Script® indicator that combines volatility bands, ATR, RSI, and volume analysis to estimate the probability of bullish and bearish reversal traps. Instead of relying on a single signal, the indicator calculates a probability score based on multiple technical factors and highlights areas where price may be exhausted and preparing for a reversal.
Designed for traders who monitor trend exhaustion and potential turning points, the indicator provides dynamic probability bands, reversal signals, market bias, and a real-time probability dashboard.
🔷 HOW IT WORKS
The indicator evaluates several market conditions simultaneously to estimate the likelihood of a bullish or bearish reversal.
Bullish Reversal Probability
The bullish probability increases when:
• RSI enters the oversold region
• Price closes below the lower ATR probability band
• Trading volume is above its average
• The candle closes bullish
When the combined probability reaches the defined threshold, a Bullish Reversal signal is generated.
Bearish Reversal Probability
The bearish probability increases when:
• RSI enters the overbought region
• Price closes above the upper ATR probability band
• Trading volume is above its average
• The candle closes bearish
When the combined probability reaches the defined threshold, a Bearish Reversal signal is generated.
🔷 PROBABILITY ENGINE
The indicator combines multiple technical factors into a probability score instead of using a single condition.
The probability model evaluates:
• RSI Momentum
• ATR Volatility
• Price Position Relative to Dynamic Bands
• Volume Confirmation
• Candle Direction
The resulting Bullish and Bearish probabilities are displayed in real time to help traders assess potential reversal conditions.
🔷 VISUAL FEATURES
• Dynamic EMA Basis Line
• ATR-Based Probability Bands
• Extreme Upper Probability Band
• Extreme Lower Probability Band
• Bullish Reversal Signals
• Bearish Reversal Signals
• Probability Zone Background Highlighting
• Real-Time Probability Dashboard
• Market Bias Display
• Customizable Inputs
🔷 PROBABILITY BANDS
The indicator automatically plots:
• EMA Basis
• Upper Probability Band
• Lower Probability Band
• Extreme Upper Band
• Extreme Lower Band
These adaptive bands expand and contract with market volatility, helping identify potential overextended price conditions.
🔷 DASHBOARD
The built-in dashboard displays:
• Bullish Probability (%)
• Bearish Probability (%)
• Current Market Bias
This provides a quick overview of market conditions without requiring manual calculations.
🔷 INPUTS
Available settings include:
• Band Length
• ATR Length
• ATR Multiplier
• RSI Length
• Overbought Level
• Oversold Level
• Volume SMA Length
• Show Reversal Signals
• Show Probability Bands
🔷 ALERTS
Built-in alerts are available for:
• Bullish Reversal Signal
• Bearish Reversal Signal
Alerts can be connected directly to PulseWire's notification system for real-time monitoring.
🔷 COMMON WORKFLOW
A typical workflow is:
Monitor price as it approaches the upper or lower probability bands.
Observe the Bullish and Bearish Probability values in the dashboard.
Wait for a confirmed BUY or SELL reversal signal.
Use additional confirmation such as price action, support and resistance, or market structure before entering a trade.
Apply sound risk management for every position.
🔷 MARKETS
Reversal Trap Probability Bands Pro can be used on:
• Forex
• Gold (XAUUSD)
• Silver (XAGUSD)
• Cryptocurrency
• Stocks
• Indices
• Futures
• Commodities
Compatible with all PulseWire-supported timeframes.
🔷 BEST PRACTICES
Many traders combine this indicator with:
• Market Structure (HH, HL, LH, LL)
• Break of Structure (BOS)
• Change of Character (CHoCH)
• Support & Resistance
• Fibonacci Retracement
• Order Blocks
• Fair Value Gaps (FVG)
• EMA Trend Filters
• Higher Timeframe Analysis
Using multiple forms of confirmation can help improve decision-making around potential reversal zones.
🔷 UPCOMING FEATURES
Future updates may include:
• Multi-Timeframe Probability Analysis
• Trend Strength Filter
• Smart Money Confirmation
• Liquidity Sweep Detection
• ATR-Based Stop Loss Suggestions
• TP1, TP2, TP3 Auto Targets
• Risk/Reward Visualization
• Advanced Dashboard
• Custom Probability Weighting
• Session-Based Probability Filters
🔷 DISCLAIMER
This indicator is provided for educational and informational purposes only. It estimates reversal probability using technical indicators and historical price action. It does not predict future market movements or guarantee trading results. Always perform your own analysis, use appropriate risk management, and consider additional market factors before making trading decisions. Indicator

McGinley Dynamic Fusion [MarkitTick]💡 The McGinley Dynamic is a lesser-known adaptive moving average developed in the 1990s by market technician John R. McGinley, specifically engineered to solve a problem that plagues conventional moving averages: their tendency to lag badly during fast market moves while whipsawing excessively during slow, choppy conditions. Unlike a standard EMA or SMA, the McGinley Dynamic adjusts its own speed automatically based on the relationship between price and its prior value, effectively "hugging" price more tightly when the market accelerates and smoothing out more when it decelerates. This script builds a complete trading framework around a Fast/Slow McGinley Dynamic crossover, layering in higher-timeframe confirmation, signal cooldown filtering, ATR-adaptive trade levels, a live dashboard, and a manual signal-lock mechanism.
✨ Originality and Utility
While McGinley Dynamic implementations exist on PulseWire, this script does not simply plot the raw indicator. It combines four distinct engineering layers into a single decision framework:
A recursively self-adjusting dual McGinley Dynamic engine (Fast and Slow) used as a crossover trigger rather than a static trend line.
An optional higher-timeframe directional filter that requires the HTF trend to agree with the signal direction before a crossover is allowed to fire.
A cooldown/gap filter measured in bars, which suppresses new signals for a configurable number of bars after the last one, reducing signal clustering during choppy crossover conditions.
An ATR-based trade management layer that auto-plots Entry, Stop Loss, and three Take Profit levels the moment a signal fires, extended live on the chart with a color-coded risk/reward fill.
The value to traders lies in how these layers interact: the McGinley crossover alone would generate frequent false signals in ranging markets, but the HTF filter and cooldown mechanism specifically target the crossover's greatest weakness (over-triggering during consolidation), while the ATR trade-level engine converts a raw directional signal into a fully defined, risk-quantified trade plan without any additional charting work from the user.
🔬 Methodology and Concepts
• The McGinley Dynamic Engine
The core building block is a recursive moving average that adjusts its step size relative to how far price has moved away from its previous value. Rather than applying a fixed weighting like an EMA, the McGinley Dynamic divides the price-to-prior-value distance by a dynamic denominator that grows sharply when price moves far from the average and shrinks when price sits close to it. This produces a curve that speeds up during trending, high-momentum moves and slows down during sideways congestion, giving it a self-correcting quality that fixed-period moving averages lack. The script instantiates two independent copies of this engine: a Fast McGinley Dynamic (default length 14) and a Slow McGinley Dynamic (default length 50), each with its own configurable "K Constant" that governs how aggressively the adaptive denominator reacts to price displacement.
• Crossover Signal Logic
A long signal is generated when the Fast McGinley Dynamic closes above the Slow McGinley Dynamic after having been at or below it on the prior two bars — a confirmed upward crossover, not an intrabar or provisional one. A short signal mirrors this logic on the downside. This two-bar confirmation approach (checking both the and offsets) ensures the crossover has actually completed on a closed bar before a signal is registered, rather than reacting to a crossover that could still repaint on the current forming bar.
• Higher-Timeframe Directional Filter
When enabled, the script pulls the source price and Fast McGinley Dynamic value from a user-selected higher timeframe (default 4-hour) and requires that the HTF price sit on the correct side of the HTF Fast McGinley Dynamic before allowing a same-direction signal on the working timeframe. This acts as a macro-trend veto: a bullish crossover on the chart timeframe will be ignored if the higher-timeframe trend context is bearish, and vice versa. The higher-timeframe request is built using a confirmed, prior-bar value combined with PulseWire's lookahead-on merge policy — the standard non-repainting pattern for pulling higher-timeframe data — so the filter reacts only to fully closed higher-timeframe bars.
• Cooldown / Signal Spacing Filter
To prevent rapid-fire signals during periods where the Fast and Slow McGinley Dynamic lines oscillate around each other, the script tracks the bar index of the last long and last short signal separately. A new signal in the same direction is only permitted once a user-defined minimum number of bars ("Cooldown Bars") has elapsed since the prior one, reducing signal noise without altering the underlying crossover logic itself.
• ATR-Based Trade Level Construction
The moment a qualifying signal fires, the script calculates an Average True Range value over a configurable lookback and uses it to derive five reference prices: an entry (the prior bar's close), a stop loss, and three take-profit targets. Each level is expressed as an ATR multiple away from entry, with independently configurable multipliers for the stop and each take-profit tier. This means the distance between entry and each level automatically expands or contracts with recent volatility rather than using a fixed point or percentage distance, keeping the risk/reward structure proportionate to current market conditions.
• Signal Lock
The optional Lock Signal feature freezes the currently displayed trade levels once toggled on, preventing them from being overwritten by a subsequent crossover. This is useful for traders who want to manually track a single active setup on the chart without the lines and labels shifting each time a new signal condition is technically met.
🎨 Visual Guide
Fast MD line (default blue) — the fast-length McGinley Dynamic.
Slow MD line (default orange) — the slow-length McGinley Dynamic.
Heatmap Candles — when enabled, candle bodies and wicks are recolored based on trend bias: teal/green when the Fast MD sits above the Slow MD (bullish bias), red when below (bearish bias), independent of the raw candle color.
Entry line (dashed, blue by default) — plotted at the close of the bar prior to signal confirmation, marking the reference entry price.
Stop Loss line (solid, red by default) — the ATR-derived stop level, labeled with an "✕ SL" tag showing the exact price.
Take Profit lines (dashed, teal by default, three tiers with increasing opacity) — TP1, TP2, and TP3, each labeled with its price.
Risk fill — a shaded region between the entry line and stop-loss line, tinted in the stop-loss color, visually representing the risk portion of the trade.
Reward fill — a shaded region between the entry line and the TP3 line, tinted in the take-profit color, visually representing the potential reward span.
All trade-level lines and labels extend live to the right edge of the chart until superseded by a new signal or, if Signal Lock is active, held in place.
📌 Note : the best way to resolve visual overlap is to navigate to the Object Tree and drag the indicator above the main chart layer, or simply hide the native candles in your chart settings.
📖 How to Use
A bullish signal occurs when the Fast MD confirms a crossover above the Slow MD, subject to the HTF filter and cooldown filter both being satisfied. The dashboard's Bias row will read "▲ Bull".
A bearish signal occurs on the mirrored downward crossover, with the Bias row reading "▼ Bear".
When a signal fires, use the auto-plotted Entry, SL, and TP1/TP2/TP3 lines as a starting framework for trade structure — the R:R progress bar on the dashboard shows the reward-to-risk ratio for TP1 relative to the stop distance.
The MD Gap row on the dashboard visualizes, as a percentage bar, how far apart the Fast and Slow MD lines currently are, which can help gauge trend strength or an approaching crossover.
Enabling the HTF Filter is recommended for traders who want signals to align with a broader trend context rather than trading every local crossover.
Enabling Signal Lock freezes the current trade plan on screen, useful when manually managing an active position and wanting to prevent the levels from updating on the next crossover.
⚙️ Inputs and Settings
Src / Fast N / Slow N — source price and the lookback lengths for the Fast and Slow McGinley Dynamic calculations. Shorter lengths react faster but generate more signals; longer lengths are smoother but slower to confirm.
K Const — governs how aggressively the McGinley Dynamic's adaptive denominator responds to price displacement from the prior value. Higher values slow the line's responsiveness.
HTF Filter / HTF TF — enables the higher-timeframe directional veto and sets which higher timeframe is used for that check.
Cooldown Bars — minimum number of bars required between two signals of the same direction.
Lock Signal — freezes the current trade levels in place, blocking updates from subsequent signals.
ATR Len — lookback length for the Average True Range used to size the SL and TP levels.
SL Mult / TP1 Mult / TP2 Mult / TP3 Mult — ATR multipliers that set the distance of the stop loss and each take-profit tier from the entry price.
Heatmap Candles / Trade Levels — visual toggles for the bias-colored candles and the auto-plotted trade-level lines/labels/fills.
Show Dash / Dash Pos — toggles the on-chart dashboard and sets its screen position.
Alert action fields (Long/Short/Close Long/Close Short) — customizable string values embedded into the script's JSON alert payloads, allowing the fired alerts to be mapped to specific automation or webhook actions.
🔍 Deconstruction of the Underlying Scientific and Academic Framework
The McGinley Dynamic belongs to a broader family of adaptive-smoothing techniques in technical analysis that attempt to address a structural weakness of fixed-weight moving averages: a constant smoothing factor cannot simultaneously be fast enough to track trending markets and slow enough to filter noise in ranging markets. McGinley's original design achieves adaptivity by making the effective smoothing constant a function of the ratio between current price and the prior average value raised to the fourth power — a formulation that causes the adjustment factor to grow disproportionately large when price diverges sharply from the average, automatically accelerating the line's response, and to shrink toward a baseline when price and average are close, automatically slowing the response. This self-referential feedback mechanism places the McGinley Dynamic conceptually closer to adaptive filters used in signal processing (where a filter's gain is modulated by the magnitude of recent error) than to the fixed-coefficient exponential smoothing used in a standard EMA.
The dual-length crossover structure applied here draws on the well-established moving-average-crossover framework from technical trend-following literature, where the relationship between a fast and slow-adaptive series is used as a proxy for shifting momentum regimes, conceptually related to dual-moving-average systems and change-point detection approaches that flag a regime shift once a fast-reacting series diverges from a slow-reacting baseline. The higher-timeframe confirmation layer reflects the top-down, multi-timeframe analysis principle common in technical trading methodology, where signals on a lower timeframe are treated as more reliable when they align with the prevailing direction on a higher timeframe, reducing the frequency of signals that run counter to the dominant trend. Finally, the ATR-scaled trade-level construction is grounded in volatility-normalized position and risk sizing, a standard practice in quantitative trade management where stop and target distances are expressed as a multiple of recent realized volatility (via Average True Range) rather than fixed price or percentage distances, ensuring risk parameters adapt to the current volatility regime rather than remaining static across changing market conditions.
⚠️ 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. Indicator

Fan Principle Signals [MarkitTick]💡 Maps out market structure using a sequence of ascending swing lows (or descending swing highs) to construct a three-legged trendline fan, then triggers actionable trade signals the moment price breaks through the steepest line in that fan. Rather than relying on a single moving average or oscillator crossover, this script builds its bias from the actual geometry of recent price swings, giving traders a structural, visually intuitive way to time entries around the exhaustion of a trend.
✨ Originality and Utility
Most breakout tools react to a single reference line, such as a moving average, a fixed channel, or a static trendline drawn from only two points. This script instead applies the fan principle, a technique that connects a common origin point to three successive pivots in the same trend, producing three lines of increasing steepness. The logic behind this approach is that the third and steepest line in the fan typically represents the most aggressive rate of trend continuation, and a decisive close beyond it has historically signaled that the prevailing trend has lost its structural support.
What makes this implementation useful in practice is that it does not stop at drawing the fan. It automatically identifies valid pivot sequences from raw price action, filters out insignificant micro-swings using a minimum leg percentage threshold, validates the freshness of the structure with a lookback cap, and then converts the break event into a complete trade plan, including entry, stop-loss, and three take-profit levels, all derived mathematically from the fan's own geometry and the market's current volatility. The optional volume and higher-timeframe filters allow traders to demand additional confirmation before a signal is accepted, and the built-in dashboard keeps the entire state of the system visible at a glance. The combination of automated structural fan detection, ATR-adaptive risk placement, and live trade monitoring is what distinguishes this from a simple trendline break script.
🔬 Methodology and Concepts
• Pivot Detection
The script continuously scans for swing highs and swing lows using a symmetrical lookback and lookforward window defined by the Pivot Len input. A bar qualifies as a swing high only if it is strictly greater than every other bar within that window on both sides, and a swing low only if it is strictly lower than every bar in that window. Each time a new pivot is confirmed, its bar index and price are stored in a rolling array, keeping the most recent twenty pivots in memory for both highs and lows.
• Fan Construction
Once at least four pivot lows (for an uptrend fan) or four pivot highs (for a downtrend fan) are available, the script selects the four most recent ones. The oldest of the four becomes the fan's origin point. The remaining three form Leg 1, Leg 2, and Leg 3 respectively, each connected back to that same origin. A slope is then calculated for each leg using simple rise-over-run between the origin and that leg's pivot. For the fan to be accepted, the price move between the origin and the first leg must exceed the Min Leg % threshold, which filters out fans built from statistically insignificant noise, and the origin must fall within the Max Fan Lookback window, which prevents the script from anchoring to structure that is too old to remain relevant.
• The Break Condition
Leg 3, the line connecting the origin to the most recent and steepest pivot, is treated as the trigger line. Its price value is projected forward on every bar using the slope calculated at formation. A bullish break requires the fan to currently be in an uptrend orientation, the previous confirmed bar's close to be above the projected Leg 3 value, and the bar before that to have closed at or below it, meaning the break itself happens on a confirmed, completed bar rather than an in-progress one. The bearish break condition mirrors this logic in the opposite direction for downtrend fans. This confirmed-close approach means the script never fires or removes a signal based on an incomplete, still-forming bar, so historical signals will not disappear or move once printed.
• Optional Confirmation Filters
Two independent filters can be layered on top of the raw break condition. The volume filter requires the breaking bar's volume to exceed a multiple of its recent moving average, screening out breaks that occur on unusually thin participation. The higher-timeframe filter compares the breakout bar's close against the prior, fully closed bar on a higher timeframe of your choosing, requiring the breakout direction to align with that broader trend context before a signal is allowed to fire.
• Trade Level Calculation
When a break is confirmed, the script builds an entry, stop, and three take-profit levels automatically. Entry is anchored to the close of the breakout bar. The stop-loss is placed beyond the nearest of the two most recent fan legs, offset further by a small ATR buffer to avoid being clipped by minor wicks, but it is also capped by a maximum ATR distance so a single outlier swing cannot produce an oversized stop. The distance between entry and stop becomes the base risk unit, and the three take-profit levels are placed at user-defined multiples of that risk unit, giving a consistent, R-multiple-based framework for managing the position rather than arbitrary fixed-price targets.
🎨 Visual Guide
Dotted lines connecting the origin point to Leg 1 and Leg 2 show the earlier, less steep sections of the fan structure and provide visual context for how the trend developed.
The solid, extended line represents Leg 3, the active trigger line. It is colored using the Bull Fan color when the fan is in an uptrend orientation and the Bear Fan color when it is in a downtrend orientation, and it projects forward in real time as new bars form.
A blue dashed line marks the Entry level once a signal fires, extending to the right for as many bars as the trade remains active or until a new signal replaces it.
A red solid line marks the Stop-Loss level, with a light red shaded zone (the Risk Fill) drawn between the entry and stop lines to make the risk portion of the trade immediately visible.
Three dashed lines in progressively deeper shades of teal mark Take-Profit 1, 2, and 3, moving from lightest (TP1, closest to entry) to fully opaque (TP3, furthest away). A light teal shaded zone (the Reward Fill) spans from the entry line to the TP3 line, visually contrasting the reward portion of the trade against the risk portion.
Small labels are anchored to each of these lines on the left, displaying the exact price of the Stop, Entry, and each Take-Profit level, and updating their horizontal position as the trade progresses.
An upward-pointing "▲ BUY" label appears below the breakout bar on a bullish break, and a downward-pointing "▼ SELL" label appears above the breakout bar on a bearish break.
An optional on-chart dashboard table displays the ticker and timeframe, whether the Lock Signal feature is active, the current fan orientation, the origin price, the live value of the Leg 3 trigger line, the current entry, stop, a live risk-to-reward progress bar showing how far price has travelled toward TP3 relative to the initial risk, the volume filter status, and the number of bars elapsed since the last signal.
📖 How to Use
A signal is generated only when price decisively closes beyond the Leg 3 trigger line of an established fan, so treat the fan's orientation, shown both by the line color and by the Fan State readout on the dashboard, as the prevailing structural bias before a break occurs. When a bullish break prints, the suggested plan is to consider a long entry near the displayed Entry line, with the Stop-Loss line defining the invalidation point below and the three Take-Profit lines offering staged exit levels as the move develops. A bearish break mirrors this in the opposite direction for short setups.
The R:R Progress bar on the dashboard is useful for monitoring an active trade at a glance: it fills from 0% toward 100% as price advances from entry toward the TP3 target, and its color shifts from red through amber to teal as the trade's risk-to-reward ratio improves. If the Lock Signal option is enabled, the script freezes the most recently confirmed signal and its levels in place rather than allowing a new one to overwrite them, which can help when you want to manage an open position without the on-chart levels shifting. Because signals are confirmed only on closed bars, always wait for bar close before acting on a fresh line break rather than reacting to an in-progress wick.
Enabling the optional Volume and HTF filters will typically reduce signal frequency while raising the bar for confirmation, so consider testing both configurations to see which better matches the behavior of the instrument and timeframe you trade.
⚙️ Inputs and Settings
Pivot Len — Controls how many bars on each side must confirm a swing high or low. Smaller values detect pivots faster but produce noisier, more frequent fan structures; larger values produce fewer but more structurally significant pivots.
Max Fan Lookback — The maximum age, in bars, that a fan's origin point can have and still be considered valid. Lowering this keeps the script focused on recent structure only.
Min Leg % — The minimum percentage price move required between the origin and the first leg for a fan to be accepted, filtering out fans built on insignificant price movement.
Use Vol Filt / Vol Avg Len / Vol Mult — Enables a volume confirmation requirement, comparing current volume against its moving average over the specified length, multiplied by the chosen factor.
Use HTF Filt / HTF — Enables a higher-timeframe trend alignment requirement, comparing the breakout close against the prior confirmed close on the chosen higher timeframe.
SL ATR Buf — The ATR-based buffer added beyond the nearest fan leg when placing the stop-loss, giving the stop room to avoid minor wick noise.
SL Max ATR — A ceiling, expressed in ATR multiples, on how far the stop-loss can be placed from entry, preventing outsized stops on unusually wide fans.
ATR Len — The lookback length used for the ATR calculation that feeds both the stop buffer and the stop cap.
TP1 R / TP2 R / TP3 R — The risk-multiple distances used to place the three take-profit levels relative to the initial risk unit between entry and stop.
Lock Signal — Freezes the current signal and its associated levels in place, preventing a new signal from overwriting them until manually disabled.
Show Fan Lines / Show Trade Levels / Show Labels — Independently toggle the visibility of the fan structure lines, the entry/stop/TP levels, and their accompanying price labels.
Show Dash / Dash Pos — Toggle the on-chart dashboard and choose which corner of the chart it is anchored to.
A full set of color inputs is available to customize the fan lines, trade level lines, fill zones, signal labels, and dashboard appearance to match your own chart theme.
🔍 Deconstruction of the Underlying Scientific and Academic Framework
The fan principle applied here descends from classical technical analysis literature on trendline construction, most notably the Gann fan and Andrews' Pitchfork family of tools, which share the premise that connecting a structural origin point to successive swing extremes produces a family of trendlines whose slopes carry predictive meaning about the trend's rate of change. Where this script departs from those older, largely manual techniques is in how the origin and legs are selected: rather than relying on the analyst's subjective choice of anchor points, pivot selection here is fully algorithmic, using a symmetric local-extremum test to ensure each point used is objectively the highest or lowest price within its surrounding window.
The core statistical assumption underlying any trendline-break system is that price trends exhibit a degree of serial correlation, meaning that the rate of ascent or descent between swing points tends to persist for some period before mean-reverting or reversing, and that a violation of the most recent, steepest rate of change is informative about a shift in that underlying process. This is conceptually related to the broader family of change-point detection methods used in time-series analysis, where a structural break in a fitted trend line is used as a signal that the data-generating process has shifted regime. The ATR-based position sizing layered on top draws from the well-established use of Average True Range as a volatility-normalized unit of risk, a concept popularized in behavioral and quantitative trading literature as a way of scaling stop and target distances to the instrument's own recent volatility rather than using arbitrary fixed-point distances, which do not generalize across different assets or market conditions.
⚠️ 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. Indicator

Indicator

Indicator

Market Weariness Spectrum Indicator [MarkitTick]💡 This advanced technical tool is engineered to evaluate the exhaustion of price trends by synthesizing volume, volatility, and price action into a single, comprehensive oscillator. By tracking how much effort the market is expending relative to the actual ground gained by price, this framework helps analysts identify periods of trend fatigue and potential reversals. Rather than relying solely on traditional price-based overbought or oversold levels, it looks deeper into market friction, signaling when a trend is mathematically likely to run out of steam and when a structural recovery is probable.
✨ Originality and Utility
Traditional momentum oscillators and standard volume metrics often operate in isolated silos, which can lead to false signals during strong, prolonged trends. This script bridges that gap by creating a multi-dimensional composite weariness score.
It detects structural exhaustion where high trading volume results in minimal price movement, indicating heavy absorption.
It measures the frequency of directional hesitation within recent price action.
It tracks effort density to provide a dynamic view of trend fatigue that single-metric indicators cannot achieve.
This multifaceted approach reduces false positives and provides a highly nuanced understanding of market mechanics during extreme conditions.
🔬 Methodology and Concepts
The core logic relies on the continuous calculation of three distinct dimensions, which are dynamically weighted and smoothed into the final composite oscillator.
● Dimension 1: Phantom Volume
This component measures the volume expended per unit of price movement.
It calculates the average volume divided by the average absolute price move over a specified lookback window.
Elevated values indicate that massive trading volume is generating very little forward progress, a classic sign of market friction.
The result is strictly normalized on a scale from 0 to 100 based on historical highest and lowest bounds over a derived lookback.
● Dimension 2: Directional Hesitation
This metric tracks the frequency of indecision in the market structure.
It evaluates the size of each candle's real body relative to the underlying Average True Range (ATR).
If a candle's body is less than a specific threshold of the ATR, it is flagged mathematically as a hesitation period.
The algorithm scores the percentage of these hesitation candles over the lookback window, normalizing the output from 0 to 100.
● Dimension 3: Effort Density
Effort Density compares the raw trading volume directly against the prevailing volatility range.
It identifies periods where the market is churning heavily without expanding its dynamic range.
Like the other dimensions, this value is smoothed, tracked against its historical extremes, and normalized to a 100-point scale for seamless integration.
● Composite Calculation and Signal Logic
The three dimensions are blended using precise, user-defined weights to form the raw weariness score.
A Simple Moving Average is applied to smooth the raw data, creating the primary indicator trajectory.
The script continuously evaluates the mathematical velocity and acceleration of this smoothed line to detect structural deceleration in weariness.
This logic triggers specific reversal signals only when extreme exhaustion mathematically begins to wane, rather than at the absolute peak.
🎨 Visual Guide
The system provides a rich, multi-layered visual experience to ensure all data is instantly readable directly on the chart.
● Chart Elements and Overlays
Candle Coloring: The main chart candles are dynamically colored based on the current weariness level, transitioning through a gradient of green, yellow, orange, and red.
Reversal Labels: Explicit downward-pointing labels appear on the chart when the weariness metric peaks above the critical threshold and structural deceleration is confirmed.
Recovery Labels: Upward-pointing labels signify that the market has recovered from a state of severe exhaustion, crossing back into baseline operational zones.
● Oscillator Panel
Oscillator Line: The thick main oscillator line representing the composite weariness score, dynamically colored.
Dimension Lines: Three distinct lines representing the individual calculations for Phantom Volume, Directional Hesitation, and Effort Density.
Threshold Fills: A semi-transparent visual fill highlights the specific zone between the critical alert level and the recovery baseline.
Critical Backgrounds: The oscillator panel background shifts color dynamically when weariness exceeds absolute critical limits.
● On-Chart Dashboard
Data Table: An intuitive, heavily formatted table tracks the exact percentage and text status of the current calculation.
Progress Bars: Text-based visual progress bars represent the isolated weight of each dimension in real-time.
Acceleration Trackers: Directional arrows track the direct acceleration vector of the current trend state.
📖 How to Use
The primary application of this system is identifying when a market move has exhausted its underlying momentum, regardless of the immediate price action.
● Identifying Exhaustion
Monitor the primary oscillator as it climbs toward the upper boundary.
When the line enters this critical zone, the current trend is expending maximum effort for minimal reward. Caution is advised for trend-continuation setups.
● Evaluating Reversals
Wait for the structural acceleration to turn negative.
When a reversal label manifests, it suggests that the exhaustion has structurally peaked and the market may be susceptible to a shift in directional momentum.
● Confirming Recoveries
After a period of extreme weariness, wait for the oscillator to fall back below the defined recovery threshold.
The appearance of a recovery label indicates the market has absorbed the previous friction, signaling a return to baseline conditions.
⚙️ Inputs and Settings
The script provides granular control over all internal weighting and lookback mechanisms.
● Core Parameters
Lookback: Defines the primary window for all moving averages and historical normalization extremes.
Smooth: Adjusts the sensitivity of the final composite score to reduce standard market noise.
ATR Len: The specific period used for calculating the volatility benchmarks essential to the Hesitation and Density formulas.
● Dimension Weights
W1 Phantom Vol: The proportional weight assigned to the volume-per-move calculation.
W2 Dir Hesit: The proportional weight assigned to the structural hesitation calculation.
W3 Effort Den: The proportional weight assigned to the volume-to-volatility calculation.
● Signal and Visual Thresholds
Crit Exh %: The strict upper boundary that defines extreme structural weariness.
Recovery %: The lower boundary that defines a complete return to standard market flow.
Confirm Bars: The sustained duration required for the indicator to remain in exhaustion before any subsequent reversal signals can be mathematically validated.
🔍 Deconstruction of the Underlying Scientific and Academic Framework
The theoretical foundation of this logic rests heavily on established volume spread principles and statistical volatility analysis.
● Effort vs. Result Mechanics
In objective terms, when a system applies maximum input volume but achieves minimal price displacement, the energy is being absorbed by opposing liquidity.
The script quantifies this exact friction mathematically through specialized density formulas, filtering out traditional momentum illusions.
● Volatility Clustering
The hesitation frameworks rely on the statistical observation of volatility clustering.
By measuring continuous body size constraints relative to an evolving volatility band, the formulas isolate periods where directional conviction fundamentally collapses.
● Derivative Logic
The internal signal engine evaluates the specific velocity and acceleration vectors of the underlying weariness curve.
By requiring structural acceleration to turn decisively negative after a local maximum, the mathematical algorithm ensures the statistical apex of the exhaustion phase has cleanly passed before printing confirmation markers.
⚠️ 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. Indicator

Smart Trend Flow Pro [MarkitTick]💡 Navigating modern market structures requires a robust mechanism capable of filtering out transient noise while capturing the dominant directional vectors. The Smart Trend Flow pro is an advanced analytical framework designed to dynamically track market momentum and volatility, transforming complex price action into a highly readable, visual heatmap. By synthesizing trend identification with continuous volatility scaling, this tool aims to provide clarity in both ranging environments and high-expansion phases, allowing for more structured and disciplined market analysis.
✨ Originality and Utility
● A Paradigm Shift in Trend Visualization
Traditional channel-based indicators often suffer from severe lag or become entirely unreadable during periods of intense market contraction. The utility of this script lies in its adaptive ability to map structural boundaries and instantly correlate them with localized market energy. By discarding static thresholds in favor of a dynamic, self-adjusting baseline, the tool presents a unified view of both direction and conviction.
● Beyond Binary Signals
Standard indicators frequently rely on binary conditions—such as a simple moving average crossover—which ignore the underlying volatility context. This script pioneers a synthesized approach where the strength of a trend is continuously evaluated against its own historical variance. This allows users to visually differentiate between a low-conviction drift and a highly energized breakout, providing a much richer context for potential trade management and risk assessment.
🔬 Methodology and Concepts
● Dynamic Boundary Engine
At the core of the script is a reactive boundary detection mechanism. Rather than projecting fixed bands, the engine establishes fluid upper and lower parameters based on recent localized extremes. These boundaries can be structurally smoothed using various adaptive algorithms, effectively tuning the sensitivity of the channel to match the specific rhythm of the asset being analyzed.
● Volatility Normalization Process
To accurately gauge market energy, the framework continuously measures the distance between the established boundaries. This raw measurement is then subjected to a rigorous statistical normalization process. By evaluating current fluctuations against a rolling historical baseline, the engine maps the resulting variance onto a bounded curvilinear scale. This abstract transformation isolates the pure kinetic energy of the market, stripping away absolute price dependencies to provide a standardized metric of volatility expansion and contraction.
● Integrated State Tracking
The logical engine monitors the interaction between the closing prices and the smoothed boundary parameters. A structural shift is recognized only when price definitively breaches and sustains its position relative to these dynamic thresholds. This state-tracking ensures that the primary directional bias is maintained until a statistically significant reversal occurs, minimizing false positives during minor retracements.
🎨 Visual Guide
● Color-Coded Heatmap Candles
The primary visual feature is the complete transformation of the standard candlestick chart into a continuous heatmap. The colors directly correspond to the synchronized output of the trend direction and the normalized volatility metric.
Bullish Gradients: When the market establishes an upward bias, the candles transition through a cool-to-hot spectrum. Deep, cold colors represent low-volatility accumulation phases, while bright, hot neon colors signify intense, high-volatility bullish expansion.
Bearish Gradients: Conversely, downward structural shifts are mapped using a separate color spectrum. Dark, muted tones indicate slow, grinding bearish action, whereas vivid, hot colors highlight rapid, high-volatility sell-offs.
Neutral States: When the price resides within the core boundary parameters, demonstrating no clear directional dominance, the candles default to a flat, neutral gray to reduce visual noise.
● Signal Markers
Buy Labels: Distinct markers appear precisely below the price action when the engine confirms a definitive upward structural breach.
Sell Labels: Clear markers are printed above the price action upon the confirmation of a downward structural breach.
📖 How to Use
● Interpreting the Heatmap
The most effective way to utilize this tool is to read the candle colors as a topographical map of market energy. A transition from a neutral state into a cold bullish or bearish color suggests the early formation of a trend. As the colors heat up and transition toward their neon extremes, it confirms that the directional move is being supported by expanding volatility, which often characterizes the most robust phase of a trend.
● Managing Trend Exhaustion
Traders can monitor the intensity of the heatmap to gauge potential momentum decay. If a strong trend has been characterized by hot, neon colors, a gradual cooling off—where the colors revert to darker, colder shades—may indicate that the localized volatility is subsiding, suggesting potential consolidation or a pending structural shift.
● Confirming Breakouts
The printed Buy and Sell labels serve as structural confirmation points. These markers are best utilized not in isolation, but in confluence with the heatmap. A signal label accompanied by an immediate transition into a high-volatility color spectrum carries significantly more analytical weight than a signal that remains mired in a cold or neutral visual state.
⚙️ Inputs and Settings
● Channel Settings
Channel Length: Determines the primary lookback window for establishing the core upper and lower boundaries. Increasing this value creates a wider, slower-moving channel, while decreasing it makes the system highly sensitive to recent price action.
Channel MA Type: Allows the user to apply different smoothing algorithms to the boundaries. Options range from the standard baseline to advanced weighting methods, providing precise control over signal reactivity.
● Analytics Settings
Squeeze/Z-Score Length: Defines the historical window used to evaluate the relative volatility. A longer length provides a smoother, more macro-level volatility assessment, while a shorter length makes the heatmap highly reactive to sudden micro-expansions.
● Candle Heatmap Settings
Bullish/Bearish Color Controls: Fully customizable inputs allowing the user to define the exact hex values for the cold and hot extremes of both the bullish and bearish spectrums.
Neutral Market Base: The default color applied when the market is bound within the channel without a confirmed directional state.
● Signal Settings
Label Colors: Configurable color selections for the printed Buy and Sell confirmation markers.
🔍 Deconstruction of the Underlying Scientific and Academic Framework
● Topological Price Mapping
At a fundamental level, the script treats financial time-series data not as discrete data points, but as a continuous topological surface. By evaluating the highest and lowest ranges over a specified temporal window, it effectively creates a rolling bounding box that encapsulates the probable distribution of future price vectors. The application of sophisticated moving average algorithms to these boundaries acts as a low-pass filter, mathematically attenuating high-frequency noise and exposing the true underlying macroeconomic drift.
● Non-Linear Variance Scaling
The most complex aspect of the engine is its approach to variance. Standard deviation on its own is an unbounded metric, making it difficult to utilize in a standardized visual format. The script solves this by isolating the width of the bounding box and comparing it against its own moving average and standard deviation. This transforms the raw width into a standardized probabilistic metric.
● The Sigmoidal Activation Function
To achieve the seamless visual gradient, this standardized variance must be mapped onto a finite plane. The engine employs a logistic function—specifically, a sigmoidal activation curve—to compress the unbounded variance data strictly between a 0 and 100 scale. This non-linear mapping ensures that the visual heatmap remains highly sensitive to subtle shifts around the mean, while gracefully asymptotically compressing extreme, outlier volatility spikes, thereby maintaining absolute visual coherence regardless of the asset's inherent behavior.
⚠️ 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. I 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. Indicator

Indicator

Squeeze Bollinger Bands Tracker [MarkitTick]💡 This institutional-grade analysis suite provides a sophisticated volatility-tracking environment designed to identify market compression phases and high-conviction breakouts. By integrating Bollinger Band standard deviation logic with Z-Score normalization and a non-linear sigmoid volatility engine, the script transforms raw price action into a multi-dimensional heatmap. This approach allows traders to distinguish between low-volatility "coiling" phases and institutional-driven momentum expansions, providing a clear visual representation of market energy.
● ✨ Originality and Utility
The Squeeze Bollinger Bands Tracker distinguishes itself through the implementation of a proprietary "Signal Engine" and a non-linear volatility grading system. Unlike standard Bollinger Band indicators that merely plot static lines, this tool actively monitors the rate of change in channel width relative to its own historical standard deviation.
• Dynamic Volatility Normalization
Most indicators rely on linear calculations that fail to account for the exponential nature of market expansion. This script utilizes a Z-Score calculation to determine how extreme a volatility move is compared to its history, then maps that value through a sigmoid function. This creates a "Heatmap" effect on the candles that reflects institutional participation levels rather than simple price movement.
• Institutional Breakout Grading
The utility is further enhanced by an automated grading system (Grades A, B, and C). By cross-referencing price spread (the distance between open and close) with actual volume metrics during a breakout, the script provides an objective measure of signal quality, helping traders filter out "fakeouts" that lack volume support.
● 🔬 Methodology and Concepts
The logic flow is divided into three core analytical pillars: Compression Detection, Momentum Normalization, and Signal Verification.
• Compression Detection (The Squeeze)
The script calculates the percentage-based width of the Bollinger Bands. When the current width falls below its SMA-based average, the market is classified as being in a "Squeeze" state. This signifies a period where market energy is being stored, often preceding a significant directional expansion.
• Sigmoid-Mapped Z-Score Volatility
To provide the neon heatmap coloring, the script calculates the Z-Score of the channel width. This tells us how many standard deviations the current volatility is from the mean. This Z-Score is then processed through a Sigmoid Function: 100 / (1 + exp(-Z-Score)). This mathematical transformation squashes the infinite Z-Score range into a 0–100 scale, creating a smooth gradient for the "True Institutional Heatmap."
• Breakout Validation Engine
Signals are not generated simply on a price cross. The Signal Engine (a custom User-Defined Type) calculates real-time Entry, Stop Loss (based on the previous basis line), and Take Profit levels. During the moment of crossover, the "calcGrade" method evaluates if the current bar's spread and volume are at least 150% of their historical averages to assign a Grade A "Institutional" breakout.
● 🎨 Visual Guide
The visual interface is designed with a high-contrast "3D Neon" aesthetic to ensure critical data points are immediately recognizable during fast-moving market conditions.
• The 3D Neon Channels
Upper Core & Glow: The upper Bollinger Band is rendered in Cyan (#00FFFF). It features three layers: a 2-pixel core for precision and two wider "Glow" layers with varying transparency (60% and 85%) to create a neon effect.
Lower Core & Glow: The lower band is rendered in Magenta (#FF00FF), following the same three-layer glow architecture to signify the support boundary.
Basis Core: The central moving average is rendered in Yellow (#FFFF00), acting as the dynamic mean and the primary stop-loss anchor.
• True Institutional Heatmap Candles
The candle colors are not fixed; they represent a gradient based on the Sigmoid Volatility score.
Bullish State: Transitions from a deep "Cold" Forest Green (#004D40) during low-volatility rises to a "Hot" Neon Green (#00FF00) during high-momentum surges.
Bearish State: Transitions from a deep "Cold" Purple (#4A148C) during low-volatility drops to a "Hot" Neon Red (#FF0000) during aggressive sell-offs.
Neutral State: Gray (#808080) candles appear when no definitive trend state is identified by the Signal Engine.
• Analytical Dashboard and Labels
Buy/Sell Labels: When a breakout occurs, a Cyan or Magenta label appears. It displays the signal Grade (A, B, or C) and the calculated E (Entry), TP (Take Profit), and SL (Stop Loss) values.
Institutional Analytics Dashboard: Located in the top-right, this table provides real-time data on Trend Maturity (in bars), Volatility State (Squeeze vs. Expanding), and the percentage proximity to the upper and lower breakout levels.
● 🔍 Deconstruction of the Underlying Scientific and Academic Framework
The indicator is built upon the foundation of Statistical Process Control and Information Theory. By treating price movement as a signal-to-noise problem, the script uses the following frameworks:
• Standard Deviation and Gaussian Distribution
The core of the Bollinger Band calculation relies on the assumption that price spends approximately 95% of its time within two standard deviations of the mean. The "Squeeze" logic identifies periods where the distribution is abnormally tight, suggesting an imminent return to the mean or a "Fat Tail" event (a breakout).
• Z-Score Normalization
In statistics, the Z-Score is used to compare observations from different data sets or time periods. By applying Z-Score logic to the width of the bands, the indicator removes the "unit" of price and focuses purely on the intensity of the volatility, allowing for a standardized comparison across different assets (e.g., Bitcoin vs. Apple).
• Non-Linear Sigmoid Mapping
The use of the Sigmoid function (common in Neural Network activation) serves to eliminate outliers in volatility data. This ensures that the candle heatmap provides meaningful color variations even during extreme "Black Swan" events, preventing the visual output from becoming saturated or unreadable.
● 📖 How to Use
Traders should focus on the transition between market states as displayed by the Analytics Dashboard and the Heatmap.
• Step 1: Identify the Squeeze
Monitor the "Volatility State" in the dashboard. When it displays "⚠️ SQUEEZE" in Neon Orange, the market is coiling. This is the preparation phase where no trades should be taken.
• Step 2: Evaluate the Breakout Grade
Wait for a "BUY" or "SELL" label to appear. Priority should be given to "Grade A" signals, as these indicate that both price spread and volume have significantly exceeded their 20-period averages, confirming institutional intent.
• Step 3: Execution and Risk Management
Upon a valid signal, the script provides an automated trade plan. The Stop Loss is set at the Basis (Yellow) line from the previous bar to allow for minor breathing room, while the Take Profit is projected at a 1:1 ratio relative to the width of the band at the time of entry.
● ⚙️ Inputs and Settings
The script provides granular control over the analytical engine and the visual experience.
• Channel Settings
Channel Length: Controls the SMA window for the Bollinger Bands (Default: 20).
Standard Deviation Multiplier: Adjusts the width of the neon boundaries (Default: 2.0).
• Analytics Settings
Squeeze/Z-Score Length: Determines the lookback period used to define what constitutes "average" volatility (Default: 50).
Quality SMA Length: Defines the window for the Grade A/B/C volume and spread verification (Default: 20).
• Color and Heatmap Settings
Users can fully customize the Neon Upper/Lower colors, the Dashboard background transparency, and the specific "Cold" and "Hot" thresholds for the candle gradient engine to match their preferred dark or light chart theme.
⚠️ 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. I 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. Indicator

Concordance Regime Synthesis [JOAT]Concordance Regime Synthesis
Introduction
Concordance Regime Synthesis is an open-source strategy framework that combines regime state, pressure, participation, structure, and higher-timeframe bias into one non-repainting confluence model. The strategy is designed to avoid single-factor entries by requiring multiple independent conditions to align before risk is deployed.
Core Concepts
1. Multi-factor confluence scoring
Long and short setups are scored independently using regime direction, normalized price pressure, participation-axis deviation, delta behavior, recent structure, and optional higher-timeframe bias.
2. Regime-aware execution
Entries only occur when directional confluence exceeds a threshold and the score spread clearly favors one side.
3. ATR-based risk handling
Stops, targets, and optional trailing logic are all derived from ATR so the strategy adapts to volatility instead of using fixed-tick assumptions.
Strategy Properties
Initial capital: 10,000
Order size: 10% of equity per trade
Commission: 0.06%
Slippage: 1 tick
Pyramiding: 0
Orders processed on close
Originality Statement
This strategy is original in its use of a confluence gate that requires independent agreement from regime, pressure, delta, participation, structure, and optional HTF alignment before entries are allowed. It is published as an educational framework for multi-factor strategy construction rather than as a promise of future performance.
Disclaimer
This strategy is for educational and informational purposes only. Backtest results depend on symbol, timeframe, market regime, and execution assumptions. Historical results do not guarantee future returns. Always validate assumptions and use realistic risk controls.
Strategy

Smart Trader, Episode 06, Isotropic Trend Lines🔷 WHAT IS ST-EP06 — ISOTROPIC TREND LINES?
ST-EP06 is a multi-scale structural trend channel indicator built on a σ-normalized coordinate system. It is designed to solve one of the oldest unaddressed problems in technical analysis:
trend angles that cannot be compared across instruments, timeframes, or volatility regimes.
A trend line drawn on a chart appears to carry a measurable angle — yet that angle is an artifact of the display window, not a property of the market. Resize the chart horizontally and the slope flattens; compress it and the slope steepens. A given price movement on Gold daily and Bitcoin 1-hour may produce visually identical slopes on screen while reflecting entirely different structural conditions. This happens because traditional charts use a coordinate space where the vertical axis (price) and the horizontal axis (time) share no fixed dimensional relationship.
The consequence is not merely cosmetic. A trader cannot meaningfully compare the steepness of a trend on one instrument with another — or even across timeframes on the same instrument — because the weight of "one unit of price per bar" varies with the instrument's current volatility.
As the author of this indicator, I sought a coordinate system where trend angles would be an intrinsic structural property of the market, independent of charting software or display settings. The goal: a space where a 30° uptrend on EUR/USD weekly carries the same structural meaning as a 30° uptrend on NASDAQ 5-minute — indicating that each market is moving at the same rate relative to its own realized volatility.
The solution draws on the principle of dimensional analysis, well established in physics and engineering. Just as the Reynolds number normalizes fluid flow to make behavior comparable across different pipe sizes and fluid viscosities, this indicator normalizes price movement by realized volatility, producing a dimensionless space we call the Isotropic Coordinate System (ICS).
In ICS, price is expressed in natural logarithmic form and scaled by a volatility estimate (σ) derived from the Yang-Zhang (2000) method — a drift-invariant estimator that incorporates Open, High, Low, and Close data. The resulting vertical axis is dimensionless: one unit equals one standard deviation of recent realized price behavior. When trend angles are measured in this space, 45° indicates approximately one σ of movement per bar — whether the chart shows a penny stock, a major currency pair, or a commodity index.
Traditional chart coordinates assign no fixed relationship between the price axis and the time axis. Resizing the chart window changes the visual slope of the same price movement — a compressed view may show 52° while a stretched view of the same data shows 25°. The angle is a display artifact, not a market property. The Isotropic Coordinate System (ICS) addresses this by normalizing log-price by realized volatility (σ). In this space, the trend angle is designed to remain constant regardless of how the chart is displayed — because it measures price displacement in units of σ per bar, not in pixels per pixel.
🔷 HOW THE MODULES WORK TOGETHER
ST-EP06 operates as a deterministic pipeline where each stage consumes the output of the one before it:
Realized volatility estimation (σ) → Structural block construction → Monotonic direction detection → ICS angle measurement → Channel boundary fitting → Six-scale parallel analysis → Consensus aggregation → Breakout and retest state tracking → Dashboard narrative generation
The Yang-Zhang σ provides the normalization constant for every downstream computation. Price history is then partitioned into structural blocks, each distilled to a single central tendency that resists close-price bias. Consecutive block centers are compared to identify the longest uninterrupted directional segment. The slope of that segment, measured in σ-normalized space, yields the ICS angle. Four price extremes located within the segment define two log-linear channel boundaries. This complete pipeline runs independently at six temporal scales, and their independent outputs are aggregated into a structural consensus. A finite-state machine then tracks the evolving relationship between price and the primary channel — breakout, retest, confirmation, or failure — and translates it into a single-line human-readable narrative.
ST-EP06 operates as a deterministic sequential pipeline. Yang-Zhang volatility (σ) provides the normalization constant that flows into every downstream stage. Price history is partitioned into structural blocks, each reduced to a geometric mean. The longest monotonic segment determines direction, and its slope in σ-normalized space yields the ICS angle. Four price extremes define the channel boundaries. This complete pipeline runs independently at six scales — 3, 7, 13, 19, 29, and 47 bars per block — all prime numbers, chosen to minimize harmonic overlap so that multiple scales are unlikely to lock onto the same cyclical artifact. Scale 19 (highlighted) serves as the primary engine: it is the only scale that maps to the user's Trend Block Period input, and the only scale whose output drives the chart-overlay channel lines, the projection, the diamond markers, and the breakout/retest state machine. The other five scales operate at fixed periods and contribute exclusively to the cross-scale consensus count — providing structural context that a single scale cannot offer alone. When 5 or 6 of the 6 scales agree on direction, it suggests a structural trend visible across a broad range of temporal resolutions.
🔷 DATA ANCHORING
Every structural computation in ST-EP06 — volatility, block means, direction, channel coordinates, state machine transitions, and dashboard narrative — is governed by a single anchoring reference, selected through the Calculation Bar input.
Live Bar mode (default): the anchor is the current forming bar. Values update with each incoming tick. This is standard PulseWire behavior and means the indicator may exhibit intra-bar repaint — the live bar's data enters all computations as it evolves.
Close Bar mode: the anchor shifts to the last fully confirmed (closed) bar. The forming bar is excluded from every computation. Values lock once a bar closes and do not change retroactively. This mode is intended for structural analysis, back-testing, and any workflow where historical consistency is a priority.
One deliberate exception is maintained in both modes: the dashboard header always displays the current live closing price (Live Exception protocol), preserving real-time price awareness regardless of how the indicator's structural engine is anchored.
Two modes, same chart moment. In Live Bar the anchor sits on the forming bar, so every value updates tick-by-tick and may repaint within the bar. In Close Bar the anchor shifts to the last closed bar, locking all structural values once the bar closes. The only exception is the dashboard header row, which always displays the live closing price in both modes, so real-time price awareness is never lost.
🔷 YANG-ZHANG VOLATILITY (σ)
The foundation of the ICS is a robust volatility estimate. ST-EP06 uses the Yang-Zhang (2000) realized volatility estimator, an academically established method that combines three variance components:
Overnight variance — capturing the gap between consecutive sessions, measured from the prior close to the current open.
Intraday variance — capturing the movement from open to close within each session.
Range-based variance — using the Rogers-Satchell (1991) estimator, which extracts additional information from the high and low prices without assuming zero drift.
These three components are blended using an optimal weight that is designed to minimize estimation error. The resulting σ updates every bar, adapts to changing market conditions, and — crucially — is drift-invariant: it is intended to remain unbiased whether the market is trending strongly or mean-reverting.
🔷 BLOCK CONSTRUCTION
Rather than analyzing individual bars, ST-EP06 partitions recent price history into consecutive non-overlapping blocks. Each block spans a user-defined number of bars (the Trend Block Period input) and is reduced to a single representative value: the geometric mean of the block's highest high and lowest low, computed in logarithmic space.
This log-midpoint serves as the block's central tendency. Unlike a simple average of closing prices, it captures the structural center of the entire price range within the block, avoiding bias toward any single price point. The number of consecutive blocks compared is controlled by the Trend Block Groups input — more groups means deeper lookback and the ability to detect longer structural trends.
Price history is partitioned into consecutive non-overlapping blocks. Each block reduces to a single log-midpoint — the geometric mean of its highest high and lowest low. Connecting the midpoints forms the representative chain used for trend detection.
🔷 DIRECTION DETECTION + ICS ANGLE
Once blocks are constructed, the engine compares their geometric means in sequence, starting from the most recent. It identifies the longest consecutive segment where each block's central tendency moves in the same direction — either consistently rising or consistently falling. A single reversal terminates the segment.
The slope of this segment is then measured in ICS space: the logarithmic price difference between the oldest and newest blocks in the segment, divided by σ, divided by the number of bars between them. The arctangent of this normalized slope produces the ICS angle in degrees.
If the absolute angle falls within the Range Threshold (a user-configurable dead zone in degrees), the direction is classified as ranging rather than trending. This threshold acts as a sensitivity filter — wider values require steeper moves before declaring a trend, narrower values respond to subtler directional shifts.
An ICS angle of 45° indicates approximately one σ of price movement per bar. An angle near 0° suggests the market may be structurally flat. Because σ adjusts for volatility and the logarithm adjusts for price level, these angles are intended to be directly comparable across any instrument and any timeframe.
🔷 CHANNEL FITTING
Within the identified trending segment, the engine locates four price extremes: the highest high, the lowest high, the highest low, and the lowest low — each paired with its bar position. These four points define two linear boundaries in ICS space.
During an uptrend, the upper boundary is fitted through the lowest high and highest high (capturing the rising ceiling), while the lower boundary is fitted through the lowest low and highest low (capturing the rising floor). During a downtrend, the fitting order reverses to capture descending structure. During a ranging market, the channel uses horizontal boundaries at the segment's absolute high and low.
All boundary computations occur in the σ-normalized logarithmic coordinate system, meaning the channel lines represent geometric (log-linear) paths in price space — curves that naturally follow multiplicative price behavior rather than additive assumptions.
Within the trending segment, four extremes — HH, LH, HL, LL — define two log-linear boundaries. In an uptrend, the upper line fits through LH and HH, the lower through LL and HL. The direction reverses the fitting order for downtrends, and a ranging market uses horizontal boundaries.
🔷 6-SCALE PARALLEL ANALYSIS
A single temporal scale may capture the trend at one resolution but miss structure at others. ST-EP06 runs the complete pipeline — volatility normalization, block construction, direction detection, ICS angle, and channel fitting — independently at six different scales: 3, 7, 13, 19, 29, and 47 bars per block. These values were chosen as prime numbers to minimize harmonic overlap between scales.
Scale 19 serves as the primary engine and maps to the user's Trend Block Period input. The other five scales use fixed periods, providing a structural context that the primary engine alone cannot offer.
The dashboard displays each scale's independent trend direction. A consensus count shows how many of the six scales agree: 5/6 or 6/6 agreement suggests a structural trend that is visible across multiple temporal resolutions, while low agreement may indicate transitional or conflicting structure.
🔷 BREAKOUT / RETEST STATE MACHINE
ST-EP06 includes a 5-state finite automaton that tracks price's structural relationship to the primary channel boundaries:
Inside — price is observed between the channel floor and ceiling. The dashboard shows the position as a percentage: distance from floor and distance to ceiling (summing to 100%).
Breakout Up / Breakout Down — price has exited above the ceiling or below the floor. The dashboard shows the breakout price and the percentage of channel width that price has moved beyond the boundary.
Retest Up / Retest Down — after a breakout, price has moved at least one σ away from the boundary (establishing distance), then returned to test it. The dashboard shows both the original breakout price and the current retest level.
Transitions between states use dynamic σ-based thresholds rather than fixed percentages, meaning the sensitivity automatically adjusts with market volatility. Additional flags track:
✓ Confirmed — a breakout that has been retested and bounced at least one σ away from the boundary.
(gap) — price crossed the entire channel width in a single transition.
Failed breakout — price re-entered the channel after initially breaking out.
Direction reset — the primary trend direction changed, wiping all breakout state.
🔷 VISUAL TOOLS
All chart-overlay elements are drawn from the primary engine (scale 19):
Channel lines — solid upper and lower boundaries from the segment start to the anchor bar, colored by trend direction (configurable up/down/range colors, width, and line style).
Projection lines — dotted forward extension of the channel slopes beyond the anchor bar, providing a visual reference for potential future support and resistance. The projection offset, width, and style are independently configurable.
Channel fill — semi-transparent shading between channel boundaries, with independent color selection and adjustable transparency. Applies to both the solid channel and projection segments.
Diamond markers (◆) — placed at the channel endpoints on the anchor bar. Hovering reveals a tooltip with the anchored close price, ceiling level, floor level, and the price's position as a percentage of channel width.
Direction label — positioned at the midpoint between segment start and projection end. Displays the trend arrow, direction text, and ICS angle (e.g., "▲ UP +7.3°"). Tooltip includes block count.
🔷 DASHBOARD
A compact information table appears at the top-right corner of the chart, organized in 5 rows:
Header — indicator name, ticker symbol, timeframe, and live price (always live under the Live Exception protocol, even in Close Bar mode).
Period — the six scale values (3, 7, 13, user's period, 29, 47) displayed across columns. The primary engine column is highlighted.
Trend — per-scale trend direction with directional arrows (▲ UP, ▼ DN, ◈ RNG) and color coding.
Agreement — consensus count (e.g., "5/6 UP") with the primary channel ceiling (▲) and floor (▼) price levels.
Narrative — a single merged row presenting the breakout/retest state machine output as a human-readable sentence with distance measurements. This row updates dynamically as price interacts with the channel.
All dashboard text, tooltips, and narrative phrases are fully localized.
🔷 ALERT CONDITIONS
ST-EP06 provides 19 alert conditions organized in 5 categories, all gated by a master Enable Alerts toggle:
D · Direction (3 alerts) — fires when the primary engine trend changes to uptrend, downtrend, or range.
B · Breakout (4 alerts) — fires on initial breakout above ceiling or below floor, and separately on confirmed breakout (retested and bounced).
R · Retest (2 alerts) — fires when price returns to test the boundary after establishing distance.
S · Structural (5 alerts) — fires on gap-through events (price crosses entire channel), failed breakouts (price re-enters channel), and direction resets (trend change wipes state).
A · Agreement (5 alerts) — fires when cross-scale consensus reaches significant thresholds: full bullish (6/6), strong bullish (5/6), full bearish (6/6), strong bearish (5/6), or range consensus (≥4/6).
Important: alerts require Calculation Bar = Live Bar. In Close Bar mode, all alert conditions are automatically suppressed and a visual warning is displayed on the chart — because Close Bar mode intentionally lags by one bar, which is semantically incompatible with live alert delivery.
🔷 LANGUAGE SUPPORT
The dashboard, all tooltips, the breakout/retest narrative, and the alert warning label are available in 7 languages:
English · Türkçe · العربية · Русский · Italiano · Português (BR) · 中文
Select the preferred language from the Language dropdown in the Display settings group. All structural and numerical outputs remain unchanged — only the display language of text elements is affected.
🔷 HOW TO USE
Apply ST-EP06 to any chart — the indicator is designed to work across instruments (equities, forex, crypto, commodities, indices) and timeframes without parameter re-optimization, because the ICS framework normalizes for volatility and price level automatically.
Start with the default settings (Period 26, Groups 5, Sigma Length 20) and observe how the channel captures the dominant structural trend. The 6-scale consensus in the dashboard may help assess whether the observed trend is isolated to one temporal resolution or confirmed across multiple scales.
The Calculation Bar setting is a structural decision: use Live Bar for real-time monitoring and alert-driven workflows; use Close Bar for analysis and back-testing where historical stability is prioritized.
The ICS angle on the direction label provides a quantitative measure of trend intensity. Comparing angles across different instruments or timeframes is one of the intended use cases of the ICS framework — a 15° angle on one chart and a 15° angle on another may suggest similar structural momentum relative to each market's own volatility.
The breakout/retest narrative in the dashboard bottom row is designed to provide context-rich status updates without requiring manual chart reading. The σ-based thresholds ensure that breakout sensitivity adapts to current market conditions rather than relying on fixed values.
🔷 SETTINGS
Calculation — Calculation Bar (Live/Close Bar anchoring), Trend Block Period (bars per block), Trend Block Groups (consecutive blocks compared), Range Threshold (ICS dead zone in degrees), Yang-Zhang Sigma Length (volatility lookback).
Channel Lines — Up Color, Down Color, Range Color, Line Width, Line Style.
Projection Lines — Projection Offset (forward bars), Projection Width, Projection Style.
Display — Language (7 options), Show Channel (toggle overlay), Show Fill (toggle shading), Show Dashboard (toggle table), Dashboard Font Size.
Channel Fill — Fill Up Color, Fill Down Color, Fill Range Color, Fill Transparency.
Alerts — Enable Alerts (master toggle, requires Live Bar mode).
🔷 DISCLAIMER
ST-EP06 is an educational and analytical tool. It is designed to provide structural context through σ-normalized trend channels and multi-scale analysis. It does not generate buy or sell signals, does not predict future price movement, and is not intended as financial advice. Historical patterns observed through this indicator do not guarantee future outcomes. All trading decisions remain the sole responsibility of the trader.
Indicator

Dynamic FibTrend Signals [MarkitTick]💡 This indicator represents an advanced multi-layered analytical framework designed to synchronize trend identification with structural market geometry. By integrating adaptive trend-following logic with automated price action mapping, the tool serves as a comprehensive dashboard for traders seeking to identify high-probability entry zones. It solves the common problem of "indicator clutter" by condensing volatility-adjusted trend direction, swing structure recognition, and Fibonacci retracement depth into a single, cohesive visual interface that provides real-time trade execution levels based on current market volatility.
● ✨ Originality and Utility
The primary utility of this script lies in its ability to bridge the gap between momentum-based trend following and static price levels. While many scripts focus on a single aspect of technical analysis, this indicator utilizes a synergistic approach:
It combines the volatility-sensitive nature of SuperTrend with the objective structural points of Pivot Highs and Lows.
It automates the projection of Fibonacci retracement levels based on a dynamic lookback period, ensuring that support and defense zones are always relevant to recent price action.
Unlike standard tools that leave the user to determine their own risk, this system automatically calculates a suggested entry, stop loss, and multiple target levels using Average True Range (ATR) to adjust for current market volatility.
● 🔬 Methodology and Concepts
The core engine operates on a tripartite logic system:
Trend Quantification: The system employs an Average True Range (ATR) calculation multiplied by a specific factor to create a dynamic band around the price. This determines the prevailing bias (Bullish or Bearish) and filters out market noise.
Structural Mapping: Through a pivot-point algorithm, the script identifies "Swing" levels. These are points where the market has shown significant rejection, helping to define the current trading range.
Risk Geometry: Upon a trend shift (signal), the script calculates trade levels. The Entry is based on the previous bar's close, while the Stop Loss and Profit Targets are mathematically derived from the ATR. This ensures that the risk-to-reward ratio remains consistent regardless of whether the market is in a high or low-volatility state.
● 🎨 Visual Guide
The chart interface is designed for high legibility, using distinct color coding and shapes to signify different market states:
SuperTrend Line: A continuous line that turns Green during bullish momentum and Red during bearish momentum. The area between this line and the price is filled with a subtle transparency to highlight the "trend cloud."
Signal Arrows: Bright green "BUY" arrows appear below the bars for bullish transitions, and red "SELL" arrows appear above the bars for bearish transitions.
Swing Markers: Small orange downward triangles mark Swing Highs, while blue upward triangles mark Swing Lows. These are accompanied by dashed horizontal lines projecting the price level forward.
Fibonacci Grid: A series of purple dotted horizontal lines representing key retracement levels (0%, 23.6%, 38.2%, 50%, 61.8%, 78.6%, 100%). These levels provide context for potential pullbacks within the main trend.
Trade Execution Box: When a signal is generated, a yellow entry box appears along with three distinct lines:
Yellow Line: The specific Entry price.
Green Dashed Line: The Target (Take Profit) level.
Red Dashed Line: The Stop Loss level.
Info Table: A professional-grade data table in the top-right corner summarizes the current trend status, the most recent swing levels, and the active trade coordinates for quick reference.
● 📖 How to Use
Trend Identification: Observe the color of the SuperTrend line. If the line is green and the price is above it, focus on long opportunities. If red, focus on shorts.
Confirmation: Look for signals where the SuperTrend flip aligns with a bounce off a Fibonacci level (specifically the 50% or 61.8% "Golden Pocket").
Execution: When a "BUY" or "SELL" arrow appears, refer to the yellow entry zone. The script projects these levels 40 bars into the future to allow for trade planning.
Exit Strategy: Use the target line for profit-taking and the red stop-loss line for capital protection. The 2:1 risk-to-reward ratio is the default, but this can be adjusted in the settings.
● ⚙️ Inputs and Settings
⚡ SuperTrend: Adjust the ATR Length and Factor. A higher factor makes the trend slower and more resilient to whipsaws, while a lower factor makes it more sensitive.
🔄 Swing High / Low: Define the lookback period for pivot detection. Increasing this value will only identify major market turns.
📐 Fibonacci Retracement: Change the lookback bars for the Fibonacci grid. This determines the "height" of the range being measured.
🎯 Trade Levels: Set your desired Risk-to-Reward ratio (default is 2.0). You can also toggle the visibility of the entry, target, and stop lines.
● 🔍 Deconstruction of the Underlying Scientific and Academic Framework
The indicator is built upon the "Volatility Clustering" theory, which suggests that market volatility is not constant but occurs in bursts. By using ATR-based thresholds, the indicator applies a statistical filter that expands and contracts based on realized variance. The swing detection logic utilizes a "Windowed Extrema" approach, which is a fundamental concept in time-series analysis for identifying local maxima and minima within a defined temporal window. Furthermore, the integration of Fibonacci ratios (specifically the 0.618 Golden Mean) incorporates elements of fractal geometry and Elliott Wave theory, positing that market corrections often move in proportions derived from the Fibonacci sequence. The final trade execution component utilizes a fixed-fractional risk management model, ensuring that trade parameters are mathematically optimized for the current market environment rather than being based on arbitrary price distances.
⚠️ 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. I 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. Indicator

Bernoulli Process: Trend Probability & Entropy [MarkitTick]💡 This technical indicator introduces a rigorous probabilistic framework to the evaluation of market regimes by modeling price fluctuations as a Bernoulli Process. Unlike traditional oscillators that merely measure the magnitude of price movement, this script treats every bar as a discrete "trial" that either succeeds or fails based on specific conditions—such as directional price action, momentum thresholds, or trend alignment. By applying Information Theory and the principles of Maximum Likelihood Estimation (MLE), the script quantifies not just the direction of the market, but the statistical reliability and the "noise" content of the current sequence. This allows traders to distinguish between a structured trend and high-entropy market "chop," providing a level of objective clarity often missing in standard technical analysis.
● ✨ Originality and Utility
The primary innovation of this script lies in its transition from deterministic price tracking to stochastic regime modeling. Most indicators suffer from the "binary trap," where they simply tell a trader if price is above or below a level without assessing the statistical significance of that state.
• Quantifying Market Information
By integrating Shannon’s Binary Entropy, the script measures the uncertainty inherent in a price sequence. When entropy is near 1.0, the market is in a state of maximum uncertainty (effectively a fair coin toss), signaling that a trader should likely avoid the "noise." Conversely, low entropy values indicate a high-information state where one side of the Bernoulli trial is dominating, suggesting a persistent trend.
• Adaptive Definition of Success
The script is not limited to a single logic; it allows the user to define what constitutes a "Success" in the Bernoulli trial. Whether you prioritize raw price action (Close > Open), momentum (RSI > 50), or trend-following (Price > Moving Average), the underlying probabilistic engine remains consistent, making it a versatile tool for various trading styles.
• Z-Score Significance Testing
It applies a Central Limit Theorem (CLT) approximation to calculate a Z-Score. This tells the trader how many standard deviations the current trend is away from a random walk (p=0.5). This provides a mathematical filter to avoid entering "trends" that are actually within the bounds of statistical randomness.
● 🔬 Methodology and Concepts
The script operates through a four-stage mathematical pipeline that converts raw market data into probabilistic metrics.
• Stage 1: The Bernoulli Trial (I)
The foundation is the indicator variable (I). On every bar, the script evaluates a boolean condition. If the condition is met, the trial is a "Success" (1.0); otherwise, it is a "Failure" (0.0). This transforms complex candles into a simple binary sequence: {1, 0, 1, 1, 0...}.
• Stage 2: Probability Estimation (p-hat)
Using a rolling window of length N, the script calculates the Maximum Likelihood Estimate (MLE) of the probability parameter 'p'. This is essentially the sample mean of the successes within the window. A value of 0.7 suggests that in the last N trials, 70% were successful.
• Stage 3: Binary Entropy Calculation
The script calculates Entropy H(p) using the formula:
H(p) = -p * log2(p) - (1-p) * log2(1-p)
This provides a metric for "Trend Quality." If p is 0.5 (random), H(p) is 1.0 (maximum noise). If p is 1.0 or 0.0 (perfect trend), H(p) is 0.0 (maximum order).
• Stage 4: Volatility-Adjusted Z-Score
To determine if a sequence is truly anomalous, the script calculates the standard deviation of a fair process and compares the observed deviations to this baseline. This identifies "Significant Trends" that are mathematically distinct from a 50/50 random distribution.
● 🎨 Visual Guide
The visual interface is designed to communicate complex statistical data through intuitive color-coded cues.
• The Bernoulli Probability Line
The main plot is a continuous line representing the estimated probability (p).
A value above 0.5 indicates a bullish bias (p-hat > 0.5).
A value below 0.5 indicates a bearish bias (p-hat < 0.5).
• Dynamic Entropy Coloring
The line does not just change color based on direction; it changes based on certainty.
Vibrant Green: Strong bullish trend with low entropy (High Certainty).
Vibrant Red: Strong bearish trend with low entropy (High Certainty).
Gray/Faded Color: High entropy regime (Entropy > 0.9). This signals that the market is "choppy" and the probability of success is too close to random to be reliable.
• Background Entropy Zones
The chart background highlights areas of "Max Entropy" in a subtle gray color. When you see these zones, it suggests the current Bernoulli definition is failing to find a directional edge, signaling a period of market consolidation.
• Real-Time Metrics Dashboard
A table in the top-right corner displays:
Probability (p): The exact decimal value of the current trend probability.
Entropy (Bits): The current level of uncertainty in the sequence.
Regime: A text-based label identifying the market state (Bull Trend, Bear Trend, or Noise/Chop).
• Execution Signals
Small triangles appear on the chart to mark high-probability transition points. A Triangle Up (Green) marks a bullish breakout from a low-entropy state, while a Triangle Down (Red) marks a bearish breakdown.
● 📖 How to Use
• Identifying Low-Noise Entries
Traders should look for instances where the Probability Line crosses the 0.5 threshold while Entropy is low (vibrant colors). If the line is gray, the "trend" lacks statistical significance, and the risk of a whip-saw is high.
• Regime Filtering
Use the indicator as a "Mode Filter." If the Dashboard displays "NOISE / CHOP," it is a signal to stay flat or use mean-reversion strategies. If it displays a "TREND" regime, trend-following strategies can be deployed with higher confidence.
• Interpreting the Z-Score
While not directly plotted, the Z-Score logic powers the signal generation. A signal is only produced when the deviation from the "Fair Coin" (0.5) is substantial enough to suggest a non-random event.
● ⚙️ Inputs and Settings
• Bernoulli Trial Definition
Choose between three calculation modes:
Price Action: Uses the relationship between Close and Open (Directional bars).
Momentum: Uses RSI relative to the 50-level (Standard momentum).
Trend: Uses Price relative to a Simple Moving Average (Long-term regime).
• Sample Window (N)
Determines the "lookback" for the probability calculation. Smaller values (e.g., 10-15) are more responsive but noisier; larger values (e.g., 30-50) provide a smoother, more institutional view of the regime.
• Risk Management (Alerts)
Target R:R Ratio: Used to calculate the Take Profit level in the JSON alerts.
Stop ATR Multiplier: Uses Average True Range to calculate a volatility-adjusted stop loss for signals.
● 🔍 Deconstruction of the Underlying Scientific and Academic Framework
The "Bernoulli Process: Trend Probability & Entropy" script is built upon the pillars of Discrete Stochastic Processes and Information Theory.
• The Law of Large Numbers (LLN)
The script relies on the LLN, which states that as a sample size grows, its mean gets closer to the average of the whole population. By using a "Sample Window," we are performing a rolling MLE of the true underlying probability parameter of the market at that moment.
• Shannon Entropy and Information Theory
Claude Shannon’s 1948 work on information entropy is the bedrock of the "Noise" detection in this script. In the context of trading, entropy represents the "surprise" or "uncertainty" in the price sequence. A low-entropy market is one where the next bar's success/failure is highly predictable based on the recent past, which is the mathematical definition of a trend.
• Bernoulli vs. Gaussian Distributions
Most indicators assume a Normal (Gaussian) distribution of price returns. However, market states are often better modeled as discrete outcomes (Up/Down). By treating the market as a Bernoulli Process, we bypass the "fat-tail" problem of Gaussian distributions and focus purely on the frequency of successful outcomes, making the tool more robust against outliers.
• The Z-Test for Proportions
By applying a Z-score calculation to a Bernoulli distribution, the script treats the market like a "biased coin" experiment. It tests the Null Hypothesis ($H_0$): "The market is a fair coin (p=0.5)." When the Z-score is high, we reject $H_0$ in favor of the Alternative Hypothesis ($H_1$): "The market is trending (p != 0.5)."
⚠️ 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. I 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. Indicator

Range Indicator Golden Pocket, Liquidity, FairValueGapOverview
This indicator is a comprehensive institutional market structure toolkit. It is designed to identify high-probability reversal zones by merging three powerful technical analysis concepts: Fibonacci Golden Pockets (61.8% - 65%), Liquidity Pool Analysis (Swing Failure Patterns), and Fair Value Gaps (FVG). By automating the detection of price inefficiencies and "stop runs," it helps traders navigate complex price action with objective, rule-based confirmation.
What the Script Does
The script continuously monitors a user-defined lookback period to define a trading range. Within this range, it dynamically plots:
Golden Pockets: High-confluence retracement zones (calculated as 0.35 - 0.382 internal range levels).
Liquidity Zones: Highlighted regions at the absolute high and low (Top/Bottom 5%) where institutional orders and retail stops are typically concentrated.
Swing Failure Patterns (SFP): Real-time detection of liquidity grabs where price breaches a range extreme but fails to close outside, signaling a potential trap.
Fair Value Gaps (FVG): Visualizes 3-candle price imbalances, showing areas of aggressive buying or selling that often act as future magnets or support/resistance.
2-Candle Confirmation: A momentum-based filter requiring a candle-close confirmation before a reversal signal is generated.
For Whom is it?
Smart Money Concepts (SMC) & ICT Students: Traders looking for automated liquidity sweeps and market inefficiencies.
Fibonacci & Mean Reversion Traders: Those seeking a clean, professional visualization of the Golden Pocket across multiple timeframes.
Systematic Day Traders: Who require strict price-action confirmation (SFP and 2-candle rules) to remove emotional bias from their entries.
Functions and Input Options
1. Market Structure & Visuals
Lookback Period (Default: 100): Defines the window for calculating the range extremes.
Box Offset Right (Default: 50): Extends all zones into the future for better anticipatory trading.
Show Price Lines & Labels: Displays the exact price for every zone boundary on the right axis for precise execution.
2. Fair Value Gap (FVG) Settings
Show Fair Value Gaps: A toggle to enable/disable the plotting of price imbalances.
FVG Extension (Default: 10): Determines how many bars into the future the FVG box remains visible.
Custom Colors: Separate color inputs for Bullish (Gap Up) and Bearish (Gap Down) inefficiencies.
3. Professional Alert System
The script includes five specific alert conditions:
GP Touch: Early warning when price enters a Golden Pocket.
2-Candle Pattern: Confirmed momentum shift within a Golden Pocket.
SFP Long/Short: Alerts when a Liquidity Grab (Swing Failure) is confirmed at the range high or low.
Transparency and Compliance (Moderator Info)
Non-Repainting Logic: All signals (SFP, 2-Candle, and FVG) are calculated and triggered based on confirmed candle closes. Drawings use barstate.islast purely for visual efficiency without altering historical data integrity.
Educational Context: The script visualizes well-known market principles (Fibonacci, SFPs, and FVGs) to aid traders in their analysis; it does not provide automated financial advice or "black-box" buy/sell signals.
Resource Management: Optimized for Pine Script v5, using efficient array and box handling to ensure smooth performance even on lower timeframes. Indicator

Uptrick: Price Memory TrendIntroduction
Uptrick: Price Memory Trend is a custom indicator designed to detect directional shifts and volatility changes using a non-traditional price memory approach. Unlike moving average systems, it builds a dynamic memory of price that adapts gradually over time, allowing it to detect significant deviations and trend transitions with reduced noise.
Overview
This script identifies trend changes by comparing the current price to a memory-based baseline. When price deviates significantly from this memory base, it triggers a trend regime shift—either bullish or bearish. Adaptive deviation bands are calculated using absolute deviation from the memory base, not ATR or standard deviation, which allows the indicator to capture volatility uniquely. Visual components include color-coded candles, labeled signals, optional bands, and a live status table summarizing current trend metrics.
Originality
The indicator’s core innovation lies in its use of a decaying memory function to track trend direction, replacing moving averages with a price memory that responds only to significant deviations. This method avoids lag typically associated with smoothing techniques, enabling timely trend detection. Furthermore, deviation is measured directly in price terms, rather than through volatility surrogates like ATR or Bollinger Bands, resulting in a more raw and responsive depiction of price behavior.
Inputs
Core Engine
Memory Strength: Sets how strongly the memory responds to price changes. Higher values make the memory base more reactive.
Memory Decay: Controls how much past memory is retained. Lower values weight new prices more heavily.
Deviation Length: Length of the EMA used to smooth absolute price deviation. A longer setting results in smoother bands.
Band Multiplier: Expands or contracts the dynamic bands. Higher values widen the bands, reducing sensitivity.
Customization
Color Palette: Selects one of six predefined color schemes for bull and bear visuals.
Show Bands: Enables or disables the display of deviation bands.
Look: Chooses between 'Bands', 'Trail', or 'Intense' styles, affecting how bands and fills are drawn.
Bands
Trail
Intense
Show Info Table: Toggles display of the real-time trend and volatility status panel.
Table Position: Determines which corner of the chart the info panel appears in.
Text Size: Adjusts font size used within the info table.
Features
Trend Detection
Bullish Shift: Triggered when price crosses above the upper band, entering a new bullish regime.
Bearish Shift: Triggered when price crosses below the lower band, entering a new bearish regime.
Trend state is persistent and updated only on confirmed transitions, avoiding repeated entries in the same direction.
Candle Coloring
Candles are dynamically recolored based on current trend direction: bull, bear, or neutral.
Signal Labels
Visual labels marked "Up" or "Down" are placed on the chart when a regime shift occurs, helping to mark turning points.
Deviation Bands
Dynamic upper and lower bands are drawn based on smoothed absolute deviation from the memory base.
Additional outer bands based on ATR may be drawn to highlight zone intensity when the 'Intense' or 'Trail' styles are selected.
Bands visually indicate overextension and help frame price context relative to memory.
Alerts
Built-in alert conditions trigger on bullish or bearish trend shifts, useful for automation or notifications.
Info Table
The optional info table displays:
Current trend direction
Band state (calm, hot, or cool)
Price stretch from base
Trend age in bars
Confidence level based on deviation
Memory slope and acceleration
Band width and compression state
Reversion risk based on stretch level
Info Table:
Trade Example:
Logic
Price Memory
A recursive formula updates a memory variable based on the current price.
The memory adjusts only when the price deviates meaningfully from its previous value.
The formula uses a combination of delta-weighting and exponential decay:
> memory := previous_memory + delta × memory_strength
> memory := memory × memory_decay + price × (1 - memory_decay)
This produces a smooth, adaptive base that responds gradually to directional price moves.
Deviation and Bands
Absolute deviation between price and the memory base is calculated and smoothed using an EMA.
The upper and lower bands are then calculated as:
> Upper Band = memory base + (smoothed deviation × band multiplier)
> Lower Band = memory base - (smoothed deviation × band multiplier)
ATR-based extensions can optionally be drawn around these bands for added visual structure.
Trend Logic
Bullish and bearish states are tracked using crossovers and crossunders of price against the upper and lower bands.
The indicator maintains a persistent trend state variable that updates only when a confirmed regime change occurs.
This prevents multiple signals within the same trend direction (non-pyramiding behavior).
Stretch and Band Analysis
Stretch is measured as the deviation of price from memory, normalized by smoothed deviation.
Band width is tracked over time and used to detect compression or expansion.
Band position is calculated to identify where price sits between the upper and lower bands.
Info Table Metrics
Memory Slope and Acceleration: Show first and second derivative of the memory base to capture trend speed and change.
Confidence Level: Based on stretch intensity, indicating trend strength.
Reversion Risk: Inferred from how extended price is beyond the band.
Compression: Evaluated by comparing current band width to its recent average.
Summary
Uptrick: Price Memory Trend provides an alternative framework for trend identification by replacing traditional smoothing with adaptive memory logic. It measures price deviation without reliance on ATR or standard deviation, instead focusing on distance from a reactive baseline. With regime-based trend tracking, customizable visuals, and a detailed status table, it supports both discretionary and system-driven trading styles.
Disclaimer
This script is for informational and educational purposes only. It does not provide financial advice or guarantees. Trading involves risk, and past performance is not indicative of future results. Always perform your own research before making trading decisions.
Indicator

Hybrid Smart Money Concepts [MarkitTick]💡This indicator provides a comprehensive technical analysis system that combines Market Structure concepts (Smart Money Concepts) with advanced Gap Analysis and a statistical Stress Model. It is designed to help traders identify trend direction, structural pivot points, potential reversal zones (Order Blocks), significant price gaps, and moments of market exhaustion.
Unlike standard ZigZag or Fractal indicators, this script integrates volume, trend maturity, and statistical volatility (Z-Score) to contextually classify price action. By overlaying these elements with a robust Market Structure engine—which identifies Change of Character (CHoCH) and Order Blocks—the tool provides a confluent view of price action.
It automates the detection of institutional footprints, allowing traders to see the structural trend, momentum drivers, and potential exhaustion points simultaneously.
● METHODOLOGY
The script operates on three distinct but complementary logic engines:
• Gap Analysis Engine
This module detects gaps between the previous high/low and the current open. It classifies them into three specific types based on volume and structural context:
Breakaway Gaps: Identified when a gap creates a breakout above a recent Pivot High or below a Pivot Low. This signals the start of a potential new trend.
Exhaustion Gaps: Identified when a gap occurs with high relative volume and meets the Trend Maturity criteria. This often signals the end of a trend.
Runaway Gaps: Standard continuation gaps that occur within a trend.
• Market Structure Engine
Swings and CHoCH: The script uses a left-and-right bar lookback to identify Pivot Highs and Lows. A Change of Character (CHoCH) is plotted when price closes beyond the most recent major pivot.
Order Blocks (OB): Upon a continuation of the trend, the script scans backward to find the extreme candle (the origin of the move) and highlights this zone as an Order Block.
Dynamic Cleanup: Gaps and Order Blocks are automatically removed (mitigated) when price aggressively crosses through their levels.
• Exhaustion & Stress Model
This statistical engine measures market "Stress" by analyzing the impact of price range relative to volume (True Range / Volume).
Calculation: It calculates a Z-Score (Standard Deviation) of this impact.
Logic: When the Z-Score exceeds a specific threshold (Sigma), it indicates a statistical anomaly or "Stress."
Signal: If high stress occurs while price is significantly above the trend baseline, it signals "Buyer Exhaustion." Conversely, high stress below the baseline signals "Seller Exhaustion."
● VISUALS & LEGEND
Before trading, you need to know what the indicator is drawing on your chart:
• Change of Character (CHoCH)
Green Dashed Line: Indicates a Bullish reversal.
Red Dashed Line: Indicates a Bearish reversal.
• Order Blocks (OB)
Green Boxes: Bullish support zones (Buy interest).
Red Boxes: Bearish resistance zones (Sell interest).
Note: Invalidated boxes are automatically deleted.
• Gaps
Blue Box (Breakaway): Strong momentum gap starting a new trend.
Orange Box (Runaway): Continuation gap.
Red Box (Exhaustion): Warning signal; trend may be ending.
• Stress Model Signals
Label "BE" (Red): Buyer Exhaustion. Suggests the bullish move is overextended relative to volume participation.
Label "SE" (Green): Seller Exhaustion. Suggests the bearish move is overextended.
● TRADING STRATEGY
You can use a "Pullback, Continuation & Exhaustion" strategy with this indicator.
• Scenario A: Long Setup (Buying)
Trend Change: Look for a CHoCH label with a Green Dashed Line.
Entry Zone: Look for a Green Order Block (OB) to form.
Confirmation: A Breakaway Gap (Blue) validates the breakout.
Entry: Enter Long when price pulls back into the Green OB.
Exit Warning: If a "BE" (Buyer Exhaustion) label appears, consider tightening stops or taking profit.
• Scenario B: Short Setup (Selling)
Trend Change: Look for a CHoCH label with a Red Dashed Line.
Entry Zone: Look for a Red Order Block (OB) to form.
Confirmation: A Breakaway Gap downwards validates the move.
Entry: Enter Short when price rallies back into the Red OB.
Exit Warning: If an "SE" (Seller Exhaustion) label appears, consider tightening stops or taking profit.
● SETTINGS
• Date Range Filter
Use Date Filter: Toggle time-based filtering.
Start Date: Timestamp to begin calculations.
• Gap Analysis
Min Gap Size: Minimum points required to register a gap.
Logic Inputs: Configures lookback periods and volume multipliers for gap classification.
Visuals: Customize colors for Breakaway, Runaway, and Exhaustion gaps.
• Market Structure
Swing Detection Length: Lookback period for pivot points.
Show CHoCH: Toggle for Change of Character labels.
Show Order Blocks: Toggle for OB boxes.
• Exhaustion & Stress Model
Trend Filter Length: Baseline length for determining trend direction (EMA).
Statistical Lookback: Length for the Z-Score calculation.
Stress Threshold (Sigma): The standard deviation requirement to trigger an exhaustion signal (Default: 2.0).
● 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. I 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. Indicator

Amihud Illiquidity Ratio [MarkitTick]💡This indicator implements the Amihud Illiquidity Ratio, a financial metric designed to measure the price impact of trading volume. It assesses the relationship between absolute price returns and the volume required to generate that return, providing traders with insight into the "stress" levels of the market liquidity.
Concept and Originality
Standard volume indicators often look at volume in isolation. This script differentiates itself by contextualizing volume against price movement. It answers the question: "How much did the price move per unit of volume?" Furthermore, unlike static indicators, this implementation utilizes dynamic percentile zones (Linear Interpolation) to adapt to the changing volatility profile of the specific asset you are viewing.
Methodology
The calculation proceeds in three distinct steps:
1. Daily Return: The script calculates the absolute percentage change of the closing price relative to the previous close.
2. Raw Ratio: The absolute return is divided by the volume. I have introduced a standard scaling factor (1,000,000) to the calculation. This resolves the issue of the values being astronomically small (displayed as roughly 0) without altering the fundamental logic of the Amihud ratio (Absolute Return / Volume).
- High Ratio: Indicates that price is moving significantly on low volume (Illiquid/Thin Order Book).
- Low Ratio: Indicates that price requires massive volume to move (Liquid/Deep Order Book).
3. Dynamic Regimes: The script calculates the 75th and 25th percentiles of the ratio over a lookback period. This creates adaptive bands that define "High Stress" and "Liquid" zones relative to recent history.
How to Use
Traders can use this tool to identify market fragility:
- High Stress Zone (Red Background): When the indicator crosses above the 75th percentile, the market is in a High Illiquidity Regime. Price is slipping easily. This is often observed during panic selling or volatile tops where the order book is thin.
- Liquid Zone (Green Background): When the indicator drops below the 25th percentile, the market is in a Liquid Regime. The market is absorbing volume well, which is often characteristic of stable trends or accumulation phases.
- Dashboard: A visual table on the chart displays the current Amihud Ratio and the active Market Regime (High Stress, Normal, or Liquid).
Inputs
- Calculation Period: The lookback length for the average illiquidity (Default: 20).
- Smoothing Period: The length of the additional moving average to smooth out noise (Default: 5).
- Show Quant Dashboard: Toggles the visibility of the on-screen information table.
● How to read this chart
• Spike in Illiquidity (Red Zones)
Price is moving on "thin air." Expect high volatility or potential reversals.
• Low Illiquidity (Green/Stable Zones)
The market is deep and liquid. Trends here are more sustainable and reliable.
• Divergence
Watch for price making new highs while liquidity is drying up—a classic sign of an exhausted trend.
Example:
● Chart Overview
The chart displays the Amihud Illiquidity indicator applied to a Gold (XAUUSD) 4-hour timeframe.
Top Pane: Price action with manual text annotations highlighting market reversals relative to liquidity zones.
Bottom Pane: The specific technical indicator defined in the logic. It features a Blue Line (Raw Illiquidity), a Red Line (Signal/Smoothed), and dynamic background coloring (Red and Green vertical strips).
● Deep Visual Analysis
• High Stress Regime (Red Zones)
Visual Event: In the bottom pane, the background periodically shifts to a translucent red.
Technical Logic: This event is triggered when the amihudAvg (the smoothed illiquidity ratio) exceeds the 75th percentile ( hZone ) of the lookback period.
Forensic Interpretation: The logic calculates the absolute price change relative to volume. A spike into the red zone indicates that price is moving significantly on relatively lower volume (high price impact). Visually, the chart shows these red zones aligning with local price peaks (volatility expansion), leading to the bearish reversal marked by the red box in the top pane.
• Liquid Regime (Green Zones)
Visual Event: The background shifts to a translucent green in the bottom pane.
Technical Logic: This triggers when the amihudAvg falls below the 25th percentile ( lZone ).
Forensic Interpretation: This state represents a period where large volumes are absorbed with minimal price impact (efficiency). On the chart, this green zone corresponds to the consolidation trough (green box, top pane), validating the annotated accumulation phase before the bullish breakout.
• Indicator Lines
Blue Line: This is the illiquidityRaw value. It represents the raw daily return divided by volume.
Red Line: This is the smoothedVal , a Simple Moving Average (SMA) of the raw data, used to filter out noise and define the trend of liquidity stress.
● Anomalies & Critical Data
• The Reversal Pivot
The transition from the "High Stress" (Red) background to the "Liquid" (Green) background serves as a visual proxy for market regime change. The chart shows that as the Red zones dissipate (volatility contraction), the market enters a Green zone (efficient liquidity), which acted as the precursor to the sustained upward trend on the right side of the chart.
● About Yakov Amihud
Yakov Amihud is a leading researcher in market liquidity and asset pricing.
• Brief Background
Professor of Finance, affiliated with New York University (NYU).
Specializes in market microstructure, liquidity, and quantitative finance.
His work has had a major impact on both academic research and practical investment models.
● The Amihud (2002) Paper
In 2002, he published his influential paper: “Illiquidity and Stock Returns: Cross-Section and Time-Series Effects” .
• Key Contributions
Introduced the Amihud Illiquidity Measure, a simple yet powerful proxy for market liquidity.
Demonstrated that less liquid stocks tend to earn higher expected returns as compensation for liquidity risk.
The measure became one of the most widely used liquidity metrics in finance research.
● Why It Matters in Practice
Used in quantitative trading models.
Applied in portfolio construction and risk management.
Helpful as a liquidity filter to avoid assets with excessive price impact.
In short: Yakov Amihud established a practical and robust link between liquidity and returns, making his 2002 work a cornerstone in modern financial economics.
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. I 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. Indicator

Dynamic Pivot Point [MarkitTick]Title: Dynamic Pivot Point MarkitTick
Concept
Unlike traditional Pivot Points, which plot static horizontal levels based on the previous period's High, Low, and Close, this script introduces a dynamic element by applying an Exponential Moving Average (EMA) to the calculated pivot levels. This approach allows the Support and Resistance zones to adapt more fluidly to recent price action, reducing the jagged steps often seen in standard multi-timeframe pivot indicators.
How It Works
The script operates in two distinct phases of calculation:
1. Data Extraction and Core Math:
The indicator first requests the High, Low, and Close data from a user-defined timeframe (e.g., Daily, Weekly). Using this data, it calculates the standard Pivot Point (P) alongside three levels of Support (S1, S2, S3) and three levels of Resistance (R1, R2, R3) using standard geometric formulas:
Pivot = (High + Low + Close) / 3
R1 = 2 * Pivot - Low
S1 = 2 * Pivot - High
(Subsequent levels follow standard Floor Pivot logic).
2. Dynamic Smoothing:
Instead of plotting these raw values directly, the script processes each calculated level (P, S1-S3, R1-R3) through an Exponential Moving Average (EMA). The length of this EMA is controlled by the Pivot Length input. This smoothing process filters out minor volatility and creates curved, dynamic trajectories for the pivot levels rather than static straight lines.
How to Use
Traders can use this tool to identify dynamic areas of interest where price may react.
The White Line represents the Central Pivot. Price action relative to this line helps determine the immediate bias (above for bullish, below for bearish).
Green Lines (Support 1, 2, 3) indicate potential demand zones where price may bounce during a downtrend.
Red Lines (Resistance 1, 2, 3) indicate potential supply zones where price may reject during an uptrend.
Because the levels are smoothed, they can also act as dynamic trend followers, similar to moving averages, but derived from pivot geometry.
Settings
Show Pivot Points: Toggles the visibility of the plot lines on the chart.
Pivot Length: Defines the lookback period for the EMA smoothing applied to the pivot levels. A higher number results in smoother, slower-reacting lines.
Timeframe: Determines the timeframe used for the underlying High/Low/Close data (e.g., selecting "D" calculates pivots based on Daily data while viewing a lower timeframe chart).
Disclaimer This tool is for educational and technical analysis purposes only. Breakouts can fail (fake-outs), and past geometric patterns do not guarantee future price action. Always manage risk and use this tool in conjunction with other forms of analysis. Indicator

Trend Vector Pro v2.0Trend Vector Pro v2.0
👨💻 Developed by: Mohammed Bedaiwi
💡 Strategy Overview & Coherence
Trend Vector Pro (TVPro) is a momentum-based trend & reversal strategy that uses a custom smoothed oscillator, an optional ADX filter, and classic Pivot Points to create a single, coherent trading framework.
Instead of stacking random indicators, TVPro is built around these integrated components:
A custom momentum engine (signal generation)
An optional ADX filter (trend quality control)
Daily Pivot Points (context, targets & S/R)
Swing-based “Golden Bar” trailing stops (trade management)
Optional extended bar detection (overextension alerts)
All parts are designed to work together and are documented below to address originality & usefulness requirements.
🔍 Core Components & Justification
1. Custom Momentum Engine (Main Signal Source)
TVPro’s engine is a custom oscillator derived from the bar midpoint ( hl2 ), similar in spirit to the Awesome Oscillator but adapted and fully integrated into the strategy. It measures velocity and acceleration of price, letting the script distinguish between strong impulses, weakening trends, and pure noise.
2. ADX Filter (Trend Strength Validation – Optional)
Uses Average Directional Index (ADX) as a gatekeeper.
Why this matters: This prevents the strategy from firing signals in choppy, non-trending environments (when ADX is below the threshold) and keeps trades focused on periods of clear directional strength.
3. Classic Pivot Points (Context & Targets)
Calculates Daily Pivot Points ( PP, R1-R3, S1-S3 ) via request.security() using prior session data.
Why this matters: Momentum gives the signal, ADX validates the environment, and Pivots add external structure for risk and target planning. This is a designed interaction, not a random mashup.
🧭 Trend State Logic (5-State Bar Coloring)
The strategy uses the momentum's value + slope to define five states, turning the chart into a visual momentum map:
🟢 STRONG BULL (Bright Green): Momentum accelerating UP. → Strong upside impulse.
🌲 WEAK BULL (Dark Green): Momentum decelerating DOWN (while positive). → Pullback/pause zone.
🔴 STRONG BEAR (Bright Red): Momentum accelerating DOWN. → Strong downside impulse.
🍷 WEAK BEAR (Dark Red): Momentum decelerating UP (while negative). → Rally/short-covering zone.
🔵 NEUTRAL / CHOP (Cyan): Momentum is near zero (based on noise threshold). → Consolidation / low volatility.
🎯 Signal Logic Modes
TVPro provides two selectable entry styles, controlled by input:
Reversals Only (Cleaner Mode – Default): Targets trend flips. Entry triggers when the current state is Bullish (or Bearish) and the previous state was not. This reduces noise and over-trading.
All Strong Pulses (Aggressive Mode): Targets acceleration phases. Entry triggers when the bar turns to STRONG BULL or STRONG BEAR after any other state. This mode produces more trades.
📌 Risk Management Tools
🟡 Golden Bars – Trailing Stops: Yellow “Trail” Arrows mark confirmed Swing Highs/Lows. These are used as logical trailing stop levels based on market structure.
Extended Bars: Detects when price closes outside a 2-standard-deviation channel, flagging overextension where a pullback is more likely.
Pivot Points: Used as external targets for Take Profit and structural stop placement.
⚙️ Strategy Defaults (Crucial for Publication Compliance)
To keep backtest results realistic and in line with House Rules, TVPro is published with the following fixed default settings:
Order Size: 5% of equity per trade ( default_qty_value = 5 )
Commission: 0.04% per order ( commission_value = 0.04 )
Slippage: 2 ticks ( slippage = 2 )
Initial Capital: 10,000
📘 How to Trade with Trend Vector Pro
Entry: Take Long when a Long signal appears and confirm the bar is Green (Bull state). Short for Red (Bear state).
Stop Loss: Place the initial SL near the latest swing High/Low, or near a relevant Pivot level.
Trade Management: Follow Golden (Trail) Arrows to trail your stop behind structure.
Exits: Exit when: the trailing stop is hit, Price reaches a major Pivot level, or an opposite signal prints.
🛑 Disclaimer
This script is for educational purposes only and does not constitute financial advice. Past performance does not guarantee future results. Always forward-test and use proper risk management before applying any strategy to live trading.
Strategy

Filter Bar1. Indicator Name
Filter Bar
2. One-line Introduction
A trend-aware bar coloring system that visualizes market direction and strength through adaptive transparency based on regression scoring.
3. General Overview
Filter Bar+ is a minimalist but powerful trend visualization tool that colors chart bars according to market direction and momentum strength.
It analyzes the linear regression trend alignment over a specified lookback period and uses a pairwise comparison algorithm to determine whether the market is in a bullish, bearish, or neutral state.
The result is a "trend score" that gets normalized to reflect trend intensity (0~1).
Bar colors are then dynamically updated using the specified bullish or bearish base colors, where higher intensity results in more opaque (darker) bars, and weaker trends lead to lighter, faded tones.
If no strong trend is detected, bars are shown in gray, signaling indecision or neutrality.
The strength of this indicator lies in its simplicity—it doesn’t draw lines, waves, or shapes, but overlays insight directly onto the chart through smart color cues.
It’s particularly effective as a background filter for price action traders, scalpers, and anyone who prefers clean charts but still wants embedded directional context.
4. Key Advantages
🎨 Adaptive Bar Coloring
Bar color opacity increases with trend strength, offering instant visual confirmation without clutter.
📊 Quantified Trend Direction
Uses a regression-based scoring system to reliably detect uptrends, downtrends, or sideways markets.
⚖️ Customizable Sensitivity
Parameters like lookback period and tolerance percentage give users full control over signal responsiveness.
🧼 Clean Chart Presentation
No lines, shapes, or overlays—just color-coded bars that blend into your existing chart setup.
🚀 Lightweight & Fast
Minimal computational load ensures it works smoothly even on lower-end devices or multiple chart setups.
🔒 Secure Internal Logic
Algorithm is neatly encapsulated and optimized, with no critical logic exposed.
📘 Indicator User Guide
📌 Basic Concept
Filter Bar+ evaluates trend direction and strength using a pairwise comparison of linear regression values.
The result determines whether the market is bullish, bearish, or neutral, and adjusts bar colors accordingly.
It visually amplifies the current market state without drawing any indicators on the chart.
⚙️ Settings Explained
Lookback Period: Number of bars used to compare regression values
Range Tolerance (%): Minimum score required to label a trend as bullish or bearish
Regression Source: Data input used for regression (default: close)
Linear Regression Length: Period for generating the base regression line
Bull/Bear Base Colors: Choose colors to represent bullish or bearish bars
📈 Buy Timing Example
Bars are green (or user-set bullish color) and becoming more vivid
Indicates a strengthening bullish trend; helpful when used alongside breakout confirmation or support zones
📉 Sell Timing Example
Bars turn red (or your custom bearish color) with increasing opacity
Signals growing bearish pressure; acts as confirmation during short setups or breakdowns
🧪 Recommended Use Cases
Combine with volume, RSI, or price action setups for direction filtering
Ideal for clean chart strategies where visual simplicity is preferred
Use as a confirmation layer to reduce noise in sideways markets
🔒 Precautions
This is a visual filter, not a signal generator—use alongside other strategies for entries/exits
In choppy markets, bars may flicker between colors—adjust sensitivity as needed
Works best when you already have a directional thesis and want to validate it visually
Always test settings for your asset/timeframe before applying in live trades Indicator
