Indicatore

Libreria

Prop Firm Shield - Challenger [Quiet Edge]Your prop firm's rules, enforced at the chart. Prop Firm Shield tracks your daily-loss budget, drawdown buffer, and position size in real time — so the limit is visible the moment you are near it.
This is the Challenger tier — free, no login required. Enter your account size, starting balance, and current balance. The dashboard does the rest.
What it tracks
Daily loss budget — how much you have left, in dollars and percent
Drawdown buffer — remaining room before breach
Position size calculator — enter entry, stop, and risk % to get a recommended lot size
SAFE / CAUTION / STOP status with chart background alert
Upgrade to Operator ($19/mo) for verified firm presets (FTMO, Topstep, The5ers, MyFundedFutures), trailing drawdown, consistency rule tracker, and session close countdown.
Upgrade to Principal ($39/mo) for lot size escalation guard and an Evaluation vs Funded phase toggle — the only on-chart tool that models intraday trailing drawdown for funded accounts.
quietedgelabs.com/indicators/risk-management/prop-firm-shield Indicatore

Theil Sen Robust Slope [forexobroker]Theil Sen Robust Slope replaces ordinary least squares with the Theil-Sen estimator: the median of the slopes of all C(N, 2) pairwise lines through the last N closes. Robust to outliers up to a 29 percent breakdown point — a single price spike cannot drag the line. Pairs with a median intercept to give a regression line that ignores wicks and gaps.
🔶 ALGORITHM
1. For each pair (i, j) with i < j in the window, compute slope_ij = (close - close ) / (j - i).
2. slope = median(slope_ij) across all C(N, 2) pairs (190 for N = 20).
3. intercept = median(close + i * slope) for i in -> regression line value at the current bar.
4. Trending regime when |slope| > k * ATR per bar.
🔶 SIGNAL LOGIC
- Buy: trending regime up AND close crosses regression line up AND not already long AND cooldown elapsed AND barstate.isconfirmed.
- Sell: mirror.
- Position-lock state machine.
🔶 INPUTS
- Window N (default 20 -> 190 pairs)
- Slope Threshold x ATR/bar (default 0.10)
- Cooldown Bars (default 4)
- Visual: dashboard, glow, regression line, buy / sell colors
🔶 ALERTS
TSR Buy, TSR Sell, TSR Any Signal, TSR Trend Up Start, TSR Trend Down Start, TSR Cross Up, TSR Cross Down, TSR Slope Zero, TSR Webhook JSON.
🔶 LIMITATIONS
- Computational cost = N * (N - 1) / 2 slope computations per bar. N = 40 is the practical maximum on most plans (780 pairs).
- Theil-Sen is robust to a few outliers but not to sustained regime change; the line lags during fast directional moves.
- Window N must be >= 10 for a meaningful median; very short windows produce noisy slopes.
- Defaults tuned for liquid majors / indices. For low-volatility assets, lower the slope threshold.
Indicatore

Quantile Drift Engine [forexobroker]Quantile Drift Engine uses the rolling 25th and 75th percentiles of close as a robust analogue to mean and variance. The midpoint between Q25 and Q75 is the "interquartile median," which drifts directionally and is far less sensitive to spikes than a moving average. The drift, normalised by ATR, provides the regime gate; close cross of the midpoint provides the entry.
🔶 ALGORITHM
1. q25 = ta.percentile_linear_interpolation(close, N, 25); q75 = same at 75.
2. mid = (q25 + q75) / 2; drift = mid - mid .
3. Trending regime when |drift| > k * ATR.
4. Buy entry: trending up AND close crosses mid up.
5. Sell entry: trending down AND close crosses mid down.
🔶 SIGNAL LOGIC
- Buy: trending up AND close crosses mid up AND not already long AND cooldown elapsed AND barstate.isconfirmed.
- Sell: trending down AND close crosses mid down.
- Position-lock state machine.
🔶 INPUTS
- Quantile Window (default 40)
- Drift Lag (default 5 bars)
- Drift Threshold x ATR (default 0.10)
- Cooldown Bars (default 4)
- Visual: dashboard, glow, quantile bands, buy / sell colors
🔶 ALERTS
QDE Buy, QDE Sell, QDE Any Signal, QDE Drift Up, QDE Drift Down, QDE Mid Cross Up, QDE Mid Cross Dn, QDE Outside IQR, QDE Webhook JSON.
🔶 LIMITATIONS
- Percentile estimators need >= ~10 samples to be meaningful; short windows produce step-like quantiles.
- Linear interpolation between samples introduces minor smoothing; raw ranking would be slightly more responsive.
- Drift lag of 5 bars dampens noise but causes slight delay during sharp directional moves.
- IQR midpoint is robust but ignores tail behaviour; for tail-driven instruments pair with a separate volatility filter.
Indicatore

Particle Filter Pulse [forexobroker]Particle Filter Pulse runs a sequential Monte Carlo (32-particle) filter that tracks a hidden trend through Gaussian likelihood updates and effective-sample-size resampling. Particles use deterministic jitter — no random number generation, fully reproducible. When ESS collapses below the threshold, the filter resamples around the current price, marking a regime shift, and a fresh trend can lock in.
🔶 ALGORITHM
1. 32 particles each carry (price, velocity). Initialised at first bar with a deterministic spread around close.
2. Predict: each particle is propagated by its velocity plus a small ATR-scaled deterministic perturbation.
3. Likelihood: weight w_k *= exp(-0.5 * (close - px_k)^2 / sigma^2) with sigma = ATR.
4. Normalise weights. ESS = 1 / sum(w_k^2).
5. Resample when ESS < N * k: re-centre all particles at close and reset weights.
6. Filter mean = sum(w_k * px_k); velocity = sum(w_k * vx_k).
🔶 SIGNAL LOGIC
- Buy: close > filter mean AND velocity > 0 AND close crosses EMA up AND not already long AND cooldown elapsed AND barstate.isconfirmed.
- Sell: close < filter mean AND velocity < 0 AND close crosses EMA down.
- Position-lock state machine.
🔶 INPUTS
- Jitter (% of ATR) (default 0.30)
- ESS Collapse Fraction (default 0.50)
- Cooldown Bars (default 4)
- Visual: dashboard, glow, filter mean line, buy / sell colors
🔶 ALERTS
PFP Buy, PFP Sell, PFP Any Signal, PFP Resample, PFP Trend Up, PFP Trend Down, PFP EMA Up, PFP EMA Down, PFP Webhook JSON.
🔶 LIMITATIONS
- 32 particles is a small ensemble; the filter is qualitatively similar to a 1D Kalman in most regimes. The advantage shows in non-Gaussian / multimodal posteriors.
- Deterministic jitter trades randomness for reproducibility; for true SMC use offline Python tooling with RNG.
- Filter auto-recovers from symbol changes via a 20-ATR divergence guard but takes a few bars to relock.
- The Gaussian likelihood assumes stationary noise; heavy-tail spikes momentarily collapse all weights and trigger resampling.
Indicatore

