Market State Fear & Greed Bubble Index V1Market State Fear & Greed Bubble Index V1
📊 Comprehensive Market Sentiment Analyzer
This advanced indicator measures market psychology through a multi-dimensional scoring system, combining demand/supply pressure, trend momentum, and statistical extremes to identify fear/greed cycles and trading opportunities.
🎯 Core Features
Five-Factor Fear & Greed Score
Weighted sentiment analysis:
Demand/Supply (25%): Real-time buying/selling pressure
RSI (25%): Momentum extremes
KDJ (20%): Overbought/oversold detection
Bollinger Band % (20%): Statistical positioning
ADX Trend (10%): Trend strength confirmation
Multi-Layer Market State Detection
Extreme Fear/Greed: Statistical bubble identification
Trend Bias: Bullish/Bearish/Neutral classification
Confidence Scoring: Setup reliability assessment
Reversal Alerts: Early trend change signals
Visual Dashboard
Top-right information panel displays:
Fear & Greed Score (0-100)
Market State Classification
Trend Bias & Confidence
Signal Quality & Alerts
📈 Key Components
Fear & Greed Gauge
0-30: Extreme Fear (buying opportunities)
30-47: Fear (accumulation zones)
47-70: Neutral (consolidation)
70-90: Greed (caution zones)
90-100: Extreme Greed (selling opportunities)
Deviation Zones
Red Zone (±17.065): Critical reversal areas
Yellow Zone (±34.135): Warning levels
Blue Zone (±47.72): Statistical extremes where reversals are highly likely. These occur when asset prices are in a bubble that's about to pop.
Signal Types
Buy/Sell Labels: Primary entry/exit signals
Scalp Signals: Short-term opportunities
Bottom/Top Detectors: Extreme reversal zones
Whale Indicators: Institutional activity markers
🚀 Trading Applications
Extreme Fear Setups Conditions:
Fear & Greed Score < 34.135
BB% < 0 or < J-inverted line
RSI < 34.135
Confidence score > 68%
Bullish divergence present
Action: Accumulation positions, scaled entries
Extreme Greed Setup Conditions:
Fear & Greed Score > 68.2
BB% > 100 or > 80 with divergence
RSI > 68.2
ADX showing trend exhaustion
Multiple timeframe resistance
Action: Profit-taking, protective stops
Trend Following
Bullish Conditions:
Sentiment score rising from fear zones
DMI+ above DMI- and rising
Confidence > 75%
Volume supporting moves
Bearish Conditions:
Sentiment declining from greed zones
DMI- above DMI+ and rising
Distribution patterns
Multiple resistance failures
⚙️ Customization Options
Adjustable Parameters:
DMI Settings: DI lengths, ADX smoothing
KDJ Periods: Customizable sensitivity
BB% Range: Statistical band adjustments
Smoothing Options: Demand/Supply filtering
Alert Thresholds: Custom signal levels
Visual Customization:
Color schemes for different market states
Line thickness and style preferences
Information panel display options
Alert sound/visual preferences
📊 Signal Interpretation
Primary Signals:
Green 'B': Strong buy opportunity
Red 'S': Strong sell opportunity
White 'Scalp': Short-term trade
Trade Area: Accumulation/distribution zones
Visual Markers:
🔥: Bullish momentum building
🐻: Bear exhaustion building
🐳: Whale/institutional activity
Color-coded fills: Market state visualization
Confidence Levels:
≥80%: High reliability setups
60-79%: Moderate confidence
<60%: Low confidence, avoid or reduce size
⚠️ Risk Management Guidelines
Critical Rules:
Never trade against extreme sentiment (Extreme Fear → buy, Extreme Greed → sell)
Require multiple confirmation signals
Use confidence scores for position sizing
Avoid When:
Conflicting signals between components
Low volume participation
Confidence score < 50%
Major news events pending
Extreme volatility conditions
💡 Advanced Strategies
Sentiment Cycle Trading
Identify sentiment extremes
Wait for confirmation reversals
Enter with trend confirmation
Exit at opposite sentiment extreme
Use confidence scores and fear & greed scores to scale:
Fear & greed scores < 30 = buy area
Fear & greed score > 60 = sell area
Trend Momentum
Exit: At extreme greed with divergence
Enter: At extreme fear with divergence
📊 Market State Classification
Five Primary States:
EXTREME FEAR (BB% <0, RSI <34, Score <34)
FEAR (Score 34-47, bearish momentum)
NEUTRAL (Score 47-70, consolidation)
GREED (Score 70-90, bullish momentum)
EXTREME GREED (Score >90, BB% >100)
State Transitions:
Fear → Neutral: Early accumulation
Neutral → Greed: Trend development
Greed → Extreme Greed: Distribution
Extreme → Reversal: Trend change
🔍 Information Panel Guide
Real-Time Metrics:
FEAR & GREED: Current sentiment score
Market State: Classification and bias
Trend Bias: Bullish/Bearish/Neutral
Confidence: Setup reliability percentage
Momentum: Current directional strength
Volatility: Market condition assessment
Signal Quality: Trade recommendation
Reversal Imminent: Early warning alerts
🌟 Unique Advantages
Psychological Edge:
Quantifies market emotion through multiple indicators
Identifies bubbles before they pop
Provides statistical confidence for each setup
Combines technical extremes with sentiment analysis
Offers clear visual cues for decision making
Professional Features:
Multi-timeframe sentiment analysis
Real-time confidence scoring
Comprehensive alert system
Institutional activity detection
Clear risk/reward visualization
📚 Educational Value
This indicator teaches:
Market psychology cycles
Statistical extreme identification
Multi-indicator confirmation
Risk quantification methods
Professional trade management
Perfect for traders seeking to understand and profit from market sentiment cycles.
Disclaimer: For educational purposes. Trading involves risk. Past performance doesn't guarantee future results.
Statistics
Share Size CalcCalculate the share size to be used based on a percentage risk per trade and total capital in the account.
Candle Closing Range %Measuring strength of the daily closing candle after a gap up or strong open.
This indicator calculates where price closed within the day’s range and expresses it as a percentage. It is designed to give immediate context on whether buyers or sellers controlled the session — and is especially useful when analyzing gap days or trend continuation setups on intraday charts.
The indicator always references the most recent closed daily candle.
Formula:
Closing Range = (Close – Low) / (High – Low) × 100
Range interpretation:
• Closing range > 60% → Buyers dominated
• Closing range 40–60% → Neutral (directional bias unclear)
• Closing range < 40% → Sellers dominated
Style options:
• Background color
• Text Size
• Text Color
FlowMaster 4H - Avanced Volume & Pip Analyzer“Visualize market flow like an institutional trader – track buy/sell volume, pip per tick, and candle efficiency in one table.”
“Visualize market flow like an institutional trader – track buy/sell volume, pip per tick, and candle efficiency in one table.”
Short Description (Marketplace-Friendly):
Aggregated 4H candle analysis with buy/sell volume breakdown.
Pip/Tick calculation with weighted averages for smarter entry/exit signals.
Compare current candle volume to previous candle and 20-bar average.
All key metrics in a compact, easy-to-read table below the chart.
Ideal for Forex swing & position traders seeking institutional-style insights directly in TradingView.
Long Description / Full Product Info:
FlowMaster 4H is a professional-grade trading indicator designed to provide quantitative order flow analysis on Forex markets using 4-hour candles. By aggregating volume data, tick information, and pip movements, FlowMaster gives traders a unique perspective on market dynamics typically reserved for institutional participants.
Key Features:
Volume Relative Metrics: Compare the current candle volume to the previous candle and to the average of the last 20 candles.
Pip/Tick Analysis: Calculates pip per tick using a scaled price approach, giving insights into the efficiency of price moves.
Weighted Pip/Tick Averages: Tracks volume-weighted pip/tick over the last 20 candles for both buyers and sellers.
Percentage Metrics: Visualize the proportion of buy and sell volume relative to total ticks, helping identify absorption and impulse movements.
User-Friendly Table: All key indicators displayed in a compact, easy-to-read table below the chart.
Why use FlowMaster 4H:
Identify market absorption and impulse using reliable volume and pip metrics.
Optimize trade entry and exit decisions based on quantitative order flow data.
Works directly in TradingView, offering a professional order flow view without needing access to Level 2 order book data.
Pioneering approach in aggregating 4H candle data with detailed pip/tick insights.
Ideal For: Swing and position traders, Forex traders seeking institutional-style volume analysis, and anyone looking to improve order flow reasoning using TradingView.
P/E, EPS, Price & Price-to-Sales DisplayThis indicator displays key fundamental valuation metrics for the selected stock.
It shows:
Earnings Per Share (EPS)
Price-to-Earnings (P/E) ratio
Calculated theoretical price based on P/E × EPS
Price-to-Sales (P/S) ratio
These values help traders quickly assess valuation without switching to separate financial panels.
🛠 Instructions for Use
Add the indicator to your chart.
Click on the three dots (⋯) next to the indicator name.
Select Move to → New pane above.
Minimize the indicator pane to display only the numerical values.
Hide the plotted lines if you want a clean, numbers-only view.
This setup allows you to monitor fundamental metrics efficiently without cluttering the price chart.
Futures Risk Manager (Futures)Risk management table for consistency trading.
Auto adjustable for MINI/MICRO based on your account.
can change RR shows SL and TP and amount to enter.
Please take note that you need to update every trade the stop tick and RR ratio.
Good luck in your trading journey.
LEVENT: Lifetime Estimation via Efficiency-Regime EventLEVENT — Lifetime Estimation via Efficiency-Regime Event Transitions
LEVENT is a research-grade indicator that estimates the remaining structural lifetime of the current market regime.
Unlike trend, volatility, or momentum tools, LEVENT does not measure price movement — it measures how long the current market structure is likely to survive before breaking.
This script implements the LEVENT model published on Zenodo (Bülent Duman, 2026) and is built on top of the open-source DERYA (Dynamic Efficiency Regime Yield Analyzer) microstructural efficiency framework.
What LEVENT measures
LEVENT outputs a single continuous variable L that represents the remaining survival capacity of the active efficiency regime.
High L → the current regime has strong structural endurance
Falling L → the regime is consuming its capacity
L → 0 → regime exhaustion and elevated probability of transition
This makes LEVENT a forward-looking structural time variable, not a price indicator.
What is inside this script
This implementation contains the following components:
1. DERYA (open-source microstructure efficiency)
DERYA is computed from OHLC data as:
Net close-to-close movement divided by total intrabar range
It is smoothed with an EMA and normalized over a rolling window to produce a bounded efficiency state (0–100).
This is an open-source indicator and is explicitly credited in the LEVENT paper.
2. Transition Strength (S)
S measures how unstable the regime is by combining:
the slope of DERYA
the acceleration of DERYA
This is not RSI, MACD, or ATR — it is a state-transition intensity metric.
3. Regime Engine
Markets are classified into four structural regimes:
Expansion
Exhaustion
Collapse
Base / Recovery
A debounce + persistence filter is used to avoid noise-based flickering.
4. Structural Lifetime (LEVENT L)
Each regime is assigned a capacity (Λ) and a fragility (α).
LEVENT then evolves as a jump-and-countdown survival process:
On regime change → L resets to full capacity
Inside a regime → L decays deterministically
High instability → faster decay
This is not a moving average, oscillator, or probability estimate — it is a structural survival clock.
How to use LEVENT
LEVENT is designed to be used as a regime-health overlay, not a buy/sell trigger.
Typical uses:
Detect late-stage trends when L is low
Avoid initiating positions when the regime is near collapse
Compare structural stability across assets
Combine with price, trend, or volume systems
Do not use LEVENT alone as a trading signal.
LEVENT tells you “how long the structure may last”, not “where price will go.”
Visuals
Background colors show the current regime
The LEVENT line shows remaining structural lifetime
A table displays the active regime and current L value
Important notes
LEVENT is not RSI, MACD, ATR, or trend
LEVENT does not predict price direction
LEVENT does not issue entry/exit signals
LEVENT is a research-grade structural model
The DERYA component used here is an open-source microstructural efficiency estimator and is credited accordingly.
Risk and disclaimer
This script is provided for research and analytical purposes only.
It is not financial advice and must not be used as a standalone trading system.
Markets are uncertain.
All trading decisions and risks remain entirely the responsibility of the user.
LEVENT: Lifetime Estimation via Efficiency-regime Event Transitions
Introducing a Regime-Dependent Structural Lifetime Estimator for Financial Markets Using OHLC Data
Author: DUMAN,Bülent
Affiliation: Independent Researcher
zenodo.org
Kalman Hull Trend Score [BackQuant]Kalman Hull Trend Score
Overview
Kalman Hull Trend Score is a trend-strength and regime-evaluation indicator that combines two ideas, Kalman filtering and Hull-style smoothing, then measures persistence of that filtered trend using a rolling score. The goal is to produce a cleaner, more stable trend read than typical moving average tools, while still reacting fast enough to be practical in live markets.
Instead of treating a moving average as a simple line you cross, this indicator turns the filtered trend into an oscillator-like score that answers: “Is the smoothed trend consistently progressing, or is it stalling and degrading?”
Core idea
The indicator is built from two components:
A Kalman-based smoothing engine that estimates price state and reduces noise adaptively.
A Hull-style construction that uses multiple Kalman passes to create a responsive, low-lag trend filter.
Once the Kalman Hull filter is built, a persistence score is calculated by comparing the current Kalman Hull value to many past values. The result is a trend score that rises in sustained trends and compresses or flips during deterioration.
Why Kalman instead of standard smoothing
Traditional moving averages apply fixed smoothing rules regardless of market conditions. A Kalman filter behaves differently, it is designed to estimate an underlying state in noisy data, adjusting how much it “trusts” new price information versus prior estimates.
This script exposes that behavior through two key controls:
Measurement Noise: how noisy the observed price is assumed to be.
Process Noise: how much the underlying state is allowed to evolve from bar to bar.
Together, these settings let you tune the balance between smoothness and responsiveness without relying on blunt averaging alone.
Kalman filter mechanics (conceptual)
Each update cycle follows the classic structure:
Prediction: assume the state continues, and expand uncertainty by process noise.
Update: compute Kalman Gain, then blend the new price observation into the estimate.
Correction: reduce uncertainty based on how much the filter accepted the new information.
When measurement noise is higher, the filter becomes more conservative, smoothing harder. When process noise is higher, the filter adapts faster to regime changes, but can become more reactive.
Check out the original script:
Kalman Hull construction
The “Hull” component is not a standard HMA built from WMAs. Instead, it recreates the Hull idea using Kalman filtering as the smoothing primitive. The structure follows the same intent as HMA, reduce lag while keeping the line smooth, but does it with Kalman passes:
Apply Kalman smoothing over multiple effective lengths.
Combine them using the Hull-style weighting logic.
Run the combined output through another Kalman pass to finalize smoothing.
The result is a Kalman Hull filter that aims to track trend with less jitter than raw price, and less lag than slow averages.
Another Kalman Hull with Supertrend
Trend scoring logic
The trend score is computed by comparing the current Kalman Hull value to past Kalman Hull values over a fixed lookback range (1 to 45 bars in this script):
If current kalmanHMA > kalmanHMA , add +1
If current kalmanHMA < kalmanHMA , add -1
This produces a persistence score rather than a simple direction signal. Strong trends where the filter keeps advancing will accumulate positive comparisons. Weak trends, chop, or reversals will cause the score to flatten, decay, or flip negative.
Interpreting the score
Read the score as trend conviction and persistence:
High positive values: bullish persistence, the filtered trend is progressing consistently.
Low positive values: trend exists but is fragile, progress is slowing.
Near zero: indecision, range behavior, frequent challenges to structure.
Negative values: bearish persistence or sustained deterioration in the filtered trend.
The rate of change matters:
Score expansion suggests trend is gaining traction.
Score compression often signals consolidation or exhaustion.
Fast flips usually accompany regime transitions.
Signal thresholds and regime transitions
User-defined thresholds convert the score into regimes:
Long threshold: score must exceed this level to confirm bullish persistence.
Short threshold: a crossunder of the score triggers bearish regime transition.
This is intentionally conservative. Long bias is maintained while the score holds above the long threshold. Short transitions are event-triggered on breakdown via crossunder, helping avoid constant flipping during minor noise.
Signals are only plotted on regime changes (first bar of the flip), keeping them clean for alerts and backtests.
Visual presentation
The indicator provides multiple layers depending on how you want to use it:
Kalman Hull Trend Score oscillator, color-coded by active regime.
Optional Kalman Hull filter plotted on the price chart for structure context.
Optional threshold reference lines for quick regime mapping.
Optional candle coloring and background shading for instant readability.
You can run it as a pure score panel or as a combined panel + on-chart trend overlay.
How to use in practice
Trend filtering
Favor long setups when the score remains above the long threshold.
Reduce directional aggression when score compresses toward zero.
Treat a short-threshold breakdown as a regime risk event, not just a signal.
Trend quality assessment
Rising score supports continuation trades and adds confidence to breakouts.
Flat or falling score warns that trend persistence is fading.
If price trends but score fails to expand, trend may be weak or liquidity-driven.
Trade management
Use the Kalman Hull line as dynamic structure reference on chart.
Use score deterioration to scale out before a full regime flip.
Use regime flips as confirmation for bias shifts rather than prediction.
Tuning guidelines
Measurement Noise
Higher: smoother filter, fewer false shifts, slower to adapt.
Lower: more responsive, more sensitive to microstructure noise.
Process Noise
Higher: adapts quicker to sudden changes, but can become twitchy.
Lower: steadier state estimate, but slower during sharp regime transitions.
A practical approach is to first tune measurement noise until the Kalman Hull line matches the “clean trend structure” you want, then adjust process noise to control how quickly it reacts when the regime genuinely changes.
Summary
Kalman Hull Trend Score transforms a Kalman-based Hull-style trend filter into a quantified persistence oscillator. By combining adaptive Kalman smoothing with low-lag Hull logic and a rolling comparison score, it provides a cleaner read on trend quality than basic moving averages or single-condition trend tools. It is best used as a regime filter, trend strength gauge, and structure-aware trade management layer.
Extreme Streak Leaderboard (Top 7)This script ranks the Top 7 consecutive decline streaks over 5 years (1825 days). It precisely tracks start dates, percentage drops, and subsequent rebound strength via a clean table, helping traders identify historical oversold patterns and high-probability reversal opportunities based on extreme price action."
CVD Complete Volume Analysis ProCVD Complete Volume Analysis Pro | Order Flow & Absorption
Introduction:
In the world of modern trading, Price is the advertisement, but Volume is the fuel. However, standard volume indicators on TradingView are often insufficient. They tell you how much was traded, but they don’t tell you how it was traded.
Was that large volume spike aggressive buying driving the trend? or was it a "buying frenzy" hitting a wall of passive limit orders (absorption)?
The CVD Complete Volume Analysis Pro (v5) is an advanced institutional-grade Order Flow engine. By utilizing 1-second intrabar data, this indicator reconstructs the "Tick Rule" to separate Aggressive (Market) orders from Passive (Limit) orders. It calculates Cumulative Volume Delta (CVD), detects Absorption/Distribution anomalies, and utilizes an embedded Logistic Regression model to predict daily directional bias.
This is not just an indicator; it is a complete Order Flow Dashboard designed to aid and support complex footprint charts for the everyday trader.
🏗️ How It Works: The "Micro-Structure" Engine
Most volume indicators on TradingView look at the close of a 1-minute or 5-minute bar to guess the volume direction. This script goes deeper.
1. The 1-Second Granularity
Using TradingView's request.security_lower_tf capability, this script pulls 1-second resolution data regardless of the chart timeframe you are on.
It analyzes the price movement every second.
It applies the "Tick Rule": If price moves up, volume is classified as Buy. If price moves down, volume is classified as Sell.
This allows for a highly accurate reconstruction of Buying vs. Selling pressure that standard indicators miss.
2. The "Cluster" Concept
The script aggregates these 1-second data points into Clusters.
Default: 60 seconds (1 minute) per cluster.
This creates a normalized "Heartbeat" of the market, allowing us to compare the efficiency of volume over fixed time windows, removing the noise of time-based chart distortions.
3. The "Passive" Detection Logic (The Core Feature)
This is the most powerful aspect of the tool. It calculates the relationship between Effort (CVD) and Result (Price Move).
The Baseline: The script calculates a rolling statistical baseline (Standard Deviation) of how much price should move for a given amount of Delta.
Absorption (Hidden Buying): If we see massive Aggressive Selling (Negative CVD) but price refuses to drop (or drops significantly less than the statistical model predicts), the script identifies this as Passive Buying.
Distribution (Hidden Selling): If we see massive Aggressive Buying (Positive CVD) but price refuses to rise, the script identifies this as Passive Selling.
📊 The Dashboard Breakdown
The on-screen dashboard is your command center. It updates in real-time to provide a snapshot of the market's internal mechanics.
Section 1: Flow Analysis
This section analyzes the current session's behavior.
Flow Type: Categorizes the market state using algorithmic logic.
Aggressive Buying/Selling: The market is trending, and aggressive participants are winning.
Strong Accumulation/Distribution: A reversal signal. Aggressive participants are trapped, and passive whales are absorbing order flow.
Flow vs. Price: Detects divergences instantly.
Bullish Divergence: Net Flow is Positive, but Price is down (indicates manipulation or temporary suppression).
Bearish Divergence: Net Flow is Negative, but Price is up (indicates a "trap" move).
Section 2: Volume Breakdown
A detailed ledger of the day's activity.
Aggressive Buy/Sell: Market orders executing at the ask/bid. This represents "Impatience."
Passive Buy/Sell: The estimated volume of Limit Orders absorbing the aggressive flow. This represents "Intent."
Net Flow: The mathematical sum of all buy pressure minus sell pressure.
Section 3: Net Positioning (Multi-Day)
Markets don't happen in a vacuum. This section looks back (default 5 days) to see the accumulated inventory.
Bias: Are we in a multi-day accumulation or distribution phase?
Activity Type:
High Hidden Activity: Indicates a fighting market with heavy limit orders (choppy/reversal prone).
Mostly Aggressive: Indicates a trending market with low resistance.
Section 4: Predictive Model (Machine Learning)
The script features an embedded Logistic Regression Model.
It trains on the last N days of Flow Data (CVD, Net Aggressive, Net Passive, Passive Ratios).
It outputs a Probability Score (0% to 100%) regarding the likelihood of an UP close for the current session.
Note: This is a probability model based on order flow history, not a guarantee. Use it as a bias confirmation tool.
🧠 Educational: How to Trade With This
Strategy 1: The "Absorption" Reversal
Context: Price hits a major resistance level.
Look at the Dashboard: You want to see "Flow Type" switch to "Strong Distribution".
The Logic: Price is rising, and aggressive buyers are hitting the ask. However, the script detects that for every buy order, a passive seller is absorbing it. Price stops moving up despite high volume.
The Trigger: When Price creates a lower low on the chart while the dashboard shows Distribution, this is a high-probability short entry.
Strategy 2: The Flow Divergence
Context: Price is trending down.
Look at the Dashboard: Price is making new lows, but the "Net Flow" is turning Green (Positive), or the "Cum CVD" is sloping upwards.
The Logic: This is "Effort vs. Result." Sellers are exhausted. They are pushing price down, but the net flow is shifting to buyers.
The Trigger: Enter Long on the first structure break.
Strategy 3: Trend Continuation
Context: Market is opening or breaking a range.
Look at the Dashboard: You want "Full Alignment."
Signals: "Flow Type" says Aggressive Buying, Net Flow is Positive, and the Predictive Model shows >60% Bullish Probability.
The Logic: There is no passive resistance. Aggressive buyers are pushing price up freely.
The Trigger: Buy pullbacks.
⚙️ Settings & Configuration
Cluster Size: The number of 1-second bars to group together.
Use 60 (1 min) for Scalping.
Use 300 (5 min) for Day Trading.
Average Length: The baseline for statistical calculations. Higher numbers = smoother baselines but slower adaptation.
Detection Settings:
Passive Multiplier: Adjusts the sensitivity of the absorption estimation. 1.0 is standard. Increase to 1.5 if you only want to see extreme anomalies.
Daily Tracking:
History Days: How many days of data to display in the table. Note: Due to TradingView data limits, keeping this between 3-5 days ensures the most stability.
⚠️ Important Technical Limitations
Please read this section carefully to understand the constraints of the Pine Script environment:
Data Depth (The 100k Limit): TradingView limits request.security_lower_tf to approximately 100,000 intrabars.
This means the script can typically only "see" the last 3 to 5 days of true 1-second data.
If you set History Days or Training Days too high (e.g., 20 days), the script may return 0 values for older dates because the high-resolution data simply doesn't exist on the server.
Approximation of Ticks: While 1-second data is extremely precise, it is still an aggregation. In extremely high-volatility events (like CPI releases), multiple ticks happen inside one second. The script attributes the volume of that second based on the close relative to the open/prev close. It is the best approximation possible on TradingView, but not a replacement for Level 3 Tick Data feeds.
Calculation Time: This is a heavy script. On lower-end devices or when loading on many charts simultaneously, you may experience a "Calculation took too long" warning. If this happens, reduce the History Days to 3.
🛡️ Disclaimer
No Repainting: This indicator uses strict historical referencing and does not repaint closed clusters.
Not Financial Advice: This tool provides data visualization. Order flow is a subjective art. Always manage your risk.
Author's Note:
I built this tool because I wanted the power of Order Flow footprint charts without the visual clutter. By using statistical baselines to detect passive liquidity, we can finally see the "invisible hand" of the market directly on our TradingView charts. I hope this adds value to your trading.
👍 If you find this script useful, please leave a Boost and a Comment below!
Spearman Correlation🔗 Spearman Correlation – Ranked Relationship Tracker
Overview:
This indicator calculates and plots the Spearman Rank Correlation Coefficient between the current chart’s asset and a custom comparison ticker (the example shown is BTC vs the OTHERS market cap for crypto). Unlike Pearson correlation, which measures linear relationships, Spearman correlation captures monotonic (ranked) relationships—making it better suited for analysing assets that move in sync but not necessarily in a linear fashion.
🧠 What It Does:
Computes ranked correlation between two assets over a user-defined lookback period
Smooths the correlation curve for better readability
Visually shades the background by correlation strength and direction:
🟩 Strong Positive (+0.5 to +1)
🟨 Weak Positive (+0.1 to +0.5)
⬜ No Correlation (–0.1 to +0.1)
🟧 Weak Negative (–0.5 to –0.1)
🟥 Strong Negative (–1 to –0.5)
⚙️ User Inputs:
Lookback Period: Number of bars used to calculate correlation
Comparison Ticker: Choose any asset to compare against
Shading Toggles: Customize which correlation zones are highlighted
📈 Use Cases:
Identify evolving relationships between assets (e.g., BTC vs DXY, ETH vs SPX)
Spot when assets become inversely correlated or lose correlation entirely
Track regime shifts where traditional relationships break down or re-align
Use alongside trend or momentum strategies to add a cross-asset confirmation layer
🔍 Interpreting the Correlation:
+1 → Perfect positive (ranks match exactly)
+0.5 to +1 → Strong positive relationship
+0.1 to +0.5 → Weak but positive relationship
–0.1 to +0.1 → Essentially uncorrelated
–0.5 to –0.1 → Weak negative correlation
–1 to –0.5 → Strong inverse relationship
–1 → Perfect negative (rankings are completely opposite)
🧪 Technical Notes:
Calculation uses ranked returns to better reflect monotonic relationships
Smoothed with a simple moving average (SMA) for stability
Arrays are managed internally to maintain performance and adaptability
This script is ideal for traders seeking deeper insight into cross-asset dynamics, portfolio hedging, or timing divergence-based strategies.
Directional Comparisons - Two Tickers📊 Directional Comparisons – Two Tickers
Overview:
This tool allows you to visually and statistically compare the directional behaviour of any two assets on any chart timeframe. It identifies and color-codes each bar based on how both the current asset and your chosen comparison asset performed in that period (e.g., both up, both down, diverging). A statistical summary table dynamically updates in the corner of your chart, tracking the probability and streak performance of each condition.
🛠 How It Works:
Each candle is analysed and color-coded based on the relationship between the current chart's asset and a comparison asset of your choice:
✅ Green – Both tickers closed higher (bullish alignment)
🔻 Red – Both tickers closed lower (bearish alignment)
🔷 Blue – Current ticker up, comparison ticker down (positive divergence)
🟧 Orange – Current ticker down, comparison ticker up (negative divergence)
You can toggle each colour condition on/off independently.
📈 Statistical Table (Top Right):
For the candles in the visible chart range, the indicator displays:
The frequency (probability) of each condition
Longest, shortest, and average streaks for each condition
Average % change for both the current and comparison asset under each scenario
All stats auto-update as you zoom or scroll through the chart.
🔧 User Inputs:
Comparison Ticker: Choose any ticker symbol to compare against the current chart
Toggle Conditions: Enable or disable individual directional conditions (color-coded)
✅ Use Cases:
Spot high-probability alignment zones between two assets (e.g., BTC vs ETH, SPX vs VIX)
Identify divergence opportunities for trading signals
Analyse historical relationships and co-movements between assets
Perform correlation streak studies directly on the chart
🔍 Notes:
The script works across all timeframes (1min to monthly).
Stats only consider visible bars on your chart for responsiveness.
Ideal for pair traders, macro analysts, or anyone interested in cross-asset relationships.
Percentage Price LevelsPercentage Price Levels displays dynamic price levels based on percentage gains and losses from the current price. Instantly visualize where price would be at ±2%, ±4%, ±6%, ±8%, ±10%(and beyond) — perfect for setting profit targets, stop-losses, and understanding potential price movement.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 WHAT IT DOES
• Draws horizontal lines at percentage-based price levels above and below current price
• Green lines = potential profit targets (positive %)
• Red lines = potential stop-loss zones (negative %)
• Yellow line = current price reference
• Summary table shows all levels in a clean, easy-to-read format
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙️ FEATURES
• Up to 8 positive and 8 negative percentage levels
• Fully customizable percentages (set your own values)
• Toggle each level on/off individually
• Adjustable font size (Tiny to Huge)
• Multiple line styles (Solid, Dashed, Dotted)
• Movable summary table (any corner)
• Base price options: Close, Open, High, Low, HL2, OHLC4
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📈 HOW TO USE
1. Add the indicator to your chart
2. Default shows ±2%, ±4%, ±6%, ±8%, ±10% levels
3. Open Settings to customize:
• Enable/disable specific levels
• Change percentage values
• Adjust colors and font size
• Move table position
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💡 USE CASES
• Day Trading — Quick intraday profit targets
• Swing Trading — Visualize multi-day price zones
• Risk Management — Set stop-losses based on % risk tolerance
• Options Trading — Find strike prices relative to spot
• Position Sizing — See exact dollar values at each level
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔧 DEFAULT SETTINGS
Positive: +2%, +4%, +6%, +8%, +10% (3 extra slots available)
Negative: -2%, -4%, -6%, -8%, -10% (3 extra slots available)
Font Size: Normal
Line Style: Dashed
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
If you find this useful, please leave a like! Feedback and suggestions welcome in the comments.
SA Trump Volatility Pattern Wick + Volume Shock ReversalDisclaimer (read first)
Educational use only — not financial advice. This script does not provide entries/exits, targets, position sizing, or profit guarantees. Trading (especially options/futures) involves substantial risk and can result in loss of principal (and more for leveraged products). Use at your own discretion.
Best use cases on the 2-Hour timeframe
On 2H, this script becomes a high-signal-quality “shock reversal” detector instead of a noisy candle toy. You’re essentially filtering for:
Large wick rejection
Small real body
Statistically unusual volume (Z-score > threshold)
Context alignment (trend filter + prior bar direction + optional RSI)
What 2H is best for
1) Detecting “event shock” reversals
2H bars often capture:
Macro headlines
Fed commentary
earnings reactions (for equities)
sudden volatility expansions
When the script fires on 2H, it often means:
“Aggressive push happened, liquidity got rejected, and participation was unusually high.”
That’s a structural clue, not a trade instruction.
2) Filtering false breakouts / breakdowns
The wick requirement is basically “failed continuation.”
On 2H, this is powerful around:
prior day highs/lows
weekly pivots
obvious consolidation edges
key moving averages (fast SMA / slow SMA gate)
Bull pattern = flush + reclaim behavior.
Bear pattern = pop + rejection behavior.
3) Options traders: timing “premium exposure windows”
On 2H, this is great for options traders who want to avoid buying premium into a fake move.
BullTrump on 2H can be used as a “don’t chase puts / be cautious short” context shift.
BearTrump on 2H can be used as a “don’t chase calls / be cautious long” context shift.
It’s a “regime hint” for the next few sessions, not a one-bar command.
4) Futures traders: rotation vs continuation framework
A 2H “Trump Candle” often marks:
the end of a liquidation leg
a stop-run / squeeze peak
a pivot moment where the market shifts from impulse to balance
Use it to decide whether you’re in:
continuation mode (trend carries)
or rotation mode (mean-reversion / two-way)
How to use it (2H workflow)
Step A — Keep it strict at first
Recommended defaults for 2H:
wickFracThreshold: 0.40–0.55
bodyMaxFrac: 0.35–0.45
volZThresh: 1.0–1.5
useRSIFilter: ON
RSI bull min / bear max: 45 / 55 (good baseline)
Step B — Treat triggers as “context events”
When it prints, ask 3 questions:
Where did it happen? (key level or random spot)
Was it aligned with trend gate? (SMA fast/slow)
Did volume Z-score spike? (true shock vs normal wick)
Higher quality triggers happen when:
the wick pierces a known level (prior swing / range edge)
and the close re-enters the range
and volume Z-score is meaningfully positive
Step C — Confirm with the next 1–2 candles (optional)
On 2H, it’s reasonable to wait for:
a follow-through close
or a hold above/below fast SMA
or a second “acceptance” candle
You can do this manually without changing code.
Other recommended timeframes (best to worst)
✅ 4H (even cleaner, fewer signals)
Use for:
swing context
multi-day pivots
big reversal points
✅ 1H (more signals, still structured)
Use for:
intraday + overnight context
day-trade bias shifts
✅ 30m (for active traders)
Use for:
tighter responsiveness
more setups
But requires more discretion; noise increases.
⚠️ 15m and below (only if you increase strictness)
If you want to run it on 5m/15m:
raise volZThresh (ex: 1.5–2.0)
raise wickFracThreshold (ex: 0.50–0.65)
lower bodyMaxFrac (ex: 0.25–0.35)
Otherwise it will trigger too often.
Best markets for this script
Works best on:
Index futures: /NQ, /ES (big volume makes Z-score meaningful)
Liquid ETFs: SPY, QQQ
High-volume large caps (AAPL, MSFT, NVDA etc.)
Less reliable on:
thin small caps (volume Z-score gets weird)
low-volume premarket candles
illiquid options underlyings
Signal Inside the Script ✅ SA ZoneEngine Bias Filtered is a market-structure bias and confirmation tool designed for futures To request access: 👉 Purchase here: trianchor.gumroad.com
Best GBT for this indicator
chatgpt.com
chatgpt.com
chatgpt.com
Range Breakout Statistics [Honestcowboy]⯁ Overview
The Range Breakout Statistics uses a very simple system to detect ranges/consolidating markets. The principle is simple, it looks for areas where the slope of a moving average is flat compared to past values. If the moving average is flat for X amount of bars that's a range and it will draw a box.
The statistics part of the script is a bit more complicated. The aim of this script is to expand analysis of trading signals in a different way than a regular backtest. It also highlights the polyline tool, one of my favorite drawing tools on the tradingview platform.
⯁ Statistics Methods
The script has 2 different modes of analyzing a trading signals strength/robustness. It will do that for 2 signals native to the script.
Upper breakout: first price breakout at top of box, before max bars (100 bars by default)
Lower breakout: first price breakout at bottom of box, before max bars
The analysis methods themselves are straightforward and it should be possible for tradingview community to expand this type of analysis to other trading signals. This script is a demo for this analysis, yet some might still find the native signals helpful in their trading, that's why the script includes alerts for the 2 native signals. I've also added a setting to disable any data gathering, which makes script run faster if you want to automate it.
For both of the analysis methods it uses the same data, just with different calculations and drawing methods. The data set is all past price action reactions to the signals saved in a matrix. Below a chart for explaining this visually.
⯁ Method 1: Averages Projection
The idea behind this is that just showing all price action that happened after signal does not give actionable insights. It's more a spaghetti jumble mess of price action lines. So instead the script averages the data out using 3 different approaches, all selectable in the settings menu.
Geometric Average: useful as it accurately reflects compound returns over time, smoothing out the impact of large gains or losses. Accounts for volatility drift.
Arithmetic Average: a standard average calculation, can be misleading in trading due to volatility drift. It is the most basic form of averaging so I included it.
Median: useful as any big volatility huge moves after a signal does not really impact the mean as it's just the middle value of all values.
These averages are the 2 lines you will find in the middle of the projection. Having a clear difference between a lower break average and upper break average price reaction can signal significance of the trading signal instead of pure chaos.
Outside of this I also included calculations for the maximum and minimum values in the dataset. This is useful for seeing price reactions range to the signal, showing extreme losses or wins are possible. For this range I also included 2 matrices of highs and lows data. This makes it possible to draw a band between the range based on closing price and the one using high/low data.
Below is a visualisation of how the averages data is shown on chart.
⯁ Method 2: Equity Simulation
This method will feel closer to home for traders as it more closely resembles a backtest. It does not include any commissions however and also is just a visualisation of price reaction to a signal. This method will simulate what would happen if you would buy at the breakout point and hold the trade for X amount of bars. With 0 being sell at same bar close. To test robustness I've given the option to visualise Equity simulation not just for 1 simulation but a bunch of simulations.
On default settings it will draw the simulations for 0 bars holding all the way to 10 bars holding. The idea behind it is to check how stable the effect is, to have further confirmation of the significance of the signal. If price simulation line moves up on average for 0 bars all the way to 10 bars holding time that means the signal is steady.
Below is a visualisation of the Equity Simulation.
⯁ Signal filtering
For the boxes themselves where breakouts come from I've included a simple filter based on the size of the box in ATR or %. This will filter out all the boxes that are larger top to bottom than the ATR or % value you setup.
⯁ Coloring of Script
The script includes 5 color themes. There are no color settings or other visual settings in the script, the script themes are simple and always have colors that work well together. Equity simulation uses a gradient based on lightness to color the different lines so it's easier to differentiate them while still upper breaks having a different color than lower breaks.
This script is not created to be used in conjunction with other scripts, it will force you into a background color that matches the theme. It's purpose is a research tool for systematic trading, to analyse signals in more depth.
Metaverse color theme:
⯁ Conclusion
I hope this script will help traders get a deeper understanding of how different assets react to their assets. It should be possible to convert this script into other signals if you know how to code on the platform. It is my intention to make more publications that include this type of analysis. It is especially useful when dealing with signals that do not happen often enough, so a regular backtest is not enough to test their significance.
First Candle com TargetsThis Pine Script implements a "First Candle of the Day" breakout strategy with targets:
Strategy Logic:
Identifies the first hourly candle of each trading day
Calculates the high, low, and range (distance) of that candle
Draws four horizontal levels on the chart:
High level (red solid line)
Low level (green solid line)
Buy target (blue dashed): High + Daily Range
Sell target (purple dashed): Low - Daily Range
Generates signals when price breaks above/below these levels:
BUY signal: When price closes ABOVE the Buy target (High + Range)
SELL signal: When price closes BELOW the Sell target (Low - Range)
Visualizes all levels with labels showing exact price values
Key Features:
Uses 1-hour timeframe
Lines extend 500 bars forward from the first candle
Automatic cleanup and update of levels each new day
Includes alert conditions for automated trading notifications
Marks the first candle of each day with a blue label
Trading Approach:
Breakout long when price exceeds the first candle's high by its full daily range
Breakout short when price falls below the first candle's low by its full daily range
The strategy assumes the first candle's range establishes intraday volatility boundaries
Lunch Hour Stats 1200 to 1300 NYSilver Futures Lunch Hour Statistics - how much does the price of silver fluctuate between the beginning of New York Lunch hour at 12 to 1pm. How often is it moving up vs down, by how much, etc.
Fifty Two Week Highs and Lows Displays 52-week highs and lows with percentage distance context, optional dashboard, and visual connections between successive new highs for long-term range awareness.
Fifty Two Week Highs and Lows
This indicator provides clear, objective context around price location within its 52-week range. It is designed to help users quickly assess how extended or compressed price is relative to its long-term highs and lows, without generating trade signals or placing orders.
What the indicator does
Calculates 52-week highs and lows using one of two reference definitions:
Daily (252 bars): Rolling high and low over a configurable number of daily bars, best suited for Daily charts.
Weekly (52 weeks): True weekly 52-week high and low values projected onto the active chart timeframe.
Displays a compact dashboard showing:
Percent below the 52-week high
Percent above the 52-week low
Both values are color-coded to provide immediate visual context.
Optionally draws lines connecting successive new 52-week highs, making sequences of higher highs easier to observe.
Alerts
Optional indicator alerts are included for:
New 52-week highs (Daily or Weekly mode)
Price entering defined distance zones relative to the 52-week high or low
All alerts are evaluated on confirmed bar close.
How to use
Add the indicator to any chart and select the preferred 52-week reference mode.
Use the dashboard values as context, not signals, to understand where price sits within its long-term range.
Enable alerts if you want notifications when price reaches specific distance thresholds.
Notes
In Weekly mode, values are derived from higher-timeframe weekly data and projected onto the active chart.
This script is an indicator only and does not place trades.
Educational and informational use only.
GOLD QUANTUM MASTER🥇 GOLD QUANTUM MASTER 🥇
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
A high-performance technical analysis suite engineered for institutional-grade precision on Gold (XAUUSD) and Bitcoin (BTCUSD). This Core Edition focuses on raw analytical power without external API overhead.
🚀 KEY FEATURES:
• INSTITUTIONAL FOOTPRINT: Advanced volume-to-MA filters to identify "Big Money" participation.
• HTF REVERSAL SCANNER: Specialized logic for 30m, 1H, and 4H charts to detect Pinbar and Engulfing reversals.
• LIQUIDITY FLOW ANALYTICS: Detects and highlights Previous Day High (PDH) and Low (PDL) sweeps.
• TREND EXHAUSTION FILTERS: Built-in RSI divergence logic to prevent entries at trend peaks or bottoms.
• PREMIUM DATA LABELS: Real-time on-chart display of Signal Mode, Quality Score, and dynamic targets.
• NEON VISUAL SYSTEM: High-contrast, glassmorphic layout for maximum clarity during trading sessions.
BEST FOR: Technical Analysts, Manual Traders, and High-Performance Charting.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The best work on Higher time frames, I still not tested on lower time frames, but should be also precise.
Feel free to adjust the settings to your own needs.
Make your own decisions when you trade, do not put all confidence into a script, it may fail also.
Cumulative % Change & Inflation-Adjusted (Auto CPI by Currency)This indicator tracks an asset’s cumulative performance from a user-defined start date (T0) and compares nominal returns with inflation-adjusted (“real”) returns, automatically selecting the appropriate CPI series based on the asset currency (USD or EUR).
What it shows
Nominal cumulative return (%) from T0, based on the selected price series.
Inflation change (%) from T0, using a monthly CPI index:
USD assets: US CPI (FRED CPIAUCSL)
EUR assets: Euro Area CPI (TradingView Economics EUCPI)
Real cumulative return (%) from T0, i.e., nominal return deflated by cumulative CPI.
Key inputs
T0 (start date): Year / month / day used as the reference point.
Asset currency (USD/EUR): Drives automatic CPI selection.
Initial capital: Starting value expressed in the asset’s currency; used to display current nominal and real (inflation-adjusted) portfolio value.
Performance ticker (optional): Lets you compute performance using a different symbol than the chart (e.g., a total-return series or an accumulating ETF). If left empty, the script uses the chart’s symbol.
Outputs
Plots
Nominal cumulative % change
Real (inflation-adjusted) cumulative % change
CPI % change
Summary table
Nominal return %
Real return %
CPI change %
Reference date (T0)
Initial value
Current nominal value
Current inflation-adjusted value
Performance ticker used
Notes
CPI is monthly, so the inflation line updates in steps.
If you use a price series that does not include dividends (standard “close”), nominal/real returns may underestimate total return for dividend-paying assets.
Silver vs S&P 500 (Rebased to 100) I have ensured that silver prices and the s&p 500 price are overlayed to give the common folk an understanding. The important part is that the prices are rebased in nature. i.e. if they both started at 100 from an n year which in this case is 1992.
NY VWAP 2std to 3std Probabilities + Exit ZonesHow it works:
Time buckets
Early: 10:30 – 12:00
Mid: 12:00 – 14:00
Late: 14:00 – 16:00
Bands
2σ band (s2up / s2dn) → this is where the “potential breakout” starts.
3σ band (s3up / s3dn) → this is the “target” for the 2→3σ move.
Counting logic
If during a given bucket, the price touches the 2σ band, it counts as a 2σ hit.
If after that, in the same bucket, the price also touches the 3σ band, it counts as a 3σ hit.
Probability calculation
\text{Probability 2→3σ} = \frac{\text{# of 3σ hits}}{\text{# of 2σ hits}} \times 100
For example, if in the late session the lower 2σ band is hit 10 times, and of those 10 times, 6 eventually hit the lower 3σ band, the script will show 60%.
Labels / lines
On the chart, Upper/Lower 2→3σ probabilities are displayed per bucket.
So yes: “Late Lower 2σ → 3σ: 60%” means: if price touches the lower 2σ band in the late session, historically, 60% of those touches continued to the 3σ band.
⚠ Important caveats:
These are historical probabilities, not predictions.
Small sample sizes in a bucket can make percentages unstable early in the day.
The script only counts session NY bars (0930–1600) and ignores pre-10:30 hits to reduce opening volatility noise.






