Session Sweep Reversal Predictor - PhenLabs🚀 #67 Session Sweep Reversal Predictor - PhenLabs
📌 Overview
Session Sweep Reversal Predictor helps traders evaluate whether a confirmed session liquidity sweep is more likely to reverse or continue. It tracks Asian, London, and New York session ranges, detects qualified sweeps of prior session highs or lows, then uses a rolling Bayesian model to estimate reversal and continuation probability from previous sweep outcomes.
Instead of showing every wick through a level, SSRP filters for displacement using candle size versus ATR and body-to-range quality. The goal is to highlight cleaner sweep events where price actually shows intent after taking session liquidity.
📊 Core Idea
Markets often build liquidity around session highs and lows. When a later session sweeps a prior session range, the key question is not just “was liquidity taken?” but “did this sweep behave like prior sweeps that reversed, or like prior sweeps that continued?”
SSRP answers that question with a rolling event model. Each qualified sweep is classified by candle structure, displacement, and close location, then compared against historical outcomes inside the selected lookback window.
🚀 Key Features
✅ Tracks Asian, London, and New York session ranges
✅ Detects wick sweeps with rejection closes
✅ Optional failed-close sweep detection
✅ Session-aware sweep logic: London can sweep Asian, New York can sweep London or Asian
✅ Displacement filters using ATR expansion and body/range quality
✅ Rolling Naive Bayes probability model
✅ Reversal and continuation probability labels
✅ Session range boxes, session background tint, swept-level lines, and dashboard table
✅ Alerts for high reversal-probability and high continuation-probability sweeps
🔧 Settings
Session Timezone
Default: America/New_York
Options: America/New_York, Europe/London, Asia/Tokyo, UTC, exchange
Description: Timezone used for hour-based session classification.
Asian / London / New York Session
Default: Asian 18:00–03:00, London 03:00–07:59, New York 08:00–16:00
Description: Reference session windows for the model’s intended session structure. The script evaluates sessions by hour in the selected timezone.
Detect Wick Sweeps
Default: On
Description: Detects sweeps where price straddles a locked session level and closes back through it.
Detect Failed-Close Sweeps
Default: Off
Description: Detects sweeps where one bar closes beyond the level and the next bar reclaims it.
London may sweep Asian range
Default: On
Description: Allows London-session sweeps of the completed Asian range.
New York may sweep Asian range
Default: On
Description: Allows New York-session sweeps of the completed Asian range.
New York may sweep London range
Default: On
Description: Allows New York-session sweeps of the completed London range. New York gives London levels priority before falling back to Asian levels.
ATR Length
Default: 14
Description: ATR period used for displacement qualification and outcome measurement.
Min Candle Size × ATR
Default: 1.5
Description: Minimum candle range relative to ATR required for a sweep to qualify.
Min Body/Range Ratio
Default: 0.5
Description: Minimum body quality required to reduce weak wick-only signals.
Rolling Lookback
Default: 100 sweep events
Description: Number of prior sweep events retained in the probability model.
Laplace Smoothing α
Default: 4.3
Description: Smoothing factor used by the Bayesian model so early samples do not become overconfident.
Outcome Forward Bars
Default: 10
Description: Number of bars after a sweep used to classify whether the event reversed or continued.
Reversal Threshold %
Default: 60
Description: Probability level required to trigger high-reversal visual emphasis and alerts.
Continuation Threshold %
Default: 60
Description: Probability level required to trigger high-continuation visual emphasis and alerts.
🔥 How It Works
1. Build session ranges
• Asian, London, and New York highs/lows are tracked independently.
• When a session ends, its range is locked for later sweep detection.
• New Asian session starts reset prior London and New York levels for the new day.
2. Detect qualified sweeps
• London can sweep the completed Asian range.
• New York can sweep the completed London range first, then Asian range.
• A high sweep requires price to trade above the level and close back below it.
• A low sweep requires price to trade below the level and close back above it.
3. Filter for displacement
• Candle range must be large enough versus ATR.
• Candle body must represent enough of the full candle range.
• This helps reduce weak, noisy liquidity taps.
4. Score the sweep
• The model bins body quality, candle size, and close location.
• It estimates reversal versus continuation odds using a rolling Naive Bayes model.
• Laplace smoothing keeps the model from becoming too extreme on small samples.
5. Label the outcome
• After the selected forward-bar window, the script checks whether price moved at least one event ATR back through the swept level.
• If it did, the event is labeled as a reversal.
• If it did not, the event is labeled as continuation.
🎨 Visual Guide
• Blue box: Asian session range
• Orange box: London session range
• Background tint: active session
• Yellow dashed line: swept level
• Green label: reversal probability above threshold
• Red label: continuation probability above threshold
• Gray label: no high-confidence edge
• Dashboard: most recent sweep events, session, source range, direction, probabilities, and outcome status
📖 How to Interpret Signals
High Sweep
A prior session high was taken. A high reversal probability suggests the model favors downside reaction from the sweep. A high continuation probability suggests the model favors upside continuation after the liquidity take.
Low Sweep
A prior session low was taken. A high reversal probability suggests the model favors upside reaction from the sweep. A high continuation probability suggests the model favors downside continuation after the liquidity take.
REV %
Estimated probability that the sweep reverses by at least one event ATR within the forward-bar window.
CONT %
Estimated probability that the sweep does not meet the reversal condition within the forward-bar window.
✅ Best Used For
SSRP is designed for intraday traders who watch session liquidity, especially London and New York open behavior. It is most useful on liquid markets with clean session structure, such as major FX pairs, index futures, crypto majors, and high-volume equities.
⚠️ Important Notes
This is a statistical context tool, not a guaranteed prediction engine. The Bayesian probabilities are based only on the script’s rolling sample of prior qualified sweep events. Early chart history, low-liquidity symbols, unusual sessions, and small lookback samples can make the probabilities less stable. Indicatore

Indicatore

[GYTS-CE] Pattern Texture Codex (PTC)Pattern Texture Codex (Community Edition)
🌸 Part of GoemonYae Trading System (GYTS) 🌸
🌸 --------- INTRODUCTION --------- 🌸
💮 What is the Pattern Texture Codex?
Standard technical analysis focuses on two dimensions: Amplitude (how far price moves) and Momentum (how fast price moves). The Pattern Texture Codex introduces a third: Structure (how price moves).
This indicator implements Permutation Entropy (PE), a complexity measure from dynamical systems theory that captures whether price evolves in structured patterns or chaotic noise. We call this "Market Texture":
🫧 Smooth Texture (Low Entropy): Price evolves in ordered, predictable patterns. Trends are durable and causality is high. Momentum strategies favoured.
🌵 Rough Texture (High Entropy): Price evolves chaotically. The market is noisy, trends are fragile. Mean reversion or defensive sizing recommended.
💮 Why Use This Indicator?
Most "entropy" indicators on TradingView fall into common traps:
Shannon entropy of price histograms — measures value distribution but ignores temporal sequence
Approximate Entropy (ApEn) — measures amplitude similarity with O(N²) computational cost
Volatility metrics labelled "entropy" — captures magnitude, not pattern structure
Mathematical errors — normalised values that don't form valid probability distributions
The Pattern Texture Codex provides true ordinal pattern analysis — it examines the sequence of price movements, not just their distribution or magnitude. A smooth uptrend and choppy consolidation may have identical volatility, but their texture is completely different.
↑ Pattern Texture Codex with dynamic threshold bands. Rough Texture (high entropy) often indicates reversals, while Smooth Texture (low entropy) often precedes trend continuation.
🌸 --------- HOW IT WORKS --------- 🌸
💮 Core Concept: Ordinal Patterns
Instead of analysing raw price values, Permutation Entropy converts price into ordinal patterns — the relative ordering of consecutive data points.
For example, with embedding dimension D=3 (three points per pattern):
Pattern "012": first < second < third → ascending
Pattern "210": first > second > third → descending
Pattern "102": middle value smallest → valley shape
The indicator counts how often each pattern appears over a lookback window, then calculates the Shannon entropy of this distribution.
↑ With D=3, three consecutive data points determine each pattern. Left: ascending pattern "012" (first point smallest, second middle, third greatest). Right: descending pattern "210" (first point greatest, second middle, third smallest).
💮 Calculation Overview
The normalised Permutation Entropy is computed as:
H = −∑ p(π) · ln(p(π)) / ln(D!)
Where:
• p(π) is the probability of each ordinal pattern π
• D is the embedding dimension (number of points per pattern)
• D! is the total possible patterns (e.g., 4! = 24 for D=4)
The result ranges from 0 to 1:
• H → 0 : One pattern dominates — highly structured, predictable
• H → 1 : All patterns equally likely — pure randomness
↑ Full calculation example at D=3 showing the lowest entropy point (green vertical line). With 3!=6 possible patterns, the monotonic rising pattern "012" dominates while three other patterns occur only once. The frequency column feeds into the entropy contribution formula, yielding H(3)=1.039. Normalising produces 0.4019 — matching the indicator output exactly.
💮 Theoretical Background
Permutation Entropy has deep theoretical foundations. For piecewise monotone maps, it converges to the Kolmogorov-Sinai entropy — the fundamental measure of chaos in dynamical systems.
Key scientific properties:
• Scale invariance — analyses rank orderings, invariant to monotonic transformations
• Noise robustness — ordinal encoding naturally filters high-frequency noise
• Computational efficiency — O(1) amortised per bar with lookup acceleration
• Micro-structure sensitivity — captures specific sequence patterns, not just distribution
🌸 --------- KEY FEATURES --------- 🌸
💮 Lookup Table Acceleration
Standard PE requires sorting each embedding vector — O(D log D) operations per bar. This implementation uses precomputed transition tables from Unakafova & Keller (2013), reducing complexity to O(D) per bar.
The key insight: successive ordinal patterns in overlapping windows share (D−1) data points. Rather than recomputing from scratch, the algorithm derives the new pattern from the previous one using a single table lookup.
Enabled by default for Delay=1 and Dimension ∈ {3, 4, 5}
Falls back to standard calculation for D=2, D=6
💮 Flexible Threshold Modes
The indicator supports four independent threshold modes for both Smooth and Rough detection:
Static — Fixed threshold values you define
Dynamic — Adaptive bands based on entropy baseline ± standard deviation
Percentile — Threshold at Nth percentile of recent entropy history
Disabled — No threshold for that direction
You can mix modes: for example, Dynamic for Smooth detection while using Percentile for Rough detection.
🌸 --------- CONFIGURATION --------- 🌸
💮 General Settings
• Source — Price series to analyse (default: close)
• Smoothing Critical Period — Smoothing via 2-pole Ultimate Smoother (default: 0 = disabled). Reveals underlying texture by filtering entropy noise.
💮 Entropy Calculation
Dimension (D) — Points per ordinal pattern:
• D=3: 6 patterns — fast, stable. Good for limited lookback.
• D=4: 24 patterns — balanced, captures V-reversals. Recommended.
• D=5: 120 patterns — sensitive, captures W/M patterns. Noisier.
• D=6: 720 patterns — maximum sensitivity. No lookup acceleration.
Lookback — Estimation window size. Hard minimum: D × 5. Statistical recommendation: 5 × D! (e.g., 120 for D=4). Default: 100.
Delay (τ) — Stride between points in each pattern (default: 1). Change only for oversampled data.
Lookup Acceleration — Enables transition tables for D ∈ {3, 4, 5} with Delay=1.
💮 Threshold Management
Rough/Smooth Mode — Static, Dynamic, Percentile, or Disabled for each threshold
Static Values — Fixed threshold when Static mode selected
Std Dev Multiplier — Band width for Dynamic mode (default: 2.0σ)
Baseline/Deviation Length — Lookback for Dynamic mode calculations
Percentile Settings — Lookback and percentile values for Percentile mode
💮 Visualisation & Alerts
Palette — Colour scheme (default: GYTS Purple)
Colouring Bars — Applies texture colours to chart candles
Dark Mode — Optimises colour intensity for dark backgrounds
Alerts — Triggers when entropy crosses above/below thresholds
🌸 --------- USAGE GUIDE --------- 🌸
💮 Getting Started
Apply the indicator with default settings:
• Dimension: 4 (balanced complexity, captures V-shaped reversals)
• Lookback: 100 (responsive; statistical ideal: ≥120 for 5× coverage)
• Smooth Threshold: Dynamic mode with 2.0σ multiplier
Observe how entropy rises during choppy consolidation and falls during clean trends.
💮 Interpretation
Entropy Value (0 to 1):
Below 0.6: Strong pattern dominance — highly ordered
0.7–0.9: Normal complexity — typical market behaviour
Above 0.95: Near-random — patterns uniformly distributed
Transitions:
Watch for regime changes. When entropy rises sharply after a prolonged smooth period, the trend may be losing coherence. When entropy falls from elevated levels, a new trend may be establishing.
↑ Texture transitions during a trend-to-consolidation regime change. During the uptrend, similar patterns (D=3) recur frequently and entropy decreases. As the market transitions to consolidation, entropy rises — signalling the trend is losing structure.
💮 Trading Applications
Trend Filtering — Only take trend-following signals during Smooth texture.
Mean Reversion Timing — Elevated entropy often precedes mean reversion.
Position Sizing — Reduce exposure during Rough texture.
Exit Management — Tighten stops when entropy rises during a position.
💮 Integration with GYTS Suite
The Pattern Texture Codex exports two signals:
PE Continuous — Raw entropy value (0 to 1)
PE Ternary — State signal (+1 = Rough, 0 = Neutral, −1 = Smooth)
These can be read by Flux Composer or used as filter conditions with Market Regime Detector .
🌸 --------- PARAMETER TUNING --------- 🌸
💮 Lookback Selection
Shorter lookbacks react faster but may produce unstable estimates:
50–100: Responsive. Good for intraday regime detection.
100–200: Balanced. Recommended for swing trading.
200–500: Stable. Better for position trading or noisy instruments.
The indicator enforces a hard minimum of D × 5 to prevent meaningless output.
↑ Three dimensions (D=3, D=4, D=5) with their academically recommended minimum lookback periods.
💮 Threshold Tuning
For Smooth Detection:
Dynamic mode with 2.0σ works well across most instruments. Lower multipliers (1.5σ) detect structure earlier but may false-trigger.
For Rough Detection:
Percentile mode at 90th percentile identifies only extreme chaos. Static threshold of 0.95+ focuses on near-random conditions.
Consider disabling Rough detection entirely if your strategy only cares about identifying structured trends.
↑ The three threshold modes on the same PTC calculation. Both upper and lower thresholds are independently configurable.
🌸 --------- LIMITATIONS --------- 🌸
Amplitude Blindness — PE treats all patterns equally regardless of magnitude. A 0.1% drift and a 10% crash produce identical entropy if their ordinal patterns match.
Equal Values (Ties) — Handled via temporal tie-breaking (recent values rank higher), but heavily discretised data may produce edge-case behaviour.
Sample Size Requirements — Very short lookbacks (below D × 5) produce unreliable estimates. Statistical reliability improves with larger samples.
Not Predictive Alone — Low entropy indicates structure exists, not that the trend will continue. Combine with directional analysis for trading decisions.
Lag During Transitions — The sliding window approach introduces inherent lag when market texture changes.
🌸 --------- CREDITS --------- 🌸
💮 Academic Sources
Bandt, C., & Pompe, B. (2002). Permutation entropy: A natural complexity measure for time series. Physical Review Letters, 88 (17), 174102. DOI
Unakafova, V., & Keller, K. (2013). Efficiently measuring complexity on the basis of real-world data. Entropy, 15 (10), 4392-4415. DOI
Ehlers, J. F. (2024). The Ultimate Smoother. Technical Analysis of Stocks & Commodities , 2024-04. TASC
💮 Libraries Used
FiltersToolkit — Ultimate Smoother and other curated filters
PatternTransitionTables — Precomputed lookup tables for O(1) pattern transitions
ColourUtilities — Gradient palette generation and colour management
Indicatore

Risk Analysis [OmegaTools]Risk Analysis
Overview
Risk Analysis is a professional-grade, overlay risk dashboard designed for active traders and quantitative analysts who need a structured, real-time view of market conditions directly on their chart. Rather than cluttering the chart with multiple sub-pane indicators, this tool consolidates eight statistically grounded risk and market-structure metrics into a single, clean, repositionable table — giving you an immediate read on directionality, volatility, momentum regime, and price positioning at a glance.
The indicator is fully dollar-denominated via syminfo.pointvalue, making it natively compatible with futures contracts (NQ, ES, GC, CL, 6E, and others), where tick-scaled dollar values are essential for meaningful risk sizing and trade management.
Metrics Explained
Directionality — ADR$
The Average Directional Range captures the one-sided, committed portion of each bar's movement — the distance price traveled in a single direction — as opposed to the full high-low span. It blends a short-term RMA (11) with a medium-term SMA (34) to smooth noise while remaining responsive to shifts in directional energy.
dr = math.max(high - close, close - open)
adr = math.avg(ta.rma(dr, 11), ta.sma(dr, 34)) * syminfo.pointvalue
Expressed in dollar terms, ADR gives you a practical measure of how much price has been committing to a direction per bar, which directly informs target placement and profit expectation calibration.
Volatility — ATR$
The Average True Range measures the full extent of bar-to-bar price expansion, capturing both directional and indecisive (choppy) volatility. The same dual-smoothing structure (RMA 11 averaged with SMA 34) is applied for consistency with the ADR calculation.
tr = high - low
atr = math.avg(ta.rma(tr, 11), ta.sma(tr, 34)) * syminfo.pointvalue
Expressed in dollars, ATR serves as the baseline volatility reference for stop-loss sizing, risk-reward calibration, and position sizing models.
Directionality Relative — X multiplier
This metric contextualizes the current ADR/ATR ratio against its own 50-bar rolling average, expressing the result as a multiplier.
directionality = adr / atr * 100
directionalityrelative = directionality / ta.sma(directionality , 50)
A reading of 1.0X means directional intensity is at its historical norm. Values above 1.0X indicate the market is more directional than its recent baseline, which is favorable for trend-following approaches. Values below 1.0X signal a contraction in directionality, suggesting a shift toward mean-reversion or consolidation conditions.
Distance from High — $
The dollar distance between the current close and the 11-bar swing high. This metric directly quantifies how much room price has traveled away from a recent structural peak, which is critical for assessing short-side risk exposure, trailing stop management, and mean-reversion entry evaluation.
distfromh = (ta.highest(high, 11) - close) * syminfo.pointvalue
Low values indicate price is pinned near the top of the recent range. High values indicate extended downside displacement from the swing high.
Distance from Low — $
The symmetric complement — the dollar distance between the current close and the 11-bar swing low. High values indicate price has stretched far above a recent structural base.
distfroml = (close - ta.lowest(low, 11)) * syminfo.pointvalue
This pair of metrics together defines the current intra-range positioning of price, which is indispensable for both breakout and mean-reversion setups.
ADF — Augmented Dickey-Fuller Proxy
The ADF metric is a statistical proxy for the Augmented Dickey-Fuller test, a classic econometric test for stationarity (mean-reversion) versus unit-root behavior (trending). The 100-bar Pearson correlation between price changes and lagged price levels is used as the core signal, then scaled and shifted for readability.
adf = ta.correlation(close - close , close , 100) * 10 + 0.5
A negative correlation between price changes and price levels implies mean-reverting dynamics. A positive correlation implies trend-persistence. Values above 0 indicate a strong trending regime. Values near 0 indicate a transitional or mixed regime. Values below 0 indicate a mean-reverting regime where price consistently reverts from extremes. This is particularly valuable for regime-conditional strategy selection.
Relative Volume — RelVolume X
Relative Volume compares short-term volume activity against medium-term baseline activity, expressed as a multiplier.
relvol = ta.sma(volume, 5) / ta.sma(volume, 21)
Values above 1.0X indicate current volume is elevated relative to the recent norm, signaling heightened participation. Values near 1.0X indicate volume is in line with baseline. Values below 1.0X indicate suppressed volume and low conviction. This metric is essential for filtering signal quality — high-conviction moves require volume confirmation, and this ratio makes that assessment immediate and quantitative.
Z-Score
The Z-Score measures how many standard deviations the current price is displaced from its 21-bar rolling mean. It is one of the most direct statistical measures of mean-reversion opportunity.
zscore = (close - ta.sma(close, 21)) / ta.stdev(close, 21)
A Z-Score above +2 indicates price is significantly extended to the upside with elevated reversion risk. A Z-Score below −2 indicates price is significantly extended to the downside. A Z-Score near 0 indicates price is trading near its statistical center of gravity. Combined with the ADF and Relative Volume, the Z-Score completes a full statistical picture of the current market regime and opportunity type.
How to Use This Indicator
Trend-Following Context
When ADF is above 0, Directionality Relative is above 1.0X, and Relative Volume is above 1.0X, the market is showing statistically robust trending behavior with above-average participation. In this context, use ATR$ for stop-loss placement and ADR$ for realistic target sizing. Use Distance from High and Distance from Low to assess whether a pullback entry is available or whether price has already extended beyond a reasonable entry point.
Mean-Reversion Context
When ADF is below 0, Z-Score is above ±1.5, and Directionality Relative is below 1.0X, the market structure favors mean-reversion setups. Distance from High and Low identifies the magnitude of the current displacement from structure. Relative Volume below 1.0X in this context supports a low-conviction, fading approach.
Position Sizing
All dollar-denominated metrics — ADR$, ATR$, Distance from High$, Distance from Low$ — are scaled by syminfo.pointvalue, making them directly usable for dollar-based risk models. For example: if ATR$ reads 300$, a 1-ATR stop on a standard NQ contract represents $300 of risk per contract with no manual conversion required.
Inputs
Table Location — Default: Top Center. Repositions the dashboard anywhere on the chart. Available positions: Bottom Right, Bottom Center, Bottom Left, Middle Right, Middle Center, Middle Left, Top Right, Top Center, Top Left.
Compatibility
Recommended for futures markets where syminfo.pointvalue is meaningful (NQ, ES, CL, GC, 6E, and others). Compatible with all asset classes and all timeframes. Renders as an overlay table directly on the price chart with no sub-pane required. The table uses chart.fg_color throughout for full light and dark theme compatibility. All calculations run on the current symbol and timeframe with no secondary data requests, keeping the indicator lightweight and fast.
Notes
This indicator is published open source. Study, adapt, and build on it freely.
© OmegaTools — Professional quantitative tools for serious traders. Indicatore

U.S. Treasury Bills Held Outright | Astral Vision U.S. Treasury Bills Held Outright | Astral Vision 🌠💠
Treasury Bills Held Outright represents the stock of short-term US government securities held directly on the Federal Reserve's balance sheet.
Expansions of this holding reflect active Fed intervention in the short-term debt market, injecting liquidity into the financial system. Contractions signal withdrawal. Because T-Bills are the shortest-duration instrument the Fed holds, changes in this series respond faster than broader balance sheet metrics and can serve as an early read on the direction of monetary conditions.
This indicator plots the weekly WSHOBL series from FRED and colors it by whether its 10-bar rate of change is above a configurable growth threshold, distinguishing active expansion phases from stagnation or contraction. The same regime is projected onto the price chart as a background highlight.
Calculation ⚙️
`ROC = (val − val ) / |val |`
The signal colors positive when ROC exceeds the configured threshold, indicating active T-Bill accumulation by the Fed. Below the threshold the signal turns negative. Data is pulled weekly from FRED on confirmed closed bars.
Plots 📊
Weekly WSHOBL line in the indicator panel, colored by ROC regime
Background highlight on the price chart during active expansion phases (toggleable transparency)
Inputs 🎛️
`Overlay BG Transparency`: opacity of the price chart background highlight during expansion
Colors 🎨
5 Astral Vision presets + custom override. Default: Paradiso. Positive color activates when the rate of change exceeds the growth threshold; negative color applies otherwise.
Purpose 🎯
Most Fed balance sheet indicators track total assets or reserves, series that move slowly and are dominated by longer-duration holdings like MBS and Treasuries.
T-Bills Held Outright is a narrower and more reactive slice of the balance sheet that captures short-term liquidity operations directly.
When the Fed is actively accumulating T-Bills, it is injecting short-duration liquidity into the system, a condition that has historically been favorable for risk assets including Bitcoin.
This indicator makes that dynamic visible on any chart without requiring manual cross-referencing of FRED data.
Disclaimer ⭕️
It is not financial advice, not an investment recommendation, and not affiliated with any financial institution, research firm, or organization of any kind. All content is provided for educational and informational purposes only. Always conduct your own research before making any financial decision. Indicatore

ATR Volatility Regime [NovaLens]Volatility regime tool built to separate two things ATR alone cannot tell you apart: where volatility currently sits in its own rolling history, and which direction the regime is rotating. Adds a velocity-gated release event on top, so the indicator flags fast coiled-spring releases on the confirmed bar - and refuses to fire on the slow leaks that only look like one.
Most volatility tools collapse one axis. A raw ATR plot tells you the bar range and nothing about whether that range is rare. A percentile-rank histogram tells you the rank but not whether vol is loading or unloading. ATR Volatility Regime separates the two by design:
Tier tracks where volatility sits in its own rolling history (Compression / Quiet / Normal / Elevated).
Phase tracks where volatility is rotating (Rising / Topping / Falling / Bottoming).
A Compression reading is not a breakout signal. It is the market saying "vol is loaded." Whether it actually releases depends on the next move. When a sustained compression actually breaks above mid-rank within a 5-bar velocity window, the indicator prints a Release diamond and pulses the pane background. Slow leaks that drift through Quiet for more than 5 bars are canceled, not reported. That single gate is what separates a real coiled-spring release from a sideways drift.
════════════════════════════════════════════
◉ HOW IT WORKS
The vol input. Wilder ATR over the chosen length, expressed as a percentage of close so the read is comparable across price levels and instruments. Mathematically guarded to stay clean across historical data gaps and unusual price series.
The percentile rank. The current ATR% is ranked against its own rolling lookback window (100 / 200 / 300 bars by Horizon). This is an asset-calibrated percentile - "P75 on BTC" means "vol higher than 75% of the last 200 BTC readings," not a market-wide cutoff. The same indicator works across SPY, BTC, EURUSD, and XAU without retuning. The raw rank drives the state engine; an EMA-smoothed copy drives the visual line so the plot reads calm without numbing event detection. Warm-up is honest: until the lookback fills, the panel shows "Warming up" and refuses to assign a tier. NA never collapses to a fake Normal.
The tier model. Four tiers cut on rawRank (P25, P50, P75) with asymmetric hysteresis: 1 confirmed bar to step up (so a vol breakout is not missed), 3 confirmed bars to step down (so a tier change only confirms when vol has actually died). The ribbon fill and oscillator line both color by tier. Extreme is a signal class, not a tier; it would flicker on and off at the P90 boundary if we colored the ribbon by it.
The phase model. Four phases (Rising / Topping / Falling / Bottoming) read off the rawRank slope. Slow rotations need 2 bars of confirmation to flip; violent moves with |delta rank| > 15 bypass the confirm and flip immediately. Peak and trough detection is plateau-aware: a strict ( greater-than on both sides) check missed the patterns where ATR percentile pins at 100 for multiple bars, so the algorithm uses greater-or-equal on the left side and greater-than on the right.
The events. Three signature events, each with its own gating:
Compression Release : velocity-gated. The Compression tier must run at least 10 bars to load the spring; on exit, rawRank must reach the mid (>= 50) within a 5-bar window. Slow leaks that drift through Quiet for more than 5 bars are canceled. Re-entering Compression also cancels the pending episode.
Extreme Touch : rawRank peaks at >= 90. Re-arm runs through a three-valve cascade (rank drop to <= 75, a higher pivot with a +2 rank headroom so a 98 peak after a 97 cannot re-fire, or 2x lookback time decay) so the same Extreme arc cannot duplicate-fire, but a genuinely higher pivot in the same arc still counts.
Cooling : armed when an Extreme fires; fires on the first confirmed bar after where rawRank falls below 75 within a 10-bar window. Disarms on fire or when the window expires. The armed-latch architecture means fast drops out of an Extreme are tracked after the Extreme event arms Cooling, instead of relying on a single fragile cross check that would miss the drop if the threshold was already crossed on the Extreme bar itself.
The Playbook Lens. Pure interpretation layer. Engine, percentile, tier, phase, and objective events are identical across lenses. The Lens recolors three visual surfaces only: the panel Playbook row text and tone, the Playbook Heatmap Strip at y = -5, and an optional Tint Price Candles by Playbook Fit overlay. Switching the Lens dropdown answers a different question against the same volatility truth: "does this regime align with the workflow I am running?" - context, never a directive.
════════════════════════════════════════════
◈ HOW TO READ IT
The pane shows the smoothed percentile rank line wrapped in a tier-colored ribbon with a Volatility Glow halo that breathes wider in the loaded zones (Compression and Extreme) and tightens in Normal. Threshold lines mark P25, P50, P75, and P90.
Deep blue (Compression): rawRank in [0, 25). Loaded spring.
Light blue (Quiet): rawRank in [25, 50). Below median, not stretched.
Gray (Normal): rawRank in [50, 75). Typical bar ranges.
Orange (Elevated): rawRank in . High vol relative to recent history.
Red (Extreme): event color, not a tier. Drives Extreme Touch markers.
Teal (Release): event color, not a tier. Drives Compression Release markers.
Markers, in order of conviction:
Compression Release (diamond on the line, Release color, with a matching pane background pulse): a >= 10 bar compression run resolved into Normal+ within 5 bars. Non-directional by design - a volatility state change, not a price direction call.
Extreme Touch (small circle anchored to the actual peak bar, Extreme color): rawRank just peaked at or above the 90th percentile of its rolling history. Reads as topping pressure of vol, not a directional reversal call.
Cooling (panel-only event, no chart marker): the first confirmed bar after an Extreme where rawRank fell back below 75 within a 10-bar window. Surfaces in the Last Event row and the Cooling alert.
The info panel synthesizes six rows: Volatility (tier + P-Score), Flow (phase), Age (bars in tier + the per-tier duration percentile so a 200-bar Quiet stretch is compared against historical Quiet stretches, not Elevated), Last Event / Context (state-based decay, no fixed timer), ATR Range (current bar range as % of price, with absolute price-unit ATR in the row tooltip), and Playbook (the Lens context read).
The Last Event row uses state-based decay , not an arbitrary 10-bar timer. A Compression Release stays visible while phase is Rising or tier is Normal+. An Extreme Touch stays visible while tier is Elevated. A Cooling read stays visible while tier is Normal or Elevated. When the event's regime context expires, the row returns to Context and summarizes the current regime instead of resizing or disappearing.
════════════════════════════════════════════
✦ HOW WE USE IT: THE COILED-SPRING ARC
This is the arc the indicator is built to catch - not the only path. Many compressions resolve sideways without a confirmed release, and the velocity gate is what filters those out.
A common pattern on a liquid index or crypto chart, Swing profile (default), Neutral lens: the line drops into Compression and parks there for 15-30 bars. The ribbon turns deep blue, the Glow widens, and the panel Age row may read something like "Mature · 22 bars" or "Extended · 22 bars" - meaning the current run has already lasted longer than most recent Compression stretches on this market. The spring is loaded.
The full arc reads in four panel updates:
Release. rawRank reaches 50+ within the 5-bar velocity window after exiting Compression. A Release diamond prints on the line, the pane background pulses teal for one bar, and the Last Event row reads "Compression Release".
Run. Within a few bars the tier transitions through Normal into Elevated, the phase row flips Rising, and the smoothed line climbs toward the upper distribution.
Touch. If the move keeps loading, rawRank peaks at 92-98 and an Extreme Touch circle prints on the peak bar - the smoothed line is now in the upper edge of its own rolling distribution. The Last Event row updates to "Extreme Touch".
Unwind. Within 10 bars rawRank falls below 75. Cooling fires and the Last Event row updates again.
The Playbook Lens reframes the same arc without changing a number. Flip to Breakout: the Heatmap Strip lights teal during the release window (favorable) and dims toward red as the move stretches into Extreme (less favorable). Flip to Mean Reversion: the strip stays red through the release (vol is the wrong direction for fading) and only lights teal when Cooling confirms and tier drifts back through Normal toward Quiet. Flip to Risk Control: Compression marks calmer bar-range context, Elevated and Extreme mark the wider-bar context. Same volatility truth, different playbook fit. The engine is identical across lenses; only the interpretation layer changes.
════════════════════════════════════════════
✦ OTHER APPLICATIONS
Breakout context : Compression Release diamonds after a loaded quiet regime, optionally combined with the Heatmap Strip reading favorable under the Breakout lens
Trend context : Rising Elevated or Rising Normal volatility as movement context for an external trend plan
Mean-reversion context : quieter or cooling regimes that may be more suitable for contained-range workflows
Volatility risk overlay : Elevated and Extreme states as wider-bar context when reviewing size, stops, or trade frequency
Vol regime classifier : use the Volatility row + Flow row in the panel as a top-down filter for any external trade plan, independent of the Lens
Alert-driven workflow : subscribe to Compression Release + Extreme Touch + Cooling and check the chart only when the volatility regime actually changes, not every bar
════════════════════════════════════════════
⚙ GETTING STARTED
ATR Volatility Regime ships with three pre-tuned Horizon profiles plus a Custom override. Pick a horizon and start reading the regime:
Intraday : ATR 14, lookback 100, smoothing 3. Faster events, lighter hysteresis (1 up / 2 down). Use on 1m through 1H charts.
Swing (default) : ATR 14, lookback 200, smoothing 5. Balanced. Start here on 1H through 1D charts.
Long-Term Hold : ATR 20, lookback 300, smoothing 5. Slower, rarer events, heavier hysteresis (2 up / 3 down). Use on 1D and above.
Custom : full manual control of ATR Period, Lookback Window, and Smoothing.
Core settings:
Horizon : selects the tuning bundle above. Start with Swing.
ATR Period (Custom) : Wilder ATR period for the volatility input, in BARS. 14 is the standard. Shorter = more reactive; longer = smoother. Applies only when Horizon = Custom.
Lookback Window (Custom) : rolling lookback the ATR% is percentile-ranked against. Larger = smoother distribution, fewer extreme reads, slower compression releases. Smaller = sharper, more events.
Smoothing (EMA) (Custom) : EMA bars applied to the percentile-rank for the visual DISPLAY layer (plot, ribbon, panel readouts). The RAW rank still drives tier, phase, and events - smoothing only calms the visual. Set to 1 to disable smoothing.
Playbook Lens:
Neutral (default) : factual regime read, heatmap stays gray. Use this to learn the engine.
Breakout : range-expansion context. Loaded Compression and Compression Release read favorable; already-stretched Elevated or Extreme states shift toward caution.
Trend : directional-movement context. Rising Elevated and Rising Normal regimes read favorable; topping or cooling volatility shifts toward caution.
Mean Reversion : contained-range context. Quiet, Cooling, and Normal/Falling regimes read favorable; Release, Elevated, and Extreme regimes shift toward caution.
Risk Control : stretched-volatility context. Compression reads calm; Elevated and Extreme states warn that bar ranges are wide.
The Lens NEVER changes the engine - same tier, same phase, same Compression Release, same Extreme Touch, same alerts. Only the panel Playbook row text, the Heatmap Strip color, and the optional candle tint move.
Display:
Show Compression Releases (hero): diamond on the line + pane background pulse on release. On by default.
Show Extreme Touches : circle on the peak bar at rawRank >= 90. On by default.
Show Price Chart Markers : mirrors Compression Release diamonds and Extreme bar tints onto the price chart. OFF by default to keep the price chart clean.
Show Raw Rank Line : faint unsmoothed percentile rank line behind the smoothed display line. OFF by default. Toggle on to debug fast vol changes.
Show Volatility Glow : halo that widens at the loaded extremes (Compression and Extreme) and tightens in Normal. On by default.
Show Info Panel : 6-row state panel. On by default.
Panel Position : Top Right (default), Top Left, Bottom Right, Bottom Left, Middle Right.
Theme : Auto (detect chart background), Dark, or Light.
Show Playbook Heatmap Strip : thick band at y = -5 that recolors with the Lens. On by default.
Tint Price Candles by Playbook Fit : paints price-chart candles with the Release / Extreme palette per the active Lens. OFF by default; disabled automatically when Lens = Neutral.
Appearance / Palette (6 color pickers):
Compression, Quiet, Normal, Elevated, Extreme, Release - each on its own line with a state-explainer tooltip. The Display Rank line, Raw Rank, Tier Ribbon fill, Volatility Glow, Heatmap Strip, panel tier text, candle tints, and event markers all reference these inputs so users can adapt the palette (color-blind, light-mode, brand themes) without forking the script.
════════════════════════════════════════════
△ LIMITATIONS
Warm-up : the lookback window must fill before any tier is assigned. On Swing (200) that is 200 bars; on Long-Term Hold (300) that is 300. Until then, the panel shows "Warming up" and the state engine refuses to fake a Normal read.
Visual smoothing lag : the visible line is intentionally calmer than the raw engine. ATR is a backward-looking Wilder-smoothed measure, and the display line is lightly EMA-smoothed on top, so fast volatility expansions can look slightly delayed in the visible plot. The rawRank engine is the sharper layer underneath and is what actually drives the tier, phase, events, and alerts. The smoothed line is the readable copy; do not read a slight visual delay as the event engine being slow.
Percentile is relative, not absolute : a "Compression" read on a chronically quiet asset can still be wider than an "Elevated" read on a chronically loud asset. The indicator compares each asset against ITS OWN history, not across markets.
Regime shifts shrink the window : a structural vol regime change (e.g. a quiet 2-year period followed by a sustained higher-vol regime) takes about one lookback window to fully recalibrate. The first few weeks after a regime shift can read noisier than the steady-state.
Compression Release is non-directional : the diamond and the pane pulse tell you the spring released, not which way price went. Combine with directional context (trend, structure, or a separate momentum tool) for direction.
Extreme Touch is a state read, not a reversal call : rawRank pinning above 90 means vol is rare for this market; it does not mean price is about to reverse. Cooling tells you the unwind has begun, not where the next leg goes.
Playbook Lens is interpretation, not validation : the Heatmap Strip recolors regime context based on the active Lens. It is not a backtested edge - it is a quick visual answer to "does my workflow want this regime?"
════════════════════════════════════════════
🔔 ALERTS
Four alert conditions are built in so you can monitor without checking every bar manually:
Compression Release : a sustained compression (>= 10 bars) confirmed above mid-rank within 5 bars. The hero event.
Extreme Touch : rawRank peaked above P90. Fires on the bar after the actual peak (peak detection requires the next bar to confirm the turn-down).
Cooling : the first confirmed bar after an Extreme where rawRank falls below 75 within 10 bars.
Compression Entry : rawRank dropped below P25 (sustained tier transition into Compression).
All four alerts fire on bar close (gated on barstate.isconfirmed). Each alert message is a pure JSON payload with ticker, price, timeframe, and timestamp fields for webhook routing.
Four alerts by design - concentrated on the signature events. Tier and phase transitions stay visible in the info panel for users who want them on the chart, but they do not fire alerts. Keeping the alert stream lean is what makes "subscribe and let the regime come to you" a useful workflow instead of a notification flood.
════════════════════════════════════════════
⌁ NOTES
Based on the classical ATR percentile-rank construction, with asymmetric hysteresis and a velocity-gated compression-release definition layered on top.
Repaint: intrabar-only. Closed-bar alerts are confirmed; current-bar visuals may update until the bar closes. All alert conditions are gated on barstate.isconfirmed. Peak-confirmed events (Extreme Touch) print on the bar AFTER the actual peak, on a one-bar offset, so the marker aligns with the true peak bar.
References: J. Welles Wilder Jr., New Concepts in Technical Trading Systems (1978), Trend Research; percentile-rank concept widely used across volatility studies.
Open-source under MPL 2.0. Free to use, fork, study.
NovaLens Indicatore

Indicatore

Vytis_fx 5mins NQ scalping. Vytis_fx 5mins NQ Scalping is an advanced NAS100/NQ scalping framework designed for real-time intraday trading on lower timeframes. The indicator combines market structure, EMA trend analysis, liquidity sweeps, momentum confirmation, wick rejection logic, and volatility filters to identify high-probability BUY and SELL setups.
Key features:
* Automatic entry, stop loss, and take profit levels
* Dynamic risk/reward visualization
* EMA trend and momentum filtering
* Liquidity sweep and reclaim detection
* Multi-target TP1 / TP2 / TP3 management
* Built-in performance statistics and win-rate tracking
* Optimized for fast NAS100 scalping conditions
The framework is focused on providing clean, professional, institutional-style setup visualization while improving trade quality, risk management, and execution consistency for active scalpers. Indicatore

Bolsacava Stats FunOntheRide
Educational indicator created by Fun on the Ride / CryptoNews.
This script was built as a learning exercise after watching a public video by Bolsacava, where several intraday ideas about the E-mini S&P 500 futures contract (ES1!) were discussed.
The purpose of this publication is not to claim ownership of those ideas, impersonate Bolsacava, or present this as an official Bolsacava tool. It is an independent educational Pine Script project designed to show how recurring market claims can be translated into measurable statistics using 30-minute ES1! bars.
The goal is simple: learn, test, and verify.
Instead of assuming that a pattern works because it is often repeated, this tool checks how frequently it has actually occurred across recent historical sessions.
What the indicator shows
The script displays a compact on-chart table with the historical hit-rate of each pattern across three rolling windows:
- 20 sessions: short-term behaviour
- 60 sessions: medium-term context
- 120 sessions: broader baseline
This allows traders to compare whether a pattern is currently persistent, fading, or highly dependent on the selected sample size.
Patterns audited
The indicator tracks five ES1! intraday hypotheses:
H1 — Range-bound open between 15:30 and 17:00 Madrid time
H2 — Sell-off around the European close, from 17:00 to 18:00
H3 — Low-volatility window between 18:00 and 21:00
H4 — Volatility expansion between 20:00 and 21:00
H5 — Last-hour directional drift from 21:00 to 22:00
All times are referenced in Madrid local time. The calculations are based on bar timestamps and defined intraday windows.
Optional filters
The script can also recompute the statistics on a cleaner sample by excluding sessions affected by potentially anomalous events:
- CPI release days
- FOMC meeting days
- Extreme sessions, defined by unusually large range or volume
Comparing filtered and unfiltered results helps reveal whether a pattern is robust across normal sessions or mainly supported by outlier days.
How to interpret it
A higher percentage means that the pattern occurred more often within the selected rolling window.
This indicator does not provide buy signals, sell signals, stop-loss levels, take-profit levels, or position sizing. It is not a trading strategy.
It is a statistical screener designed to help traders test market narratives before using them as decision-making inputs.
Important notes
- Built for CME_MINI:ES1! on the 30-minute timeframe.
- Results may not translate to other symbols, sessions, or timeframes.
- The development sample covered approximately 600 historical sessions.
- Hit-rates will change over time as new sessions enter the rolling windows.
- Past frequency does not imply future reliability.
Attribution note
This is an independent educational project by Fun on the Ride / CryptoNews, inspired by a public Bolsacava video. It is not affiliated with, endorsed by, or officially published by Bolsacava.
The aim is to learn Pine Script, practice statistical thinking, and explore how trading narratives can be tested with data.
Disclaimer
This script is for educational and statistical research purposes only. It is not financial advice, does not recommend any trade, and makes no claim of profitability.
Open-source publication
The code is open-source so that users can inspect the logic, verify the calculations, adapt the hypotheses, and suggest improvements. Indicatore

Indicatore

Indicatore

Extra TimelineAre you tired of the default time axis getting cluttered, or do you need to keep track of a specific timezone (like your local time or a specific market session) directly on your chart?
Extra Timeline is a minimalist, highly customizable secondary time axis designed to keep your charts clean and readable, no matter how much you zoom in or out. It solves the common issue of overlapping text labels by using a "Smart Hide" feature that prioritizes full hours over minute intervals when space gets tight.
Key Features:
Smart Anti-Overlap System: Automatically hides minute intervals (like 15 or 30) when you zoom out, ensuring that the full hours always remain visible and the timeline never turns into an unreadable mess.
Minimalist & Clean Format: Removes unnecessary clutter. Full hours are displayed as a simple number (e.g., 9 instead of 09:00), and minute intervals show only the minutes (e.g., 30 instead of 09:30).
Visual Hierarchy: Fully customize the size and color of full hours versus minute intervals. Make full hours large and bright to stand out, while keeping minute markers small and subtle.
Custom Timezones: Easily offset the time to match any GMT timezone you need.
Flexible Intervals: Choose exactly where your time anchors are placed (5m, 10m, 15m, 30m, 1H, 2H, or 4H).
Optional Date Display: Toggle the current date on or off alongside the time markers.
How to Use:
Simply apply the indicator to your chart and adjust the Timezone to your preference. If you notice labels starting to overlap when zooming, just increase the "Minimum Space (in bars)" setting in the indicator options to give the labels more room to breathe.
Perfect for day traders and scalpers who need a precise, distraction-free sense of time across different market sessions! Indicatore

Mutual Info Decoupler [forexobroker]Mutual Info Decoupler measures the information-theoretic dependence between price returns and volume over a rolling window. High MI = price moves explained by volume (informed flow). Low MI = price and volume decoupled (noise). Signals fire on EMA cross within a coupled regime, where the move is statistically grounded.
🔶 ALGORITHM
1. Bin returns into 3 quantile classes (low / mid / high) using +/- 0.5 sigma boundaries.
2. Bin volume into 3 classes (low / mid / high) using volume_avg * 0.7 and 1.3 boundaries.
3. Build 3x3 joint count matrix; derive marginals P(r) and P(v).
4. MI = sum_{r,v} P(r,v) * log( P(r,v) / (P(r) * P(v)) ) in nats.
5. Coupled regime when MI >= threshold.
🔶 SIGNAL LOGIC
- Buy: coupled AND close > SMA AND close crosses EMA up AND not already long AND cooldown elapsed AND barstate.isconfirmed.
- Sell: coupled AND close < SMA AND close crosses EMA down.
- Position-lock state machine.
🔶 INPUTS
- MI Window (default 60)
- Pullback EMA Length (default 8)
- Min MI (default 0.05 nats)
- Cooldown Bars (default 4)
- Visual: dashboard, glow, EMA toggle, buy / sell colors
🔶 ALERTS
MID Buy, MID Sell, MID Any Signal, MID Coupled On, MID Coupled Off, MID High MI, MID Cross Up, MID Cross Down, MID Webhook JSON.
🔶 LIMITATIONS
- 3x3 binning is coarse; finer resolution needs much more history to avoid empty cells.
- Forex tick volume is broker-aggregated and noisy; instruments with reliable volume produce more meaningful MI.
- MI is symmetric and dimension-free but does not tell direction; directional gating uses SMA bias.
- Window N = 60 is a balance between estimator stability and adaptiveness; longer windows produce smoother MI but slower regime detection.
Indicatore

Lempel Ziv Trend Coder [forexobroker]Lempel Ziv Trend Coder encodes the recent sign sequence of price changes into 3-bit (sign , sign , sign ) windows and tracks the frequency distribution of the eight resulting patterns. When one pattern dominates the share, the price sequence is structurally biased — that is the trending regime. Direction comes from the up-bar fraction.
🔶 ALGORITHM
1. For each k in , encode (b0, b1, b2) where bi = close > close .
2. Increment count where p = b0 * 4 + b1 * 2 + b2 (0..7).
3. dominance = max(count) / sum(count). Uniform random = 0.125.
4. Trending regime when dominance >= threshold.
5. Direction bias from up-bar fraction in the same window.
🔶 SIGNAL LOGIC
- Buy: trending AND up-fraction > 0.5 AND close crosses EMA up AND not already long AND cooldown elapsed AND barstate.isconfirmed.
- Sell: trending AND up-fraction < 0.5 AND close crosses EMA down.
- Position-lock state machine.
🔶 INPUTS
- Sign Window (default 40)
- Pullback EMA Length (default 8)
- Min Dominance (default 0.20)
- Cooldown Bars (default 4)
- Visual: dashboard, glow, EMA toggle, buy / sell colors
🔶 ALERTS
LZT Buy, LZT Sell, LZT Any Signal, LZT Trend Start, LZT Chop Start, LZT Very Trendy, LZT Very Choppy, LZT EMA Up, LZT Webhook JSON.
🔶 LIMITATIONS
- 3-bit encoding ignores bar magnitude; a tiny tick contributes the same as a large move.
- "Distinct patterns observed" alone saturates at 8 quickly with N >= 40 bars; dominance is a more discriminative measure but still coarse.
- LZ true complexity is closer to a substring count than a pattern-frequency count; this is a tractable approximation.
- Direction comes from up-fraction, not the LZ measure itself; in true random regimes the direction signal is meaningless and the regime gate correctly mutes signals.
Indicatore

Kalman Trend State [forexobroker]Kalman Trend State applies a recursive Kalman filter to price, treating the unobserved trend as a hidden state with two components: instantaneous price level and per-bar velocity. Unlike a moving average, the filter's smoothing gain updates bar-by-bar from the residuals (innovation), so it adapts to volatility automatically without any length knob.
🔶 ALGORITHM
1. State tracks price and velocity. Transition F = [ , ] (constant-velocity model).
2. Process noise Q is ATR-adaptive: Q = q_base + q_scale * (ATR / close). Higher volatility = larger Q = faster adaptation.
3. Measurement noise R is fixed (user input). Higher R = filter trusts the model more, smoother output.
4. At each bar: predict (px, P) -> measure close -> update gain K = P_pred * H' / S where S = P_pred + R -> correct (px, vx, P).
5. The innovation z-score (close - prediction) / sigma quantifies how well the filter is tracking.
🔶 SIGNAL LOGIC
- Buy: velocity > k * ATR AND |innovation z| <= sigma gate AND close crosses Kalman line up AND not already long AND cooldown elapsed AND barstate.isconfirmed.
- Sell: mirror with velocity < -k * ATR.
- Position-lock state machine prevents same-side over-firing.
🔶 INPUTS
- Process Noise Base Q (default 0.001)
- Q ATR-Pct Scale (default 0.01)
- Measurement Noise R (default 1.0)
- Velocity Threshold x ATR (default 0.10)
- Innovation Sigma Gate (default 1.0)
- Cooldown Bars (default 4)
- Visual: 3-layer glow toggle, Kalman line toggle, dashboard toggle, buy / sell colors
🔶 ALERTS
KTS Buy, KTS Sell, KTS Any Signal, KTS Trend Up Start, KTS Trend Down Start, KTS Clean Fit, KTS Cross Up, KTS Cross Down, KTS Webhook JSON.
🔶 LIMITATIONS
- Kalman is optimal under linear-Gaussian assumptions; price is heavy-tailed, so the filter occasionally lags during regime breaks.
- Warm-up: about 14 bars (ATR seed). Earlier bars have NaN-guarded fallbacks but signals stay flat.
- Defaults tuned for liquid majors and indices on 5m-1H. Re-tune R for tick-driven micro-instruments.
- Velocity threshold scales with ATR but the filter itself does not change shape; for highly seasonal assets, a session-aware variant may help.
Indicatore

Higuchi Fractal Dimension [forexobroker]Higuchi Fractal Dimension estimates the fractal dimension D of the price curve in a bounded interval: D close to 1 means smooth and trending, D close to 2 means jagged and random. The simplified two-scale variant (k = 1 and k = 4) gives a fast, deterministic estimator suitable for live charts.
🔶 ALGORITHM
1. L(1) = average absolute single-bar move over the window: sum |close - close | / (N - 1).
2. L(4) = average absolute four-bar move, normalised by step count.
3. Dimension D = log(L(1) / L(4)) / log(4) + 1, clipped to .
4. Smooth regime when D <= threshold.
5. Direction comes from close vs trend SMA.
🔶 SIGNAL LOGIC
- Buy: smooth regime AND close > SMA AND close crosses SMA up AND not already long AND cooldown elapsed AND barstate.isconfirmed.
- Sell: smooth regime AND close < SMA AND close crosses SMA down.
- Position-lock state machine.
🔶 INPUTS
- Higuchi Window (default 60)
- Trend SMA Length (default 20)
- Smooth Threshold (default 1.65)
- Cooldown Bars (default 4)
- Visual: dashboard, glow, SMA toggle, buy / sell colors
🔶 ALERTS
HFD Buy, HFD Sell, HFD Any Signal, HFD Smooth On, HFD Smooth Off, HFD Strong Trend, HFD Strong Chop, HFD SMA Cross Up, HFD Webhook JSON.
🔶 LIMITATIONS
- Two-scale (k = 1, k = 4) approximation is faster but less accurate than the full Higuchi method (k = 1..k_max).
- D depends on price scale, partly mitigated by ratio formulation; on extremely thin instruments the estimator can saturate.
- Threshold 1.65 is calibrated to liquid majors / indices; faster instruments may need a lower threshold.
- "Random walk" is theoretical D = 1.5; real charts often show D between 1.4 and 1.7 even in clearly trending sessions.
Indicatore

Indicatore
