Volume-Price Shift Box (Lite Version)Description 
This indicator is a clean and intuitive visual tool designed to help traders quickly assess the current balance of bullish and bearish forces in the market.
It combines volume, price movement, VWAP, and OBV dynamics into a compact on-chart table that updates in real time.
This version focuses on the core logic and visualization of momentum and volume shifts, making it ideal for traders who want actionable insight without complex configuration.
 How It Works 
The script measures the combined strength of multiple market components:
 
 VWAP trend indicates price bias relative to fair value.
 OBV (On-Balance Volume) tracks volume flow to confirm or contradict price movement.
 Volume ratio compares current volume to its recent average.
 Momentum evaluates directional price movement over a configurable lookback period.
 Accumulation / Distribution (A/D) Line estimates buying or selling pressure within each candle:
↑ — A/D is rising (buying pressure is increasing)
↑↑ — A/D is rising faster than before (acceleration of buying)
↓ — A/D is falling (selling pressure is increasing)
↓↓ — A/D is falling faster than before (acceleration of selling)
 
Each of these components contributes to an overall shift score.
Depending on this score, the box displays:
🟢 Bullish Shift — strong upward alignment
🔴 Bearish Shift — downward alignment
⚪ Neutral — mixed or indecisive conditions
 Key Features 
 
 Compact on-chart information box with color-coded parameters
 Combined volume-price relationship model
 Configurable lookback and sensitivity controls
 Real-time shift strength and trend duration tracking
 Adjustable EMA/SMA smoothing for all averages
 Lightweight design optimized for clarity
 
 Inputs Overview 
 
 Box Position / Size – Place and scale the on-chart info box
 Lookback Period – Number of bars used for calculations
 VWAP Lookback – Period for VWAP distance smoothing
 Shift Sensitivity – Adjusts reaction strength of bullish/bearish shifts
 Neutral Zone Threshold – Defines when the market is considered neutral
 EMA or SMA – Choose exponential or simple moving averages
 Component Weights – Set the influence of VWAP, OBV, Volume, and Momentum on the shift score
 Display Toggles – Enable or disable metrics shown in the box (Strength, Volume, VWAP, Duration, OBV)
 
 How to Use 
 
 Apply the indicator to any symbol and timeframe.
 Observe the box on the chart — it updates dynamically.
 Look for transitions between Neutral → Bullish or Neutral → Bearish shifts.
 Combine with your existing price action or confirmation tools (e.g., support/resistance, trendlines).
 Use the “Strength” and “Duration” values to assess consistency and momentum quality.
 
 (This indicator is not a buy/sell signal generator — it is designed as a contextual analysis and confirmation tool.) 
 How It Helps 
 
 Merges several key volume and price metrics into a single view
 Highlights transitions in market control between buyers and sellers
 Reduces clutter by presenting only relevant context data
 Works on any market and timeframe, from scalping to swing trading
 
⚠️Disclaimer:
This script is provided for educational and informational purposes only. It is not financial advice and should not be considered a recommendation to buy, sell, or hold any financial instrument. Trading involves significant risk of loss and is not suitable for every investor. Users should perform their own due diligence and consult with a licensed financial advisor before making any trading decisions. The author does not guarantee any profits or results from using this script, and assumes no liability for any losses incurred. Use this script at your own risk.
Trendanalyisis
Reactive Curvature Smoother Moving Average IndicatorSummary in one paragraph
 RCS MA is a reactive curvature smoother for any liquid instrument on intraday through swing timeframes. It helps you act only when context strengthens by adapting its window length with a normalized path energy score and by smoothing with robust residual weights over a quadratic fit, then optionally blending a capped one step forecast. Add it to a clean chart and watch the single colored line. Shapes can shift while a bar forms and settle on close. For conservative use, judge on bar close.
 Scope and intent
 • Markets: major FX pairs, index futures, large cap equities, liquid crypto
• Timeframes: one minute to daily
• Purpose: reduce lag in trends while resisting chop and outliers
• Limits: indicator only, no orders
 
Originality and usefulness 
• Novelty: adaptive window selection by minimizing normalized path energy with directionality bias, plus Huber weighted residuals and curvature aware penalty, finished with a mintick capped forecast blend
• Failure modes addressed: whipsaws from fixed length MAs and outlier spikes that pull means
• Testable: Inputs expose all components and optional diagnostics show chosen length, directionality, and energy
• Portable yardstick: forecast cap uses mintick to stay symbol aware
 Method overview in plain language 
Base measures
• Range span of the tested window and a path energy defined as the sum of squared price increments, normalized by span
Components
Adaptive window chooser: scans L between Min and Max using an energy over trend score and picks the lowest score
Robust smoother: fits a quadratic to the last L bars, computes residuals, applies Huber weights and an exponential residual penalty scaled down when curvature is high
Forecast blend: projects one step ahead from the quadratic, caps displacement by a multiple of mintick, blends by user weight
Fusion rule
• Final line equals robust mean plus optional capped forecast blend
Signal rule
• Visual bias only: color turns lime when close is above the line, red otherwise
What you will see on the chart
• One colored line that tightens in trends and relaxes in chop
• Optional debug overlays for core value, chosen L, directionality, and energy
• Optional last bar label with L, directionality, and energy
• Reminder: drawings can move intrabar and settle on close
Inputs with guidance
Setup
• Source: price series to smooth
Logic
• Min window l_min. Typical 5 to 21. Higher increases stability, adds lag
• Max window l_max. Typical 40 to 128. Higher reduces noise, adds lag ceiling
• Length step grid_step. Typical 1 to 8. Smaller is finer and heavier
• Trend bias trend_bias. Typical 0.50 to 0.80. Higher favors trend persistence
• Residual penalty lambda_base. Typical 0.8 to 2.0. Higher downweights large residuals more
• Huber threshold huber_k. Typical 1.5 to 3.0. Higher admits more outliers
• Curvature guard curv_guard. Typical 0.3 to 1.0. Higher reduces influence when curve is tight
• Forecast blend lead_blend. 0 disables. Typical 0.10 to 0.40
• Forecast cap lead_limit. Typical 1 to 5 minticks
• Show chosen L and metrics show_debug. Diagnostics toggle
 Optional: enable diagnostics to see length, direction, and energy
 
 Realism and responsible publication 
• No performance claims. Past results never guarantee future outcomes
• Shapes can move while bars are open and settle on close
• Use on standard candles for analysis and combine with your own risk process
 Honest limitations and failure modes 
• Very quiet regimes can reduce energy contrast, length selection may hover near the bounds
• Gap heavy symbols can disrupt quadratic fit on the window edges
• Excessive forecast blend may look anticipatory; use low values and the cap
Buyer vs Seller Control CompanionBuyer vs Seller Control Companion (Overlay) 
 Crossover signal overlay based on candlestick wick analysis moving averages 
 Overview: 
This companion indicator displays crossover signals directly on the price chart based on the same buyer vs seller control calculations. It identifies moments when the relationship between buying and selling pressure shifts by analyzing where prices close relative to their intraday ranges.
 Calculation Method: 
The indicator uses identical calculations to the main Buyer vs Seller Control indicator:
 Visual Components: 
 
 Lime Triangle Up:  Appears below price bars when buyer control SMA crosses above seller control SMA
 Fuchsia Triangle Down:  Appears above price bars when seller control SMA crosses above buyer control SMA
 
 Signal Logic: 
 
Crossover events are detected when one moving average crosses above or below the other. These crossovers indicate potential shifts in the balance between buying and selling pressure as measured by candlestick closing positions relative to their wicks.
 
 Arrow Placement: 
 
 Upward Triangle:  Positioned below the bar when buyer control moving average exceeds seller control moving average
 Downward Triangle:  Positioned above the bar when seller control moving average exceeds buyer control moving average
 Size:  Small triangular shapes to avoid cluttering the price chart
 Timing:  Arrows appear only on bars where actual crossovers occur
 
 Settings: 
 
 Moving Average Period:  Adjustable from 1-200 periods (default: 20)
 
 Technical Notes: 
 
 This overlay version works on any timeframe
 Arrows only appear when crossovers actually occur, not on every bar
 The indicator uses the same mathematical foundation as the main oscillator version
 Signal frequency depends on the chosen moving average period
 Shorter periods generate more frequent crossovers, longer periods generate fewer
 
 Relationship to Main Indicator: 
 
This companion overlay displays the exact crossover points that can be observed in the main Buyer vs Seller Control indicator. It provides the same information but presents it directly on the price chart for convenient reference without switching between indicator panes.
 
 This overlay serves as a visual reference tool for crossover events detected in the underlying buyer vs seller control analysis.
Buyer vs Seller ControlBuyer vs Seller Control Analysis 
 Technical indicator measuring market participation through candlestick wick analysis 
 Overview: 
This indicator analyzes the relationship between closing prices and candlestick wicks to measure buying and selling pressure. It calculates two key metrics and displays their moving averages to help identify market sentiment shifts.
 Calculation Method: 
The indicator measures two distinct values for each candle:
 
 Buyer Control Value:  Distance from candle low to closing price  (close - low) 
 Seller Control Value:  Distance from candle high to closing price  (high - close) 
 
Both values are then smoothed using a Simple Moving Average (default period: 20) to reduce noise and show clearer trends.
 Visual Components: 
 
 Lime Line:  20-period SMA of buyer control values
 Fuchsia Line:  20-period SMA of seller control values
 Area Fill:  Colored region between the two lines
 Histogram:  Difference between buyer and seller control SMAs
 Zero Reference Line:  Horizontal line at zero level
 Information Table:  Current numerical values (optional display)
 
 Interpretation: 
 
When the lime line (buyer control) is above the fuchsia line (seller control), it indicates that recent candles have been closing closer to their highs than to their lows on average.
When the fuchsia line is above the lime line, recent candles have been closing closer to their lows than to their highs on average.
 
 Fill Color Logic: 
 
 Lime (green) fill appears when buyer control SMA > seller control SMA
 Fuchsia (red) fill appears when seller control SMA > buyer control SMA  
 Fill transparency adjusts based on the magnitude of difference between the two SMAs
 Stronger differences result in more opaque fills
 
 Settings: 
 
 Moving Average Period:  Adjustable from 1-200 periods (default: 20)
 Show Info Table:  Toggle to display/hide the numerical values table
 
 Technical Notes: 
 
 The indicator works on any timeframe
 Values are displayed in the same units as the underlying asset's price
 The histogram shows the mathematical difference between the two SMA lines
 Transparency calculation uses a 50-period lookback for dynamic scaling
 
 This indicator provides a quantitative approach to analyzing candlestick patterns by focusing on where prices close relative to their intraday ranges.
Markov 3D Trend AnalyzerMarkov 3D Trend Analyzer 
🔹 What Is a Markov State?
 A Markov chain models systems as states with probabilities of transitioning from one state to another. The key property is memorylessness: the next state depends only on the current state, not the full past history. In financial markets, this allows us to study how conditions tend to persist or flip — for example, whether a green candle is more likely to be followed by another green or by a red. 
 🔹 How This Indicator Uses It 
The Markov 3D Trend Analyzer tracks three independent Markov chains:
Direction Chain (short-term): Probability that a green/red candle continues or reverses.
Volatility Chain (mid-term): Probability of volatility staying Low/Medium/High or transitioning between them.
Momentum Chain (structural): Probability of momentum (Bullish, Neutral, Bearish) persisting or flipping.
Each chain is updated dynamically using exponentially weighted probabilities (EMA), which balance the law of large numbers (stability) with adaptivity to new market conditions.
The indicator then classifies each chain’s dominant state and combines them into an actionable summary at the bottom of the table (e.g. “📈 Bullish breakout,” “⚠️ Choppy bearish fakeouts,” “⏳ Trend squeeze / possible reversal”).
 🔹 Settings 
Direction Lookback / Volatility Lookback / Momentum Lookback
Control the rolling window length (sample size) for each chain. Larger = smoother but slower to adapt.
EMA Weight
Adjusts how much weight is given to recent transitions vs. older history. Lower values adapt faster, higher values stabilize.
Table Position
Choose where the table is displayed on your chart.
Table Size
Adjust the font size for readability.
 🔹 How To Consider Using 
Contextual tool: Use the summary row to understand the current market condition (trending, mean-reverting, expanding, compressing, continuation, fakeout risk).
Complementary filter: Combine with your existing strategies to confirm or filter signals. For example:
📈 If your breakout strategy fires and the summary says Bullish breakout, that’s confirmation.
⚠️ If it says Choppy fakeouts, be cautious of traps.
Visualization aid: The table lets you see how probabilities shift across direction, volatility, and momentum simultaneously.
⚠️ This indicator is not a signal generator. It is designed to help interpret market states probabilistically. Always use in conjunction with broader analysis and risk management.
 🔹 Disclaimer
This script is for educational and informational purposes only. It does not constitute financial advice or a recommendation to buy or sell any security, cryptocurrency, or instrument. Trading involves risk, and past probabilities or behaviors do not guarantee future outcomes. Always conduct your own research and use proper risk management.
Gott's Copernican Trend PredictorThe  Gott's Copernican Trend Predictor  predicts trend duration using the Copernican Principle - Based on astrophysicist Richard Gott's temporal prediction method.
I had the idea to create this indicator after reading the book The Doomsday Calculation by William Poundstone.
 Background & Theory 
This indicator implements J. Richard Gott III's Copernican Principle - a statistical method that famously predicted the fall of the Berlin Wall and the duration of Broadway shows with remarkable accuracy.
 The Copernican Principle Explained 
Named after Copernicus who showed that Earth is not at the center of the universe, this principle assumes that you are not observing something at a special moment in time. When you observe a trend at any random point, you're statistically more likely to be seeing it during the "middle portion" of its lifetime rather than at its very beginning or end.
 The Mathematics 
Gott's formula provides a 95% confidence interval for how much longer a trend will continue:
 Minimum remaining duration = Current Age ÷ 39
Maximum remaining duration = Current Age × 39 
The factor of 39 comes from statistical analysis where:
 
 There's only a 2.5% chance you're observing in the first 1/40th of the trend's life
 There's only a 2.5% chance you're observing in the last 1/40th of the trend's life
 
This gives us 95% confidence that the trend will last between Age/39 and Age×39
 How It Works 
Trend Detection
The indicator uses dual moving averages (default: 50 & 200 period) to identify trend changes:
 
 Bullish Cross: Fast MA crosses above Slow MA → Uptrend begins
 Bearish Cross: Fast MA crosses below Slow MA → Downtrend begins
 
Real-Time Predictions
Once a trend is detected, the indicator continuously calculates:
 
 Trend Age: How long the current trend has been active
 Gott's 95% CI: Statistical range for remaining trend duration
 Projected End Dates: Calendar dates when the trend might end
 
 How to Use 
Setup
 
 Add the indicator to any timeframe (works on minutes, hours, days, weeks)
 Customize MA periods and type (SMA, EMA, WMA)
 Choose table position and font size for optimal viewing
 
Interpretation
 
 Example: If a trend is 100 hours old:
 Minimum duration: 100 ÷ 39 = ~3 more hours
 Maximum duration: 100 × 39 = ~3,900 more hours
 95% confidence: The trend will end between these times
 
This indicator might be useful for swing traders, trend followers, and quantitative analysts. 
 Coca-Cola example: 
Coca-Cola's chart shows an uptrend spanning 810 weeks, approximately 15.5 years. According to Gott's Copernican Principle, this trend age generates a 95% confidence interval predicting the trend will continue for a minimum of 20 weeks and a maximum of 31,590 weeks.
On the other hand, a shorter trend age produces a proportionally smaller minimum duration and different risk profile in terms of statistical continuation probability. For this reason, more recent trends (and more recent companies) are likely to remain in trend for shorter. 
Trend CandlesTrend Candles
Overview
The Trend Candles indicator is a simple yet effective tool designed to help traders visually identify the prevailing market trend. By combining candle coloring with a trend-based Exponential Moving Average (EMA), it enhances chart readability and makes trend-following strategies easier to apply.
Concepts
Exponential Moving Average (EMA): The EMA is a moving average that places more weight on recent price data. It reacts faster to price changes compared to a Simple Moving Average (SMA), making it well-suited for trend detection.
Trend Determination:
- If the EMA is rising (current EMA > previous EMA), the market is considered bullish.
- If the EMA is falling (current EMA < previous EMA), the market is considered bearish.
- If the EMA is flat (no significant change), no trend color is applied.
Candle Coloring:
- Green candles = Uptrend
- Purple candles = Downtrend
- Default candles = Sideways/Flat EMA
Features
- Trend Visualization: Candles automatically change color based on EMA slope, making it easy to spot bullish and bearish phases.
- Customizable EMA Length: The trader can set the EMA period (default is 50), allowing flexibility for short-term or long-term trend analysis.
- Overlay EMA Line: An orange EMA line is plotted on the chart for additional confirmation of the trend.
- Clean & Minimalist: Focuses on trend clarity without cluttering the chart with unnecessary signals.
How to Use
1. Apply the indicator to your chart.
2. Adjust the EMA Length as per your trading style (shorter = faster signals, longer = smoother trend).
3. Follow the candle color:
- Green = Favor long entries.
- Purple = Favor short entries.
- No color = Stay cautious, as trend is unclear.
4. Use with other confirmation tools (support/resistance, volume, or oscillators).
5. Users are encouraged to experiment with different EMA lengths. The default length is 50, but you can explore other values based on your needs. In particular, try Fibonacci numbers such as 13, 21, 34, 55, 89, 144, and 233 to observe how trends behave differently.
Disclaimer
The information provided by the Trend Candles indicator is for educational purposes only. It should not be considered financial advice. Trading involves substantial risk, and past performance is not necessarily indicative of future results. Always do your own research and use risk management practices.
Lorentzian Key Support and Resistance Level Detector [mishy]🧮 Lorentzian Key S/R Levels Detector 
 Advanced Support & Resistance Detection Using Mathematical Clustering 
 The Problem 
Traditional S/R indicators fail because they're either subjective (manual lines), rigid (fixed pivots), or break when price spikes occur. Most importantly, they don't tell you where prices actually spend time, just where they touched briefly.
 The Solution: Lorentzian Distance Clustering 
This indicator introduces a  novel approach  by using  Lorentzian distance  instead of traditional Euclidean distance for clustering. This is groundbreaking for financial data analysis.
Data Points Clustering:   
 🔬 Why Euclidean Distance Fails in Trading 
 Traditional K-means uses Euclidean distance: 
•  Formula:   distance = (price_A - price_B)² 
•  Problem:  Squaring amplifies differences exponentially
•  Real impact:  One 5% price spike has 25x more influence than a 1% move
•  Result:  Clusters get pulled toward outliers, missing real support/resistance zones
 Example scenario: 
 Prices:   ← flash spike
Euclidean: Centroid gets dragged toward 150
Actual S/R zone: Around 100 (where prices actually trade) 
 ⚡ Lorentzian Distance: The Game Changer 
 Our approach uses Lorentzian distance: 
•  Formula:   distance = log(1 + (price_difference)² / σ²) 
•  Breakthrough:  Logarithmic compression keeps outliers in check
•  Real impact:  Large moves still matter, but don't dominate
•  Result:  Clusters focus on where prices actually spend time
 Same example with Lorentzian: 
 Prices:   ← flash spike
Lorentzian: Centroid stays near 100 (real trading zone)
Outlier (150): Acknowledged but not dominant 
 🧠 Adaptive Intelligence 
The  σ parameter  isn't fixed,it's calculated from market disturbance/entropy:
•  High volatility:  σ increases, making algorithm more tolerant of large moves
•  Low volatility:  σ decreases, making algorithm more sensitive to small changes
•  Self-calibrating:  Adapts to any instrument or market condition automatically
 Why this matters:  Traditional methods treat a 2% move the same whether it's in a calm or volatile market. Lorentzian adapts the sensitivity based on current market behavior.
 🎯 Automatic K-Selection (Elbow Method) 
Instead of guessing how many S/R levels to draw, the indicator:
• Tests 2-6 clusters and calculates WCSS (tightness measure)
• Finds the "elbow" - where adding more clusters stops helping much
• Uses sharpness calculation to pick the optimal number automatically
 Result:  Perfect balance between detail and clarity.
 How It Works 
1.  Collect  recent closing prices
2.  Calculate entropy  to adapt to current market volatility
3.  Cluster prices  using Lorentzian K-means algorithm
4.  Auto-select  optimal cluster count via statistical analysis
5.  Draw levels  at cluster centers with deviation bands
 📊 Manual K-Selection Guide (Using WCSS & Sharpness Analysis) 
When you disable auto-selection, use both  WCSS  and  Sharpness  metrics from the analysis table to choose manually:
 What WCSS tells you: 
• Lower WCSS = tighter clusters = better S/R levels
• Higher WCSS = scattered clusters = weaker levels
 What Sharpness tells you: 
• Higher positive values = optimal elbow point = best K choice
• Lower/negative values = poor elbow definition = avoid this K
• Measures the "sharpness" of the WCSS curve drop-off
 Decision strategy using both metrics: 
 K=2: WCSS = 150.42 | Sharpness = -     | Selected = 
K=3: WCSS = 89.15  | Sharpness = 22.04 | Selected = ✓ ← Best choice
K=4: WCSS = 76.23  | Sharpness = 1.89  | Selected = 
K=5: WCSS = 73.91  | Sharpness = 1.43  | Selected =  
 Quick decision rules: 
• Pick K with  highest positive Sharpness  (indicates optimal elbow)
• Confirm with  significant WCSS drop  (30%+ reduction is good)
• Avoid K values with negative or very low Sharpness (<1.0)
• K=3 above shows: Big WCSS drop (41%) + High Sharpness (22.04) = Perfect choice
 Why this works: 
The algorithm finds the "elbow" where adding more clusters stops being useful. High Sharpness pinpoints this elbow mathematically, while WCSS confirms the clustering quality.
Elbow Method Visualization:  
 Traditional clustering problems: 
❌ Price spikes distort results
❌ Fixed parameters don't adapt
❌ Manual tuning is subjective
❌ No way to validate choices
 Lorentzian solution: 
☑️ Outlier-resistant distance metric
☑️ Entropy-based adaptation to volatility
☑️ Automatic optimal K selection
☑️ Statistical validation via WCSS & Sharpness
 Features 
 Visual: 
• Color-coded levels (red=highest resistance, green=lowest support)
• Optional deviation bands showing cluster spread
•  Strength scores on labels:  Each cluster shows a reliability score.
• Higher scores (0.8+) = very strong S/R levels with tight price clustering
• Lower scores (0.6-0.7) = weaker levels, use with caution
• Based on cluster tightness and data point density
• Clean line extensions and labels
 Analytics: 
• WCSS analysis table showing why K was chosen
• Cluster metrics and statistics
• Real-time entropy monitoring
 Control: 
• Auto/manual K selection toggle
• Customizable sample size (20-500 bars)
• Show/hide bands and metrics tables
 The Result 
You get  mathematically validated S/R levels  that focus on where prices actually cluster, not where they randomly spiked. The algorithm adapts to market conditions and removes guesswork from level selection.
 Best for:  Traders who want objective, data-driven S/R levels without manual chart analysis.
 Credits:  This script is for educational purposes and is inspired by the work of @ThinkLogicAI and an amazing mentor @DskyzInvestments . It demonstrates how Lorentzian geometrical concepts can be applied not only in ML classification but also quite elegantly in clustering.
HMA Swing Levels [BigBeluga]An advanced swing structure and trend-following tool built on Hull Moving Average logic, designed to detect major reversals and track dynamic support/resistance zones. 
This indicator analyzes price swings using pivot highs/lows and a smoothed HMA trend baseline. It highlights key reversal levels and keeps them active until breached, giving traders a clear visual framework for price structure and trend alignment. The pivots are calculated in real-time using non-lagging logic, making them highly responsive to market conditions.
 🔵 CONCEPTS 
 
  Combines a fast-reacting  Hull Moving Average (HMA)  with pivot logic to capture precise directional changes.
  Detects  non-lagging reversal highs and lows  when pivot points form and the HMA direction flips.
  Projects these reversal levels forward as  horizontal support/resistance lines  until broken by price.
  Active trend is shown with a  step-style trail line  that reflects HMA bias over time.
 
 🔵 FEATURES 
 
   Swing Level Detection: 
Identifies high/low reversals when trend direction changes and plots horizontal zones.
  
Non-lagging logic of swing points detection:
 
if h  == high  and high < h and change > 0
    // Detected Swing High
if l  == low  and low > l and change < 0
    // Detected Swing Low
 
  
   Persistent Support & Resistance Lines: 
Each detected swing high or low is extended forward until price invalidates the level. Dotted style is applied once breached.
   Color-Coded Trend Trail: 
Displays a stepped trend trail using HMA slope: lime = uptrend, blue = downtrend.
  
   Automatic Labeling: 
Each reversal level is labeled with its price for clear reference.
  
   Age-Based Line Thickness: 
Every level increases in thickness every 250 bars. The longer the level lasts, the stronger it is.
  
 
 🔵 HOW TO USE 
 
  Use green (support) and blue (resistance) levels to frame key reaction zones.
  
  Trade with the trend defined by the trail color: lime for bullish bias, blue for bearish.
  Explore where buy or sell orders are stacked
  
  Look for breaks of swing lines to anticipate trend shifts or breakout setups.
  Adjust the  "Trend Change"  input to tune the sensitivity of swing detection.
  Adjust the  "SwingLevels"  input to define how far back to search for valid pivots.
 
 🔵 CONCLUSION 
 HMA Swing Levels   offers a hybrid approach to structural and trend-based trading. With automated  non-lagging  swing detection, persistent support/resistance tracking, and intuitive HMA-based trend coloring, it provides a powerful visual system for discretionary and systematic traders alike.
Trend Gauge [BullByte]Trend Gauge  
 Summary 
A multi-factor trend detection indicator that aggregates EMA alignment, VWMA momentum scaling, volume spikes, ATR breakout strength, higher-timeframe confirmation, ADX-based regime filtering, and RSI pivot-divergence penalty into one normalized trend score. It also provides a confidence meter, a Δ Score momentum histogram, divergence highlights, and a compact, scalable dashboard for at-a-glance status.
________________________________________
 ## 1. Purpose of the Indicator 
 Why this was built 
Traders often monitor several indicators in parallel - EMAs, volume signals, volatility breakouts, higher-timeframe trends, ADX readings, divergence alerts, etc., which can be cumbersome and sometimes contradictory. The  “Trend Gauge”  indicator was created to consolidate these complementary checks into a single, normalized score that reflects the prevailing market bias (bullish, bearish, or neutral) and its strength. By combining multiple inputs with an adaptive regime filter, scaling contributions by magnitude, and penalizing weakening signals (divergence), this tool aims to reduce noise, highlight genuine trend opportunities, and warn when momentum fades.
 Key Design Goals 
 Signal Aggregation 
Merged  trend-following signals  (EMA crossover, ATR breakout, higher-timeframe confirmation) and  momentum signals (VWMA thrust, volume spikes) into a unified score that reflects directional bias more holistically.
 Market Regime Awareness 
Implemented an ADX-style filter to distinguish between trending and ranging markets, reducing the influence of trend signals during sideways phases to avoid false breakouts.
 Magnitude-Based Scaling 
Replaced binary contributions with scaled inputs: VWMA thrust and ATR breakout are weighted relative to recent averages, allowing for more nuanced score adjustments based on signal strength.
 Momentum Divergence Penalty 
Integrated pivot-based RSI divergence detection to slightly reduce the overall score when early signs of momentum weakening are detected, improving risk-awareness in entries.
 Confidence Transparency 
Added a live confidence metric that shows what percentage of enabled sub-indicators currently agree with the overall bias, making the scoring system more interpretable.
 Momentum Acceleration Visualization 
Plotted the change in score (Δ Score) as a histogram bar-to-bar, highlighting whether momentum is increasing, flattening, or reversing, aiding in more timely decision-making.
 Compact Informational Dashboard 
Presented a clean, scalable dashboard that displays each component’s status, the final score, confidence %, detected regime (Trending/Ranging), and a labeled strength gauge for quick visual assessment.
________________________________________
 ## 2. Why a Trader Should Use It 
 Main benefits and use cases 
1.	 Unified View:  Rather than juggling multiple windows or panels, this indicator delivers a single score synthesizing diverse signals.
2.	 Regime Filtering:  In ranging markets, trend signals often generate false entries. The ADX-based regime filter automatically down-weights trend-following components, helping you avoid chasing false breakouts.
3.	 Nuanced Momentum & Volatility:  VWMA and ATR breakout contributions are normalized by recent averages, so strong moves register strongly while smaller fluctuations are de-emphasized.
4.	 Early Warning of Weakening:  Pivot-based RSI divergence is detected and used to slightly reduce the score when price/momentum diverges, giving a cautionary signal before a full reversal.
5.	 Confidence Meter:  See at a glance how many sub-indicators align with the aggregated bias (e.g.,  “80% confidence” means 4 out of 5 components agree ). This transparency avoids black-box decisions.
6.	 Trend Acceleration/Deceleration View:  The Δ Score histogram visualizes whether the aggregated score is rising (accelerating trend) or falling (momentum fading), supplementing the main oscillator.
7.	 Compact Dashboard:  A corner table lists each check’s status (“Bull”, “Bear”, “Flat” or “Disabled”), plus overall Score, Confidence %, Regime, Trend Strength label, and a gauge bar. Users can scale text size (Normal, Small, Tiny) without removing elements, so the full picture remains visible even in compact layouts.
8.	 Customizable & Transparent:  All components can be enabled/disabled and parameterized (lengths, thresholds, weights). The full Pine code is open and well-commented, letting users inspect or adapt the logic.
9.	 Alert-ready:  Built-in alert conditions fire when the score crosses weak thresholds to bullish/bearish or returns to neutral, enabling timely notifications.
________________________________________
 ## 3. Component Rationale (“Why These Specific Indicators?”) 
Each sub-component was chosen because it adds complementary information about trend or momentum:
1.	 EMA Cross 
o	Basic trend measure: compares a faster EMA vs. a slower EMA. Quickly reflects trend shifts but by itself can whipsaw in sideways markets.
2.	 VWMA Momentum 
o	Volume-weighted moving average change indicates momentum with volume context. By normalizing (dividing by a recent average absolute change), we capture the strength of momentum relative to recent history. This scaling prevents tiny moves from dominating and highlights genuinely strong momentum.
3.	 Volume Spikes 
o	Sudden jumps in volume combined with price movement often accompany stronger moves or reversals. A binary detection (+1 for bullish spike, -1 for bearish spike) flags high-conviction bars.
4.	 ATR Breakout 
o	Detects price breaking beyond recent highs/lows by a multiple of ATR. Measures breakout strength by how far beyond the threshold price moves relative to ATR, capped to avoid extreme outliers. This gives a volatility-contextual trend signal.
5.	 Higher-Timeframe EMA Alignment 
o	Confirms whether the shorter-term trend aligns with a higher timeframe trend. Uses request.security with lookahead_off to avoid future data. When multiple timeframes agree, confidence in direction increases.
6.	 ADX Regime Filter (Manual Calculation) 
o	Computes directional movement (+DM/–DM), smoothes via RMA, computes DI+ and DI–, then a DX and ADX-like value. If ADX ≥ threshold, market is “Trending” and trend components carry full weight; if ADX < threshold, “Ranging” mode applies a configurable weight multiplier (e.g., 0.5) to trend-based contributions, reducing false signals in sideways conditions. Volume spikes remain binary (optional behavior; can be adjusted if desired).
7.	 RSI Pivot-Divergence Penalty 
o	Uses ta.pivothigh / ta.pivotlow with a lookback to detect pivot highs/lows on price and corresponding RSI values. When price makes a higher high but RSI makes a lower high (bearish divergence), or price makes a lower low but RSI makes a higher low (bullish divergence), a divergence signal is set. Rather than flipping the trend outright, the indicator subtracts (or adds) a small penalty (configurable) from the aggregated score if it would weaken the current bias. This subtle adjustment warns of weakening momentum without overreacting to noise.
8.	 Confidence Meter 
o	Counts how many enabled components currently agree in direction with the aggregated score (i.e., component sign × score sign > 0). Displays this as a percentage. A high percentage indicates strong corroboration; a low percentage warns of mixed signals.
9.	 Δ Score Momentum View 
o	Plots the bar-to-bar change in the aggregated score (delta_score = score - score ) as a histogram. When positive, bars are drawn in green above zero; when negative, bars are drawn in red below zero. This reveals acceleration (rising Δ) or deceleration (falling Δ), supplementing the main oscillator.
10.	 Dashboard 
•	A table in the indicator pane’s top-right with 11 rows:
1.	EMA Cross status
2.	VWMA Momentum status
3.	Volume Spike status
4.	ATR Breakout status
5.	Higher-Timeframe Trend status
6.	Score (numeric)
7.	Confidence %
8.	Regime (“Trending” or “Ranging”)
9.	Trend Strength label (e.g., “Weak Bullish Trend”, “Strong Bearish Trend”)
10.	Gauge bar visually representing score magnitude
•	All rows always present; size_opt (Normal, Small, Tiny) only changes text size via text_size, not which elements appear. This ensures full transparency.
________________________________________
 ## 4. What Makes This Indicator Stand Out 
•	 Regime-Weighted Multi-Factor Score:  Trend and momentum signals are adaptively weighted by market regime  (trending vs. ranging) , reducing false signals.
•	 Magnitude Scaling:  VWMA and ATR breakout contributions are normalized by recent average momentum or ATR, giving finer gradation compared to simple ±1.
•	 Integrated Divergence Penalty:  Divergence directly adjusts the aggregated score rather than appearing as a separate subplot; this influences alerts and trend labeling in real time.
•	 Confidence Meter:  Shows the percentage of sub-signals in agreement, providing transparency and preventing blind trust in a single metric.
•	 Δ Score Histogram Momentum View:  A histogram highlights acceleration or deceleration of the aggregated trend score, helping detect shifts early.
•	 Flexible Dashboard:  Always-visible component statuses and summary metrics in one place; text size scaling keeps the full picture available in cramped layouts.
•	 Lookahead-Safe HTF Confirmation:  Uses lookahead_off so no future data is accessed from higher timeframes, avoiding repaint bias.
•	 Repaint Transparency:  Divergence detection uses pivot functions that inherently confirm only after lookback bars; description documents this lag so users understand how and when divergence labels appear.
•	 Open-Source & Educational:  Full, well-commented Pine v6 code is provided; users can learn from its structure: manual ADX computation, conditional plotting with series = show ? value : na, efficient use of table.new in barstate.islast, and grouped inputs with tooltips.
•	 Compliance-Conscious:  All plots have descriptive titles; inputs use clear names; no unnamed generic “Plot” entries; manual ADX uses RMA; all request.security calls use lookahead_off. Code comments mention repaint behavior and limitations.
________________________________________
 ## 5. Recommended Timeframes & Tuning 
•	 Any Timeframe:  The indicator works on small (e.g., 1m) to large (daily, weekly) timeframes. However:
o	On very low timeframes (<1m or tick charts), noise may produce frequent whipsaws. Consider increasing smoothing lengths, disabling certain components (e.g., volume spike if volume data noisy), or using a larger pivot lookback for divergence.
o	On higher timeframes (daily, weekly), consider longer lookbacks for ATR breakout or divergence, and set Higher-Timeframe trend appropriately (e.g., 4H HTF when on 5 Min chart).
•	 Defaults & Experimentation:  Default input values are chosen to be balanced for many liquid markets. Users should test with replay or historical analysis on their symbol/timeframe and adjust:
o	ADX threshold (e.g., 20–30) based on instrument volatility.
o	VWMA and ATR scaling lengths to match average volatility cycles.
o	Pivot lookback for divergence: shorter for faster markets, longer for slower ones.
•	 Combining with Other Analysis:  Use in conjunction with price action, support/resistance, candlestick patterns, order flow, or other tools as desired. The aggregated score and alerts can guide attention but should not be the sole decision-factor.
________________________________________
 ## 6. How Scoring and Logic Works (Step-by-Step) 
1.	 Compute Sub-Scores 
o	 EMA Cross:  Evaluate fast EMA > slow EMA ? +1 : fast EMA < slow EMA ? -1 : 0.
o	 VWMA Momentum:  Calculate vwma = ta.vwma(close, length), then vwma_mom = vwma - vwma . Normalize: divide by recent average absolute momentum (e.g., ta.sma(abs(vwma_mom), lookback)), clip to  .
o	 Volume Spike:  Compute vol_SMA = ta.sma(volume, len). If volume > vol_SMA * multiplier AND price moved up ≥ threshold%, assign +1; if moved down ≥ threshold%, assign -1; else 0.
o	 ATR Breakout:  Determine recent high/low over lookback. If close > high + ATR*mult, compute distance = close - (high + ATR*mult), normalize by ATR, cap at a configured maximum. Assign positive contribution. Similarly for bearish breakout below low.
o	 Higher-Timeframe Trend:  Use request.security(..., lookahead=barmerge.lookahead_off) to fetch HTF EMAs; assign +1 or -1 based on alignment.
2.	 ADX Regime Weighting 
o	Compute manual ADX: directional movements (+DM, –DM), smoothed via RMA, DI+ and DI–, then DX and ADX via RMA. If ADX ≥ threshold, market is considered “Trending”; otherwise “Ranging.”
o	If trending, trend-based contributions (EMA, VWMA, ATR, HTF) use full weight = 1.0. If ranging, use weight = ranging_weight (e.g., 0.5) to down-weight them. Volume spike stays binary ±1 (optional to change if desired).
3.	 Aggregate Raw Score 
o	Sum weighted contributions of all enabled components. Count the number of enabled components; if zero, default count = 1 to avoid division by zero.
4.	 Divergence Penalty 
o	Detect pivot highs/lows on price and corresponding RSI values, using a lookback. When price and RSI diverge (bearish or bullish divergence), check if current raw score is in the opposing direction:
	If  bearish divergence  (price higher high, RSI lower high) and raw score currently positive, subtract a penalty (e.g., 0.5).
	If  bullish divergence  (price lower low, RSI higher low) and raw score currently negative, add a penalty.
o	This reduces score magnitude to reflect weakening momentum, without flipping the trend outright.
5.	 Normalize and Smooth 
o	Normalized score = (raw_score / number_of_enabled_components) * 100. This yields a roughly   range.
o	Optional EMA smoothing of this normalized score to reduce noise.
6.	 Interpretation 
o	Sign: >0 = net bullish bias; <0 = net bearish bias; near zero = neutral.
o	Magnitude Zones: Compare |score| to thresholds (Weak, Medium, Strong) to label trend strength (e.g., “Weak Bullish Trend”, “Medium Bearish Trend”, “Strong Bullish Trend”).
o	Δ Score Histogram: The histogram bars from zero show change from previous bar’s score; positive bars indicate acceleration, negative bars indicate deceleration.
o	Confidence: Percentage of sub-indicators aligned with the score’s sign.
o	Regime: Indicates whether trend-based signals are fully weighted or down-weighted.
________________________________________
 ## 7. Oscillator Plot & Visualization: How to Read It 
 Main Score Line & Area 
The oscillator plots the aggregated score as a line, with colored fill: green above zero for bullish area, red below zero for bearish area. Horizontal reference lines at ±Weak, ±Medium, and ±Strong thresholds mark zones: crossing above +Weak suggests beginning of bullish bias, above +Medium for moderate strength, above +Strong for strong trend; similarly for bearish below negative thresholds.
 Δ Score Histogram 
If enabled, a histogram shows score - score . When positive, bars appear in green above zero, indicating accelerating bullish momentum; when negative, bars appear in red below zero, indicating decelerating or reversing momentum. The height of each bar reflects the magnitude of change in the aggregated score from the prior bar.
 Divergence Highlight Fill 
If enabled, when a pivot-based divergence is confirmed:
•	 Bullish Divergence : fill the area below zero down to –Weak threshold in green, signaling potential reversal from bearish to bullish.
•	 Bearish Divergence : fill the area above zero up to +Weak threshold in red, signaling potential reversal from bullish to bearish.
These fills appear with a lag equal to pivot lookback (the number of bars needed to confirm the pivot). They do not repaint after confirmation, but users must understand this lag.
 Trend Direction Label 
When score crosses above or below the Weak threshold, a small label appears near the score line reading “Bullish” or “Bearish.” If the score returns within ±Weak, the label “Neutral” appears. This helps quickly identify shifts at the moment they occur.
 Dashboard Panel 
In the indicator pane’s top-right, a table shows:
1.	EMA Cross status: “Bull”, “Bear”, “Flat”, or “Disabled”
2.	VWMA Momentum status: similarly
3.	Volume Spike status: “Bull”, “Bear”, “No”, or “Disabled”
4.	ATR Breakout status: “Bull”, “Bear”, “No”, or “Disabled”
5.	Higher-Timeframe Trend status: “Bull”, “Bear”, “Flat”, or “Disabled”
6.	Score: numeric value (rounded)
7.	Confidence: e.g., “80%” (colored: green for high, amber for medium, red for low)
8.	Regime: “Trending” or “Ranging” (colored accordingly)
9.	Trend Strength: textual label based on magnitude (e.g., “Medium Bullish Trend”)
10.	Gauge: a bar of blocks representing |score|/100
All rows remain visible at all times; changing Dashboard Size only scales text size (Normal, Small, Tiny).
________________________________________
 ## 8. Example Usage (Illustrative Scenario) 
 Example: BTCUSD 5 Min 
1.	 Setup:  Add “Trend Gauge  ” to your BTCUSD 5 Min chart. Defaults: EMAs (8/21), VWMA 14 with lookback 3, volume spike settings, ATR breakout 14/5, HTF = 5m (or adjust to 4H if preferred), ADX threshold 25, ranging weight 0.5, divergence RSI length 14 pivot lookback 5, penalty 0.5, smoothing length 3, thresholds Weak=20, Medium=50, Strong=80. Dashboard Size = Small.
2.	 Trend Onset:  At some point, price breaks above recent high by ATR multiple, volume spikes upward, faster EMA crosses above slower EMA, HTF EMA also bullish, and ADX (manual) ≥ threshold → aggregated score rises above +20 (Weak threshold) into +Medium zone. Dashboard shows “Bull” for EMA, VWMA, Vol Spike, ATR, HTF; Score ~+60–+70; Confidence ~100%; Regime “Trending”; Trend Strength “Medium Bullish Trend”; Gauge ~6–7 blocks. Δ Score histogram bars are green and rising, indicating accelerating bullish momentum. Trader notes the alignment.
3.	 Divergence Warning:  Later, price makes a slightly higher high but RSI fails to confirm (lower RSI high). Pivot lookback completes; the indicator highlights a bearish divergence fill above zero and subtracts a small penalty from the score, causing score to stall or retrace slightly. Dashboard still bullish but score dips toward +Weak. This warns the trader to tighten stops or take partial profits.
4.	 Trend Weakens:  Score eventually crosses below +Weak back into neutral; a “Neutral” label appears, and a “Neutral Trend” alert fires if enabled. Trader exits or avoids new long entries. If score subsequently crosses below –Weak, a “Bearish” label and alert occur.
5.	 Customization:  If the trader finds VWMA noise too frequent on this instrument, they may disable VWMA or increase lookback. If ATR breakouts are too rare, adjust ATR length or multiplier. If ADX threshold seems off, tune threshold. All these adjustments are explained in Inputs section.
6.	 Visualization:  The screenshot shows the main score oscillator with colored areas, reference lines at ±20/50/80, Δ Score histogram bars below/above zero, divergence fill highlighting potential reversal, and the dashboard table in the top-right.
  
  
________________________________________
 ## 9. Inputs Explanation 
A concise yet clear summary of inputs helps users understand and adjust:
 1. General Settings 
•	 Theme (Dark/Light):  Choose background-appropriate colors for the indicator pane.
•	 Dashboard Size (Normal/Small/Tiny):  Scales text size only; all dashboard elements remain visible.
 2. Indicator Settings 
•	 Enable EMA Cross:  Toggle on/off basic EMA alignment check.
o	Fast EMA Length and Slow EMA Length: Periods for EMAs.
•	 Enable VWMA Momentum:  Toggle VWMA momentum check.
o	VWMA Length: Period for VWMA.
o	VWMA Momentum Lookback: Bars to compare VWMA to measure momentum.
•	 Enable Volume Spike:  Toggle volume spike detection.
o	Volume SMA Length: Period to compute average volume.
o	Volume Spike Multiplier: How many times above average volume qualifies as spike.
o	Min Price Move (%): Minimum percent change in price during spike to qualify as bullish or bearish.
•	 Enable ATR Breakout:  Toggle ATR breakout detection.
o	ATR Length: Period for ATR.
o	Breakout Lookback: Bars to look back for recent highs/lows.
o	ATR Multiplier: Multiplier for breakout threshold.
•	 Enable Higher Timeframe Trend:  Toggle HTF EMA alignment.
o	Higher Timeframe: E.g., “5” for 5-minute when on 1-minute chart, or “60” for 5 Min when on 15m, etc. Uses lookahead_off.
•	 Enable ADX Regime Filter:  Toggles regime-based weighting.
o	ADX Length: Period for manual ADX calculation.
o	ADX Threshold: Value above which market considered trending.
o	Ranging Weight Multiplier: Weight applied to trend components when ADX < threshold (e.g., 0.5).
•	 Scale VWMA Momentum:  Toggle normalization of VWMA momentum magnitude.
o	VWMA Mom Scale Lookback: Period for average absolute VWMA momentum.
•	 Scale ATR Breakout Strength:  Toggle normalization of breakout distance by ATR.
o	ATR Scale Cap: Maximum multiple of ATR used for breakout strength.
•	 Enable Price-RSI Divergence:  Toggle divergence detection.
o	RSI Length for Divergence: Period for RSI.
o	Pivot Lookback for Divergence: Bars on each side to identify pivot high/low.
o	Divergence Penalty: Amount to subtract/add to score when divergence detected (e.g., 0.5).
 3. Score Settings 
•	 Smooth Score:  Toggle EMA smoothing of normalized score.
•	 Score Smoothing Length:  Period for smoothing EMA.
•	 Weak Threshold:  Absolute score value under which trend is considered weak or neutral.
•	 Medium Threshold:  Score above Weak but below Medium is moderate.
•	 Strong Threshold:  Score above this indicates strong trend.
 4. Visualization Settings 
•	 Show Δ Score Histogram:  Toggle display of the bar-to-bar change in score as a histogram. Default true.
•	 Show Divergence Fill:  Toggle background fill highlighting confirmed divergences. Default true.
Each input has a tooltip in the code.
________________________________________
 ## 10. Limitations, Repaint Notes, and Disclaimers 
 10.1. Repaint & Lag Considerations 
•	 Pivot-Based Divergence Lag:  The divergence detection uses ta.pivothigh / ta.pivotlow with a specified lookback. By design, a pivot is only confirmed after the lookback number of bars. As a result:
o	Divergence labels or fills appear with a delay equal to the pivot lookback.
o	Once the pivot is confirmed and the divergence is detected, the fill/label does not repaint thereafter, but you must understand and accept this lag.
o	Users should not treat divergence highlights as predictive signals without additional confirmation, because they appear after the pivot has fully formed.
•	 Higher-Timeframe EMA Alignment:  Uses request.security(..., lookahead=barmerge.lookahead_off), so no future data from the higher timeframe is used. This avoids lookahead bias and ensures signals are based only on completed higher-timeframe bars.
•	 No Future Data:  All calculations are designed to avoid using future information. For example, manual ADX uses RMA on past data; security calls use lookahead_off.
 10.2. Market & Noise Considerations 
•	In very choppy or low-liquidity markets, some components (e.g., volume spikes or VWMA momentum) may be noisy. Users can disable or adjust those components’ parameters.
•	On extremely low timeframes, noise may dominate; consider smoothing lengths or disabling certain features.
•	On very high timeframes, pivots and breakouts occur less frequently; adjust lookbacks accordingly to avoid sparse signals.
 10.3. Not a Standalone Trading System 
•	This is an indicator, not a complete trading strategy. It provides signals and context but does not manage entries, exits, position sizing, or risk management.
•	Users must combine it with their own analysis, money management, and confirmations (e.g., price patterns, support/resistance, fundamental context).
•	No guarantees: past behavior does not guarantee future performance.
 10.4. Disclaimers 
•	 Educational Purposes Only:  The script is provided as-is for educational and informational purposes. It does not constitute financial, investment, or trading advice.
•	 Use at Your Own Risk:  Trading involves risk of loss. Users should thoroughly test and use proper risk management.
•	 No Guarantees:  The author   is not responsible for trading outcomes based on this indicator.
•	 License:  Published under Mozilla Public License 2.0; code is open for viewing and modification under MPL terms.
________________________________________
 ## 11. Alerts 
•	The indicator defines three alert conditions:
1.	 Bullish Trend:  when the aggregated score crosses above the Weak threshold.
2.	 Bearish Trend:  when the score crosses below the negative Weak threshold.
3.	 Neutral Trend:  when the score returns within ±Weak after being outside.
Good luck
– BullByte
Volatility Quality [Alpha Extract]The Alpha-Extract Volatility Quality (AVQ) Indicator provides traders with deep insights into market volatility by measuring the directional strength of price movements. This sophisticated momentum-based tool helps identify overbought and oversold conditions, offering actionable buy and sell signals based on volatility trends and standard deviation bands.
🔶 CALCULATION
The indicator processes volatility quality data through a series of analytical steps:
 
 Bar Range Calculation: Measures true range (TR) to capture price volatility.
 Directional Weighting: Applies directional bias (positive for bullish candles, negative for bearish) to the true range.
 VQI Computation: Uses an exponential moving average (EMA) of weighted volatility to derive the Volatility Quality Index (VQI).
 vqiRaw = ta.ema(weightedVol, vqiLen)
 
 Smoothing: Applies an additional EMA to smooth the VQI for clearer signals.
 Normalization: Optionally normalizes VQI to a -100/+100 scale based on historical highs and lows.
 Standard Deviation Bands: Calculates three upper and lower bands using standard deviation multipliers for volatility thresholds.
 vqiStdev = ta.stdev(vqiSmoothed, vqiLen)
upperBand1 = vqiSmoothed + (vqiStdev * stdevMultiplier1)
upperBand2 = vqiSmoothed + (vqiStdev * stdevMultiplier2)
upperBand3 = vqiSmoothed + (vqiStdev * stdevMultiplier3)
lowerBand1 = vqiSmoothed - (vqiStdev * stdevMultiplier1)
lowerBand2 = vqiSmoothed - (vqiStdev * stdevMultiplier2)
lowerBand3 = vqiSmoothed - (vqiStdev * stdevMultiplier3) 
 Signal Generation: Produces overbought/oversold signals when VQI reaches extreme levels (±200 in normalized mode).
 Formula:
 Bar Range = True Range (TR)
 Weighted Volatility = Bar Range × (Close > Open ? 1 : Close < Open ? -1 : 0)
 VQI Raw = EMA(Weighted Volatility, VQI Length)
 VQI Smoothed = EMA(VQI Raw, Smoothing Length)
 VQI Normalized = ((VQI Smoothed - Lowest VQI) / (Highest VQI - Lowest VQI) - 0.5) × 200
 Upper Band N = VQI Smoothed + (StdDev(VQI Smoothed, VQI Length) × Multiplier N)
 Lower Band N = VQI Smoothed - (StdDev(VQI Smoothed, VQI Length) × Multiplier N)
 
🔶 DETAILS
 Visual Features:
 
 VQI Plot: Displays VQI as a line or histogram (lime for positive, red for negative).
 Standard Deviation Bands: Plots three upper and lower bands (teal for upper, grayscale for lower) to indicate volatility thresholds.
 Reference Levels: Horizontal lines at 0 (neutral), +100, and -100 (in normalized mode) for context.
 Zone Highlighting: Overbought (⋎ above bars) and oversold (⋏ below bars) signals for extreme VQI levels (±200 in normalized mode).
 Candle Coloring: Optional candle overlay colored by VQI direction (lime for positive, red for negative).
 
Interpretation:
 
 VQI ≥ 200 (Normalized): Overbought condition, strong sell signal.
 VQI 100–200: High volatility, potential selling opportunity.
 VQI 0–100: Neutral bullish momentum.
 VQI 0 to -100: Neutral bearish momentum.
 VQI -100 to -200: High volatility, strong bearish momentum.
 VQI ≤ -200 (Normalized): Oversold condition, strong buy signal.
 
🔶 EXAMPLES
 
 Overbought Signal Detection: When VQI exceeds 200 (normalized), the indicator flags potential market tops with a red ⋎ symbol.
  Example: During strong uptrends, VQI reaching 200 has historically preceded corrections, allowing traders to secure profits.
 Oversold Signal Detection: When VQI falls below -200 (normalized), a lime ⋏ symbol highlights potential buying opportunities.
  Example: In bearish markets, VQI dropping below -200 has marked reversal points for profitable long entries.
 Volatility Trend Tracking: The VQI plot and bands help traders visualize shifts in market momentum.
  Example: A rising VQI crossing above zero with widening bands indicates strengthening bullish momentum, guiding traders to hold or enter long positions.
 Dynamic Support/Resistance: Standard deviation bands act as dynamic volatility thresholds during price movements.
  Example: Price reversals often occur near the third standard deviation bands, providing reliable entry/exit points during volatile periods.
 
🔶 SETTINGS
 Customization Options:
 
 VQI Length: Adjust the EMA period for VQI calculation (default: 14, range: 1–50).
 Smoothing Length: Set the EMA period for smoothing (default: 5, range: 1–50).
 Standard Deviation Multipliers: Customize multipliers for bands (defaults: 1.0, 2.0, 3.0).
 Normalization: Toggle normalization to -100/+100 scale and adjust lookback period (default: 200, min: 50).
 Display Style: Switch between line or histogram plot for VQI.
 Candle Overlay: Enable/disable VQI-colored candles (lime for positive, red for negative).
 
The Alpha-Extract Volatility Quality Indicator empowers traders with a robust tool to navigate market volatility. By combining directional price range analysis with smoothed volatility metrics, it identifies overbought and oversold conditions, offering clear buy and sell signals. The customizable standard deviation bands and optional normalization provide precise context for market conditions, enabling traders to make informed decisions across various market cycles.
Approximate Entropy Zones [PhenLabs]Version:  PineScript™ v6
 Description 
This indicator identifies periods of market complexity and randomness by calculating the Approximate Entropy (ApEn) of price action. As the movement of the market becomes complex, it means the current trend is losing steam and a reversal or consolidation is likely near. The indicator plots high-entropy periods as zones on your chart, providing a graphical suggestion to anticipate a potential market direction change. This indicator is designed to help traders identify favorable times to get in or out of a trade by highlighting when the market is in a state of disarray.
 Points of Innovation
 
  Advanced Complexity Analysis: Instead of relying on traditional momentum or trend indicators, this tool uses Approximate Entropy to quantify the unpredictability of price movements.
  Dynamic Zone Creation: It automatically plots zones on the chart during periods of high entropy, providing a clear and intuitive visual guide.
  Customizable Sensitivity: Users can fine-tune the ‘Entropy Threshold’ to adjust how frequently zones appear, allowing for calibration to different assets and timeframes.
  Time-Based Zone Expiration: Zones can be set to expire after a specific time, keeping the chart clean and relevant.
  Built-in Zone Size Filter: Excludes zones that form on excessively large candles, filtering out noise from extreme volatility events.
  On-Chart Calibration Guide: A persistent note on the chart provides simple instructions for adjusting the entropy threshold, making it easy for users to optimize the indicator’s performance.
 
 Core Components 
 
  Approximate Entropy (ApEn) Calculation: The core of the indicator, which measures the complexity or randomness of the price data.
  Zone Plotting: Creates visual boxes on the chart when the calculated ApEn value exceeds a user-defined threshold.
  Dynamic Zone Management: Manages the lifecycle of the zones, from creation to expiration, ensuring the chart remains uncluttered.
  Customizable Settings: A comprehensive set of inputs that allow users to control the indicator’s sensitivity, appearance, and time-based behavior.
 
 Key Features
 
  Identifies Potential Reversals: The high-entropy zones can signal that a trend is nearing its end, giving traders an early warning.
  Works on Any Timeframe: The indicator can be applied to any chart timeframe, from minutes to days.
  Customizable Appearance: Users can change the color and transparency of the zones to match their chart’s theme.
  Informative Labels: Each zone can display the calculated entropy value and the direction of the candle on which it formed.
 
 Visualization
 
  Entropy Zones: Shaded boxes that appear on the chart, highlighting candles with high complexity.
  Zone Labels: Text within each zone that displays the ApEn value and a directional arrow (e.g., “0.525 ↑”).
  Calibration Note: A small table in the top-right corner of the chart with instructions for adjusting the indicator’s sensitivity.
 
 Usage Guidelines
 
 Entropy Analysis
 
  Source: The price data used for the ApEn calculation. (Default: close)
  Lookback Length: The number of bars used in the ApEn calculation. (Default: 20, Range: 10-50)
  Embedding Dimension (m): The length of patterns to be compared; a standard value for financial data. (Default: 2)
  Tolerance Multiplier (r): Adjusts the tolerance for pattern matching; a larger value makes matching more lenient. (Default: 0.2)
  Entropy Threshold: The ApEn value that must be exceeded to plot a zone. Increase this if too many zones appear; decrease it if too few appear. (Default: 0.525)
 
 Time Settings
 
  Analysis Timeframe: How long a zone remains on the chart after it forms. (Default: 1D)
  Custom Period (Bars): The zone’s lifespan in bars if “Analysis Timeframe” is set to “Custom”. (Default: 1000)
 
 Zone Settings
 
  Zone Fill Color: The color of the entropy zones. (Default: #21f38a with 80% transparency)
  Maximum Zone Size %: Filters out zones on candles that are larger than this percentage of their low price. (Default: 0.5)
 
 Display Options
 
  Show Entropy Label: Toggles the visibility of the text label inside each zone. (Default: true)
  Label Text Position: The horizontal alignment of the text label. (Default: Right)
  Show Calibration Note: Toggles the visibility of the calibration note in the corner of the chart. (Default: true)
 
 Best Use Cases
 
  Trend Reversal Trading: Identifying when a strong trend is likely to reverse or pause.
  Breakout Confirmation: Using the absence of high entropy to confirm the strength of a breakout.
  Ranging Market Identification: Periods of high entropy can indicate that a market is transitioning into a sideways or choppy phase.
 
 Limitations
 
  Not a Standalone Signal: This indicator should be used in conjunction with other forms of analysis to confirm trading signals.
  Lagging Nature: Like all indicators based on historical data, ApEn is a lagging measure and does not predict future price movements with certainty.
  Calibration Required: The effectiveness of the indicator is highly dependent on the “Entropy Threshold” setting, which needs to be adjusted for different assets and timeframes.
 
 What Makes This Unique
 
  Quantifies Complexity: It provides a numerical measure of market complexity, offering a different perspective than traditional indicators.
  Clear Visual Cues: The zones make it easy to see when the market is in a state of high unpredictability.
  User-Friendly Design: With features like the on-chart calibration note, the indicator is designed to be easy to use and optimize.
 
 How It Works
 
  Calculate Standard Deviation: The indicator first calculates the standard deviation of the source price data over a specified lookback period.
  Calculate Phi: It then calculates a value called “phi” for two different pattern lengths (embedding dimensions ‘m’ and ‘m+1’). This involves comparing sequences of data points to see how many are “similar” within a certain tolerance (determined by the standard deviation and the ‘r’ multiplier).
  Calculate ApEn: The Approximate Entropy is the difference between the two phi values. A higher ApEn value indicates greater irregularity and unpredictability in the data.
  Plot Zones: If the calculated ApEn exceeds the user-defined ‘Entropy Threshold’, a zone is plotted on the chart.
 
 Note: The “Entropy Threshold” is the most important setting to adjust. If you see too many zones, increase the threshold. If you see too few, decrease it.
Market Zone Analyzer[BullByte]Understanding the Market Zone Analyzer 
---
 1. Purpose of the Indicator 
The  Market Zone Analyzer  is a Pine Script™ (version 6) indicator designed to streamline market analysis on TradingView. Rather than scanning multiple separate tools, it unifies four core dimensions—trend strength, momentum, price action, and market activity—into a single, consolidated view. By doing so, it helps traders:
•  Save time  by avoiding manual cross-referencing of disparate signals.
•  Reduce decision-making errors  that can arise from juggling multiple indicators.
•  Gain a clear, reliable read  on whether the market is in a bullish, bearish, or sideways phase, so they can more confidently decide to enter, exit, or hold a position.
---
 2. Why a Trader Should Use It 
•  Unified View:  Combines all essential market dimensions into one easy-to-read score and dashboard, eliminating the need to piece together signals manually.
•  Adaptability:  Automatically adjusts its internal weighting for trend, momentum, and price action based on current volatility. Whether markets are choppy or calm, the indicator remains relevant.
•  Ease of Interpretation:  Outputs a simple “BULLISH,” “BEARISH,” or “SIDEWAYS” label, supplemented by an intuitive on-chart dashboard and an oscillator plot that visually highlights market direction.
•  Reliability Features:  Built-in smoothing of the net score and hysteresis logic (requiring consecutive confirmations before flips) minimize false signals during noisy or range-bound phases.
---
 3. Why These Specific Indicators? 
This script relies on a curated set of well-established technical tools, each chosen for its particular strength in measuring one of the four core dimensions:
 1. Trend Strength: 
•  ADX/DMI (Average Directional Index / Directional Movement Index):  Measures how strong a trend is, and whether the +DI line is above the –DI line (bullish) or vice versa (bearish).
•  Moving Average Slope (Fast MA vs. Slow MA):  Compares a shorter-period SMA to a longer-period SMA; if the fast MA sits above the slow MA, it confirms an uptrend, and vice versa for a downtrend.
•  Ichimoku Cloud Differential (Senkou A vs. Senkou B):  Provides a forward-looking view of trend direction; Senkou A above Senkou B signals bullishness, and the opposite signals bearishness.
 2. Momentum: 
•  Relative Strength Index (RSI):  Identifies overbought (above its dynamically calculated upper bound) or oversold (below its lower bound) conditions; changes in RSI often precede price reversals.
•  Stochastic %K:  Highlights shifts in short-term momentum by comparing closing price to the recent high/low range; values above its upper band signal bullish momentum, below its lower band signal bearish momentum.
•  MACD Histogram:  Measures the difference between the MACD line and its signal line; a positive histogram indicates upward momentum, a negative histogram indicates downward momentum.
 3. Price Action: 
•  Highest High / Lowest Low (HH/LL) Range:  Over a defined lookback period, this captures breakout or breakdown levels. A closing price near the recent highs (with a positive MA slope) yields a bullish score, and near the lows (with a negative MA slope) yields a bearish score.
•  Heikin-Ashi Doji Detection:  Uses Heikin-Ashi candles to identify indecision or continuation patterns. A small Heikin-Ashi body (doji) relative to recent volatility is scored as neutral; a larger body in the direction of the MA slope is scored bullish or bearish.
•  Candle Range Measurement:  Compares each candle’s high-low range against its own dynamic band (average range ± standard deviation). Large candles aligning with the prevailing trend score bullish or bearish accordingly; unusually small candles can indicate exhaustion or consolidation.
 4. Market Activity: 
•  Bollinger Bands Width (BBW):  Measures the distance between BB upper and lower bands; wide bands indicate high volatility, narrow bands indicate low volatility.
•  Average True Range (ATR):  Quantifies average price movement (volatility). A sudden spike in ATR suggests a volatile environment, while a contraction suggests calm.
•  Keltner Channels Width (KCW):  Similar to BBW but uses ATR around an EMA. Provides a second layer of volatility context, confirming or contrasting BBW readings.
•  Volume (with Moving Average):  Compares current volume to its moving average ± standard deviation. High volume validates strong moves; low volume signals potential lack of conviction.
By combining these tools, the indicator captures trend direction, momentum strength, price-action nuances, and overall market energy, yielding a more balanced and comprehensive assessment than any single tool alone.
---
 4. What Makes This Indicator Stand Out 
•  Multi-Dimensional Analysis:  Rather than relying on a lone oscillator or moving average crossover, it simultaneously evaluates trend, momentum, price action, and activity.
•  Dynamic Weighting:  The relative importance of trend, momentum, and price action adjusts automatically based on real-time volatility (Market Activity State). For example, in highly volatile conditions, trend and momentum signals carry more weight; in calm markets, price action signals are prioritized.
•  Stability Mechanisms: 
•  Smoothing:  The net score is passed through a short moving average, filtering out noise, especially on lower timeframes.
•  Hysteresis:  Both Market Activity State and the final bullish/bearish/sideways zone require two consecutive confirmations before flipping, reducing whipsaw.
•  Visual Interpretation:  A fully customizable on-chart dashboard displays each sub-indicator’s value, regime, score, and comment, all color-coded. The oscillator plot changes color to reflect the current market zone (green for bullish, red for bearish, gray for sideways) and shows horizontal threshold lines at +2, 0, and –2.
---
 5. Recommended Timeframes 
•  Short-Term (5 min, 15 min):  Day traders and scalpers can benefit from rapid signals, but should enable smoothing (and possibly disable hysteresis) to reduce false whipsaws.
•  Medium-Term (1 h, 4 h):  Swing traders find a balance between responsiveness and reliability. Less smoothing is required here, and the default parameters (e.g., ADX length = 14, RSI length = 14) perform well.
•  Long-Term (Daily, Weekly):  Position traders tracking major trends can disable smoothing for immediate raw readings, since higher-timeframe noise is minimal. Adjust lookback lengths (e.g., increase adxLength, rsiLength) if desired for slower signals.
 Tip:  If you keep smoothing off, stick to timeframes of 1 h or higher to avoid excessive signal “chatter.”
---
 6. How Scoring Works 
 A. Individual Indicator Scores 
Each sub-indicator is assigned one of three discrete scores:
•  +1  if it indicates a bullish condition (e.g., RSI above its dynamically calculated upper bound).
•  0  if it is neutral (e.g., RSI between upper and lower bounds).
•  –1  if it indicates a bearish condition (e.g., RSI below its dynamically calculated lower bound).
Examples of individual score assignments:
•  ADX/DMI: 
•  +1  if ADX ≥ adxThreshold and +DI > –DI (strong bullish trend)
•  –1  if ADX ≥ adxThreshold and –DI > +DI (strong bearish trend)
•  0  if ADX < adxThreshold (trend strength below threshold)
•  RSI: 
•  +1  if RSI > RSI_upperBound
•  –1  if RSI < RSI_lowerBound
•  0  otherwise
•  ATR (as part of Market Activity): 
•  +1  if ATR > (ATR_MA + stdev(ATR))
•  –1  if ATR < (ATR_MA – stdev(ATR))
•  0  otherwise
Each of the four main categories shares this same +1/0/–1 logic across their sub-components.
 B. Category Scores 
Once each sub-indicator reports +1, 0, or –1, these are summed within their categories as follows:
•  Trend Score  = (ADX score) + (MA slope score) + (Ichimoku differential score)
•  Momentum Score  = (RSI score) + (Stochastic %K score) + (MACD histogram score)
•  Price Action Score  = (Highest-High/Lowest-Low score) + (Heikin-Ashi doji score) + (Candle range score)
•  Market Activity Raw Score  = (BBW score) + (ATR score) + (KC width score) + (Volume score)
Each category’s summed value can range between –3 and +3 (for Trend, Momentum, and Price Action), and between –4 and +4 for Market Activity raw.
 C. Market Activity State and Dynamic Weight Adjustments 
Rather than contributing directly to the netScore like the other three categories, Market Activity determines how much weight to assign to Trend, Momentum, and Price Action:
1. Compute Market Activity Raw Score by summing BBW, ATR, KCW, and Volume individual scores (each +1/0/–1).
2. Bucket into High, Medium, or Low Activity:
   •  High  if raw Score ≥ 2 (volatile market).
   •  Low  if raw Score ≤ –2 (calm market).
   •  Medium  otherwise.
3. Apply Hysteresis (if enabled): The state only flips after two consecutive bars register the same high/low/medium label.
4. Set Category Weights:
   •  High Activity:  Trend = 50 %, Momentum = 35 %, Price Action = 15 %.
   •  Low Activity:  Trend = 25 %, Momentum = 20 %, Price Action = 55 %.
   •  Medium Activity:  Use the trader’s base weight inputs (e.g., Trend = 40 %, Momentum = 30 %, Price Action = 30 % by default).
    D. Calculating the Net Score 
5. Normalize Base Weights (so that the sum of Trend + Momentum + Price Action always equals 100 %).
6. Determine Current Weights based on the Market Activity State (High/Medium/Low).
7. Compute Each Category’s Contribution: Multiply (categoryScore) × (currentWeight).
8. Sum Contributions to get the raw netScore (a floating-point value that can exceed ±3 when scores are strong).
9. Smooth the netScore over two bars (if smoothing is enabled) to reduce noise.
10. Apply Hysteresis to the Final Zone:
    • If the smoothed netScore ≥ +2, the bar is classified as “Bullish.”
    • If the smoothed netScore ≤ –2, the bar is classified as “Bearish.”
    • Otherwise, it is “Sideways.”
    • To prevent rapid flips, the script requires two consecutive bars in the new zone before officially changing the displayed zone (if hysteresis is on).
     E. Thresholds for Zone Classification 
    •  BULLISH:  netScore ≥ +2
    •  BEARISH:  netScore ≤ –2
    •  SIDEWAYS:  –2 < netScore < +2
---
 7. Role of Volatility (Market Activity State) in Scoring 
Volatility acts as a dynamic switch that shifts which category carries the most influence:
 1. High Activity (Volatile): 
• Detected when at least two sub-scores out of BBW, ATR, KCW, and Volume equal +1.
• The script sets Trend weight = 50 % and Momentum weight = 35 %. Price Action weight is minimized at 15 %.
•  Rationale:  In volatile markets, strong trending moves and momentum surges dominate, so those signals are more reliable than nuanced candle patterns.
 2. Low Activity (Calm): 
• Detected when at least two sub-scores out of BBW, ATR, KCW, and Volume equal –1.
• The script sets Price Action weight = 55 %, Trend = 25 %, and Momentum = 20 %.
•  Rationale:  In quiet, sideways markets, subtle price-action signals (breakouts, doji patterns, small-range candles) are often the best early indicators of a new move.
 3. Medium Activity (Balanced): 
• Raw Score between –1 and +1 from the four volatility metrics.
• Uses whatever base weights the trader has specified (e.g., Trend = 40 %, Momentum = 30 %, Price Action = 30 %).
Because volatility can fluctuate rapidly, the script employs hysteresis on Market Activity State: a new High or Low state must occur on two consecutive bars before weights actually shift. This avoids constant back-and-forth weight changes and provides more stability.
  
---
 8. Scoring Example (Hypothetical Scenario) 
•  Symbol:  Bitcoin on a 1-hour chart.
•  Market Activity:  Raw volatility sub-scores show BBW (+1), ATR (+1), KCW (0), Volume (+1) → Total raw Score = +3 → High Activity.
•  Weights Selected:  Trend = 50 %, Momentum = 35 %, Price Action = 15 %.
•  Trend Signals: 
• ADX strong and +DI > –DI → +1
• Fast MA above Slow MA → +1
• Ichimoku Senkou A > Senkou B → +1
→ Trend Score = +3
•  Momentum Signals: 
• RSI above upper bound → +1
• MACD histogram positive → +1
• Stochastic %K within neutral zone → 0
→ Momentum Score = +2
•  Price Action Signals: 
• Highest High/Lowest Low check yields 0 (close not near extremes)
• Heikin-Ashi doji reading is neutral → 0
• Candle range slightly above upper bound but trend is strong, so → +1
→ Price Action Score = +1
•  Compute Net Score (before smoothing): 
• Trend contribution = 3 × 0.50 = 1.50
• Momentum contribution = 2 × 0.35 = 0.70
• Price Action contribution = 1 × 0.15 = 0.15
• Raw netScore = 1.50 + 0.70 + 0.15 = 2.35
• Since 2.35 ≥ +2 and hysteresis is met, the final zone is “Bullish.”
Although the netScore lands at 2.35 (Bullish), smoothing might bring it slightly below 2.00 on the first bar (e.g., 1.90), in which case the script would wait for a second consecutive reading above +2 before officially classifying the zone as Bullish (if hysteresis is enabled).
---
 9. Correlation Between Categories 
The four categories—Trend Strength, Momentum, Price Action, and Market Activity—often reinforce or offset one another. The script takes advantage of these natural correlations:
•  Bullish Alignment:  If ADX is strong and pointed upward, fast MA is above slow MA, and Ichimoku is positive, that usually coincides with RSI climbing above its upper bound and the MACD histogram turning positive. In such cases, both Trend and Momentum categories generate +1 or +2. Because the Market Activity State is likely High (given the accompanying volatility), Trend and Momentum weights are at their peak, so the netScore quickly crosses into Bullish territory.
•  Sideways/Consolidation:  During a low-volatility, sideways phase, ADX may fall below its threshold, MAs may flatten, and RSI might hover in the neutral band. However, subtle price-action signals (like a small breakout candle or a Heikin-Ashi candle with a slight bias) can still produce a +1 in the Price Action category. If Market Activity is Low, Price Action’s weight (55 %) can carry enough influence—even if Trend and Momentum are neutral—to push the netScore out of “Sideways” into a mild bullish or bearish bias.
•  Opposing Signals:  When Trend is bullish but Momentum turns negative (for example, price continues up but RSI rolls over), the two scores can partially cancel. Market Activity may remain Medium, in which case the netScore lingers near zero (Sideways). The trader can then wait for either a clearer momentum shift or a fresh price-action breakout before committing.
By dynamically recognizing these correlations and adjusting weights, the indicator ensures that:
• When Trend and Momentum align (and volatility supports it), the netScore leaps strongly into Bullish or Bearish.
• When Trend is neutral but Price Action shows an early move in a low-volatility environment, Price Action’s extra weight in the Low Activity State can still produce actionable signals.
---
 10. Market Activity State & Its Role (Detailed) 
The Market Activity State is not a direct category score—it is an overarching context setter for how heavily to trust Trend, Momentum, or Price Action. Here’s how it is derived and applied:
1.  Calculate Four Volatility Sub-Scores: 
   • BBW: Compare the current band width to its own moving average ± standard deviation. If BBW > (BBW_MA + stdev), assign +1 (high volatility); if BBW < (BBW_MA × 0.5), assign –1 (low volatility); else 0.
   • ATR: Compare ATR to its moving average ± standard deviation. A spike above the upper threshold is +1; a contraction below the lower threshold is –1; otherwise 0.
   • KCW: Same logic as ATR but around the KCW mean.
   • Volume: Compare current volume to its volume MA ± standard deviation. Above the upper threshold is +1; below the lower threshold is –1; else 0.
2.  Sum Sub-Scores → Raw Market Activity Score:  Range between –4 and +4.
3.  Assign Market Activity State: 
   •  High Activity:  Raw Score ≥ +2 (at least two volatility metrics are strongly spiking).
   •  Low Activity:  Raw Score ≤ –2 (at least two metrics signal unusually low volatility or thin volume).
   •  Medium Activity:  Raw Score is between –1 and +1 inclusive.
4.  Hysteresis for Stability: 
   • If hysteresis is enabled, a new state only takes hold after two consecutive bars confirm the same High, Medium, or Low label.
   • This prevents the Market Activity State from bouncing around when volatility is on the fence.
5.  Set Category Weights Based on Activity State: 
   • High Activity: Trend = 50 %, Momentum = 35 %, Price Action = 15 %.
   • Low Activity: Trend = 25 %, Momentum = 20 %, Price Action = 55 %.
   • Medium Activity: Use trader’s base weights (e.g., Trend = 40 %, Momentum = 30 %, Price Action = 30 %).
6.  Impact on netScore:  Because category scores (–3 to +3) multiply by these weights, High Activity amplifies the effect of strong Trend and Momentum scores; Low Activity amplifies the effect of Price Action.
7.  Market Context Tooltip:  The dashboard includes a tooltip summarizing the current state—e.g., “High activity, trend and momentum prioritized,” “Low activity, price action prioritized,” or “Balanced market, all categories considered.”
---
 11. Category Weights: Base vs. Dynamic 
Traders begin by specifying base weights for Trend Strength, Momentum, and Price Action that sum to 100 %. These apply only when volatility is in the Medium band. Once volatility shifts:
•  High Volatility Overrides: 
• Trend jumps from its base (e.g., 40 %) to 50 %.
• Momentum jumps from its base (e.g., 30 %) to 35 %.
• Price Action is reduced to 15 %.
 Example:  If base weights were Trend = 40 %, Momentum = 30 %, Price Action = 30 %, then in High Activity they become 50/35/15. A Trend score of +3 now contributes 3 × 0.50 = +1.50 to netScore; a Momentum +2 contributes 2 × 0.35 = +0.70. In total, Trend + Momentum can easily push netScore above the +2 threshold on its own.
•  Low Volatility Overrides: 
• Price Action leaps from its base (30 %) to 55 %.
• Trend falls to 25 %, Momentum falls to 20 %.
 Why?  When markets are quiet, subtle candle breakouts, doji patterns, and small-range expansions tend to foreshadow the next swing more effectively than raw trend readings. A Price Action score of +3 in this state contributes 3 × 0.55 = +1.65, which can carry the netScore toward +2—even if Trend and Momentum are neutral or only mildly positive.
Because these weight shifts happen only after two consecutive bars confirm a High or Low state (if hysteresis is on), the indicator avoids constantly flipping its emphasis during borderline volatility phases.
---
 12. Dominant Category Explained 
Within the dashboard, a label such as “Trend Dominant,” “Momentum Dominant,” or “Price Action Dominant” appears when one category’s absolute weighted contribution to netScore is the largest. Concretely:
• Compute each category’s weighted contribution = (raw category score) × (current weight).
• Compare the absolute values of those three contributions.
• The category with the highest absolute value is flagged as Dominant for that bar.
 Why It Matters: 
•  Momentum Dominant:  Indicates that the combined force of RSI, Stochastic, and MACD (after weighting) is pushing netScore farther than either Trend or Price Action. In practice, it means that short-term sentiment and speed of change are the primary drivers right now, so traders should watch for continued momentum signals before committing to a trade.
•  Trend Dominant:  Means ADX, MA slope, and Ichimoku (once weighted) outweigh the other categories. This suggests a strong directional move is in place; trend-following entries or confirming pullbacks are likely to succeed.
•  Price Action Dominant:  Occurs when breakout/breakdown patterns, Heikin-Ashi candle readings, and range expansions (after weighting) are the most influential. This often happens in calmer markets, where subtle shifts in candle structure can foreshadow bigger moves.
By explicitly calling out which category is carrying the most weight at any moment, the dashboard gives traders immediate insight into why the netScore is tilting toward bullish, bearish, or sideways.
---
 13. Oscillator Plot: How to Read It 
The “Net Score” oscillator sits below the dashboard and visually displays the smoothed netScore as a line graph. Key features:
1.  Value Range:  In normal conditions it oscillates roughly between –3 and +3, but extreme confluences can push it outside that range.
2.  Horizontal Threshold Lines: 
   • +2 Line (Bullish threshold)
   • 0 Line (Neutral midline)
   • –2 Line (Bearish threshold)
3.  Zone Coloring: 
   • Green Background (Bullish Zone): When netScore ≥ +2.
   • Red Background (Bearish Zone): When netScore ≤ –2.
   • Gray Background (Sideways Zone): When –2 < netScore < +2.
4.  Dynamic Line Color: 
   • The plotted netScore line itself is colored green in a Bullish Zone, red in a Bearish Zone, or gray in a Sideways Zone, creating an immediate visual cue.
    Interpretation Tips: 
   •  Crossing Above +2:  Signals a strong enough combined trend/momentum/price-action reading to classify as Bullish. Many traders wait for a clear crossing plus a confirmation candle before entering a long position.
   •  Crossing Below –2:  Indicates a strong Bearish signal. Traders may consider short or exit strategies.
   •  Rising Slope, Even Below +2:  If netScore climbs steadily from neutral toward +2, it demonstrates building bullish momentum.
   •  Divergence:  If price makes a higher high but the oscillator fails to reach a new high, it can warn of weakening momentum and a potential reversal.
---
 14. Comments and Their Necessity 
Every sub-indicator (ADX, MA slope, Ichimoku, RSI, Stochastic, MACD, HH/LL, Heikin-Ashi, Candle Range, BBW, ATR, KCW, Volume) generates a short comment that appears in the detailed dashboard. Examples:
• “Strong bullish trend” or “Strong bearish trend” for ADX/DMI
• “Fast MA above slow MA” or “Fast MA below slow MA” for MA slope
• “RSI above dynamic threshold” or “RSI below dynamic threshold” for RSI
• “MACD histogram positive” or “MACD histogram negative” for MACD Hist
• “Price near highs” or “Price near lows” for HH/LL checks
• “Bullish Heikin Ashi” or “Bearish Heikin Ashi” for HA Doji scoring
• “Large range, trend confirmed” or “Small range, trend contradicted” for Candle Range
Additionally, the top-row comment for each category is:
•  Trend:  “Highly Bullish,” “Highly Bearish,” or “Neutral Trend.”
•  Momentum:  “Strong Momentum,” “Weak Momentum,” or “Neutral Momentum.”
•  Price Action:  “Bullish Action,” “Bearish Action,” or “Neutral Action.”
•  Market Activity:  “Volatile Market,” “Calm Market,” or “Stable Market.”
 Reasons for These Comments: 
•  Transparency:  Shows exactly how each sub-indicator contributed to its category score.
•  Education:  Helps traders learn why a category is labeled bullish, bearish, or neutral, building intuition over time.
•  Customization:  If, for example, the RSI comment says “RSI neutral” despite an impending trend shift, a trader might choose to adjust RSI length or thresholds.
In the detailed dashboard, hovering over each comment cell also reveals a tooltip with additional context (e.g., “Fast MA above slow MA” or “Senkou A above Senkou B”), helping traders understand the precise rule behind that +1, 0, or –1 assignment.
---
 15. Real-Life Example (Consolidated) 
•  Instrument & Timeframe:  Bitcoin (BTCUSD), 1-hour chart.
•  Current Market Activity:  BBW and ATR both spike (+1 each), KCW is moderately high (+1), but volume is only neutral (0) → Raw Market Activity Score = +2 → State = High Activity (after two bars, if hysteresis is on).
•  Category Weights Applied:  Trend = 50 %, Momentum = 35 %, Price Action = 15 %.
•  Trend Sub-Scores: 
1. ADX = 25 (above threshold 20) with +DI > –DI → +1.
2. Fast MA (20-period) sits above Slow MA (50-period) → +1.
3. Ichimoku: Senkou A > Senkou B → +1.
   → Trend Score = +3.
   •  Momentum Sub-Scores: 
4. RSI = 75 (above its moving average +1 stdev) → +1.
5. MACD histogram = +0.15 → +1.
6. Stochastic %K = 50 (mid-range) → 0.
   → Momentum Score = +2.
   •  Price Action Sub-Scores: 
7. Price is not within 1 % of the 20-period high/low and slope = positive → 0.
8. Heikin-Ashi body is slightly larger than stdev over last 5 bars with haClose > haOpen → +1.
9. Candle range is just above its dynamic upper bound but trend is already captured, so → +1.
   → Price Action Score = +2.
   •  Calculate netScore (before smoothing): 
   • Trend contribution = 3 × 0.50 = 1.50
   • Momentum contribution = 2 × 0.35 = 0.70
   • Price Action contribution = 2 × 0.15 = 0.30
   • Raw netScore = 1.50 + 0.70 + 0.30 = 2.50 → Immediately classified as Bullish.
   •  Oscillator & Dashboard Output: 
   • The oscillator line crosses above +2 and turns green.
   • Dashboard displays:
   • Trend Regime “BULLISH,” Trend Score = 3, Comment = “Highly Bullish.”
   • Momentum Regime “BULLISH,” Momentum Score = 2, Comment = “Strong Momentum.”
   • Price Action Regime “BULLISH,” Price Action Score = 2, Comment = “Bullish Action.”
   • Market Activity State “High,” Comment = “Volatile Market.”
   • Weights: Trend 50 %, Momentum 35 %, Price Action 15 %.
   • Dominant Category: Trend (because 1.50 > 0.70 > 0.30).
   • Overall Score: 2.50, posCount = (three +1s in Trend) + (two +1s in Momentum) + (two +1s in Price Action) = 7 bullish signals, negCount = 0.
   • Final Zone = “BULLISH.”
   • The trader sees that both Trend and Momentum are reinforcing each other under high volatility. They might wait one more candle for confirmation but already have strong evidence to consider a long.
---
• .
---
 Disclaimer 
This indicator is strictly a technical analysis tool and does not constitute financial advice. All trading involves risk, including potential loss of capital. Past performance is not indicative of future results. Traders should:
•  Always backtest  the “Market Zone Analyzer ” on their chosen symbols and timeframes before committing real capital.
•  Combine  this tool with sound risk management, position sizing, and, if possible, fundamental analysis.
•  Understand  that no indicator is foolproof; always be prepared for unexpected market moves.
Goodluck
-BullByte!
---
Heikin-Ashi Mean Reversion Oscillator [Alpha Extract]The Heikin-Ashi Mean Reversion Oscillator combines the smoothing characteristics of Heikin-Ashi candlesticks with mean reversion analysis to create a powerful momentum oscillator. This indicator applies Heikin-Ashi transformation twice - first to price data and then to the oscillator itself - resulting in smoother signals while maintaining sensitivity to trend changes and potential reversal points.
🔶 CALCULATION 
 
 Heikin-Ashi Transformation: Converts regular OHLC data to smoothed Heikin-Ashi values
 Component Analysis: Calculates trend strength, body deviation, and price deviation from mean
 Oscillator Construction: Combines components with weighted formula (40% trend strength, 30% body deviation, 30% price deviation)
 Double Smoothing: Applies EMA smoothing and second Heikin-Ashi transformation to oscillator values
 Signal Generation: Identifies trend changes and crossover points with overbought/oversold levels
Formula:
 HA Close = (Open + High + Low + Close) / 4
 HA Open = (Previous HA Open + Previous HA Close) / 2
 Trend Strength = Normalized consecutive HA candle direction
 Body Deviation = (HA Body - Mean Body) / Mean Body * 100
 Price Deviation = ((HA Close - Price Mean) / Price Mean * 100) / Standard Deviation * 25
 Raw Oscillator = (Trend Strength * 0.4) + (Body Deviation * 0.3) + (Price Deviation * 0.3)
 Final Oscillator = 50 + (EMA(Raw Oscillator) / 2)
 
🔶 DETAILS Visual Features:
 
 Heikin-Ashi Candlesticks: Smoothed oscillator representation using HA transformation with vibrant teal/red coloring
 Overbought/Oversold Zones: Horizontal lines at customizable levels (default 70/30) with background highlighting in extreme zones
 Moving Averages: Optional fast and slow EMA overlays for additional trend confirmation
 Signal Dashboard: Real-time table showing current oscillator status (Overbought/Oversold/Bullish/Bearish) and buy/sell signals
 Reference Lines: Middle line at 50 (neutral), with 0 and 100 boundaries for range visualization
 Interpretation:
 Above 70: Overbought conditions, potential selling opportunity
 Below 30: Oversold conditions, potential buying opportunity
 Bullish HA Candles: Green/teal candles indicate upward momentum
 Bearish HA Candles: Red candles indicate downward momentum
 MA Crossovers: Fast EMA above slow EMA suggests bullish momentum, below suggests bearish momentum
 Zone Exits: Price moving out of extreme zones (above 70 or below 30) often signals trend continuation
 
🔶 EXAMPLES
 
 Mean Reversion Signals: When the oscillator reaches extreme levels (above 70 or below 30), it identifies potential reversal points where price may revert to the mean.
 Example: Oscillator reaching 80+ levels during strong uptrends often precedes short-term pullbacks, providing profit-taking opportunities.
 Trend Change Detection: The double Heikin-Ashi smoothing helps identify genuine trend changes while filtering out market noise.
 Example: When oscillator HA candles change from red to teal after oversold readings, this confirms potential trend reversal from bearish to bullish.
 Moving Average Confirmation: Fast and slow EMA crossovers on the oscillator provide additional confirmation of momentum shifts.
 Example: Fast EMA crossing above slow EMA while oscillator is rising from oversold levels provides strong bullish confirmation signal.
 Dashboard Signal Integration: The real-time dashboard combines oscillator status with directional signals for quick decision-making.
 Example: Dashboard showing "Oversold" status with "BUY" signal when HA candles turn bullish provides clear entry timing.
 
🔶 SETTINGS
Customization Options:
 
 Calculation: Oscillator period (default 14), smoothing factor (1-50, default 2)
 Levels: Overbought threshold (50-100, default 70), oversold threshold (0-50, default 30)
 Moving Averages: Toggle display, fast EMA length (default 9), slow EMA length (default 21)
 Visual Enhancements: Show/hide signal dashboard, customizable table position
 Alert Conditions: Oversold bounce, overbought reversal, bullish/bearish MA crossovers
 The Heikin-Ashi Mean Reversion Oscillator provides traders with a sophisticated momentum tool that combines the smoothing benefits of Heikin-Ashi analysis with mean reversion principles. The double transformation process creates cleaner signals while the integrated dashboard and multiple confirmation methods help traders identify high-probability entry and exit points during both trending and ranging market conditions.
Max Trend Points [BigBeluga]🔵  OVERVIEW 
 A clean and powerful tool for identifying major trend shifts and quantifying the strength of each move using dynamically calculated price extremes. 
This indicator helps traders visualize the most significant trend changes by plotting trend direction lines and dynamically tracking the highest or lowest point within each trend leg. It’s ideal for identifying key price impulses and measuring their magnitude in real time.
🔵  CONCEPTS 
  Uses an adaptive trend-following logic based on volatility envelopes created from HMA of the price range (high - low).
  Identifies trend direction and flips when price breaks above or below these dynamic envelopes.
  Tracks swing highs and lows within the current trend leg to highlight trend extremes.
  Calculates and displays the percentage gain or drop from trend start to trend peak/valley.
 
🔵  FEATURES 
   Trend Shift Detection: 
Plots a colored trend line (uptrend or downtrend) that updates based on price action volatility.
  
   Impulse Mapping: 
Draws a dashed line between the point of trend change (close) and the current trend leg's extreme (highest high or lowest low).
  
   Percentage Labeling: 
Displays a floating label showing the exact percent change from the trend start to the current extreme.
  
   Real-Time Adjustments: 
As the trend progresses, the extreme point and the percent label update automatically to reflect new highs/lows.
  
 
🔵  HOW TO USE 
  Look for the trend color shift and circular marker to identify a new potential trend direction.
  Use the dashed lines and percent label to evaluate the strength and potential maturity of each move.
  Combine this tool with support/resistance levels or other indicators to identify confluence zones.
  Adjust the "Factor" input to make the trend detection more or less sensitive depending on your timeframe.
 
🔵  CONCLUSION 
 Max Trend Points   is an efficient visual indicator for understanding the structure and magnitude of trending moves. It provides essential feedback on how far a trend has traveled, where momentum may be peaking, and when a shift may be underway—all with real-time adaptability and clean presentation.
Higher Timeframe TrendMap [BigBeluga]🔵HTF TrendMap    
 A powerful visual overlay that brings higher timeframe market structure directly onto your intraday chart.
This tool maps directional bias, trend strength, and dynamic range boundaries from a user-selected HTF (like Daily or 4H), offering a real-time confluence layer for scalpers, day traders, and swing traders.
By plotting the evolving average (HL2), it acts as a volatility-weighted trend anchor, allowing you to align lower timeframe entries with higher timeframe intent. 
 Technical Overview: 
At the close of each higher timeframe (HTF) candle, the indicator stores the high, low, and calculates the HL2 midpoint. These values are then referenced on the lower timeframe chart to plot trend direction and price boundaries.
 🔵 KEY FEATURES   
 
  Maps the  selected higher timeframe (HTF)  (e.g., Daily) onto your current chart.  
  At the  close of each HTF candle , it starts to calculate and store the  highest, lowest, and average (HL2) price levels .  
  The average (HL2) value is treated as the  HTF trend baseline —plotted in  orange for uptrend ,  blue for downtrend .  
  
  Visual curve thickens and fades to show  progress through the HTF period  (stronger color = fresher data).  
  
  Horizontal dashed lines show  HTF high and low levels  that persist until the next period closes.  
  On every HTF close, two  price labels are printed  for the high and low levels. 
   
   Vertical separators  visually mark the start of each HTF candle for easy structural recognition.  
  
  A  real-time dashboard  shows selected HTF, current trend direction (🢁/🢃), and updates dynamically.  
  
 
 🔵 HOW TO USE   
 
  Use the HTF average line as a  bias filter —only long when the trend is up (orange), short when down (blue).  
  HTF high/low labels help identify  key breakout or rejection zones .  
  Combine with intraday systems or reversal tools for  multi-timeframe confluence setups .  
  Ideal for scalpers and swing traders who rely on  HTF momentum shifts .  
 
 🔵 CONCLUSION   
HTF TrendMap   provides a clean, data-rich layer of higher timeframe context to any chart. With adaptive trend coloring, volatility mapping, and real-time data labeling, it enables traders to stay in sync with macro structure while executing on the micro.
Market Breadth Peaks & Troughs IndicatorIndicator Overview 
Market Breadth (S5TH) visualizes extremes of market strength and weakness by overlaying -
 
 a 200-period EMA (long-term trend)
 a 5-period EMA (short-term trend, user-adjustable)
 
on the percentage of S&P 500 constituents trading above their 200-day SMA (INDEX:S5TH).
Peaks (▼) and troughs (▲) are detected with prominence filters so you can quickly spot overbought and oversold conditions.
⸻
 1. Core Logic 
Component	Description
Breadth series	INDEX:S5TH — % of S&P 500 stocks above their 200-SMA
Long EMA	200-EMA to capture the primary trend
Short EMA	5-EMA (default, editable) for short-term swings
Peak detection	ta.pivothigh + prominence ⇒ major peaks marked with red ▼
Trough detection (200 EMA)	ta.pivotlow + prominence + value < longTroughLvl ⇒ blue ▲
Trough detection (5 EMA)	ta.pivotlow + prominence + value < shortTroughLvl ⇒ green ▲
Background shading	Pink when 200 EMA slope is down and 5 EMA sits below 200 EMA
⸻
 2. Adjustable Parameters (input()) 
Group	Variable	Default	Purpose
Symbol	breadthSym	INDEX:S5TH	Breadth index
Long EMA	longLen	200	Period of long EMA
Short EMA	shortLen	5	Period of short EMA
Pivot width (long)	pivotLen	20	Bars left/right for 200-EMA peaks/troughs
Pivot width (short)	pivotLenS	10	Bars for 5-EMA troughs
Prominence (long)	promThresh	0.5 %-pt	Depth filter for 200-EMA pivots
Prominence (short)	promThreshS	3.0 %-pt	Depth filter for 5-EMA pivots
Trough level (long)	longTroughLvl	50 %	Max value to accept a 200-EMA trough
Trough level (short)	shortTroughLvl	30 %	Max value to accept a 5-EMA trough
⸻
 3. Signal Guide 
Marker / Color	Meaning	Typical reading
Red ▼	Major breadth peak	Overbought / possible top
Blue ▲	Deep 200-EMA trough	End of mid-term correction
Green ▲	Shallow 5-EMA trough (early)	Short-term rebound setup
Pink background	Long-term down-trend and short-term weak	Risk-off phase
⸻
 4. Typical Use Cases 
 1.	Counter-trend timing 
	•	Fade greed: trim longs on red ▼
	•	Buy fear: scale in on green ▲; add on blue ▲
 2.	Trend filter 
	•	Avoid new longs while the background is pink; wait for a trough & recovery.
 3.	Risk management 
	•	Reduce exposure when peaks appear, reload partial size on confirmed troughs.
⸻
 5. Notes & Tips 
	•	INDEX:S5TH is sourced from TradingView and may be back-adjusted when index membership changes.
	•	Fine-tune pivotLen, promThresh, and level thresholds to match current volatility before relying on alerts or automated rules.
	•	Slope thresholds (±0.10 %-pt) that trigger background shading can also be customized for different market regimes.
Gioteen-NormThe "Gioteen-Norm" indicator is a versatile and powerful technical analysis tool designed to help traders identify key market conditions such as divergences, overbought/oversold levels, and trend strength. By normalizing price data relative to a moving average and standard deviation, this indicator provides a unique perspective on price behavior, making it easier to spot potential reversals or continuations in the market.
The indicator calculates a normalized value based on the difference between the selected price and its moving average, scaled by the standard deviation over a user-defined period. Additionally, an optional moving average of this normalized value (Green line) can be plotted to smooth the output and enhance signal clarity. This dual-line approach makes it an excellent tool for both short-term and long-term traders.
***Key Features
Divergence Detection: The Gioteen-Norm excels at identifying divergences between price action and the normalized indicator value. For example, if the price makes a higher high while Red line forms a lower high, it may signal a bearish divergence, hinting at a potential reversal.
Overbought/Oversold Conditions: Extreme values of Red line (e.g., significantly above or below zero) can indicate overbought or oversold conditions, helping traders anticipate pullbacks or bounces.
Trend Strength Insight: The normalized output reflects how far the price deviates from its average, providing a measure of momentum and trend strength.
**Customizable Parameters
Traders can adjust the period, moving average type, applied price, and shift to suit their trading style and timeframe.
**How It Works
Label1 (Red Line): Represents the normalized price deviation from a user-selected moving average (SMA, EMA, SMMA, or LWMA) divided by the standard deviation over the specified period. This line highlights the relative position of the price compared to its historical range.
Label2 (Green Line, Optional): A moving average of Label1, which smooths the normalized data to reduce noise and provide clearer signals. This can be toggled on or off via the "Draw MA" option.
**Inputs
Period: Length of the lookback period for normalization (default: 100).
MA Method: Type of moving average for normalization (SMA, EMA, SMMA, LWMA; default: EMA).
Applied Price: Price type used for calculation (Close, Open, High, Low, HL2, HLC3, HLCC4; default: Close).
Shift: Shifts the indicator forward or backward (default: 0).
Draw MA: Toggle the display of the Label2 moving average (default: true).
MA Period: Length of the moving average for Label2 (default: 50).
MA Method (Label2): Type of moving average for Label2 (SMA, EMA, SMMA, LWMA; default: SMA).
**How to Use
Divergence Trading: Look for discrepancies between price action and Label1. A bullish divergence (higher low in Label1 vs. lower low in price) may suggest a buying opportunity, while a bearish divergence could indicate a selling opportunity.
Overbought/Oversold Levels: Monitor extreme Label1 values. For instance, values significantly above +2 or below -2 could indicate overextension, though traders should define thresholds based on the asset and timeframe.
Trend Confirmation: Use Label2 to confirm trend direction. A rising Label2 suggests increasing bullish momentum, while a declining Label2 may indicate bearish pressure.
Combine with Other Tools: Pair Gioteen-Norm with support/resistance levels, RSI, or volume indicators for a more robust trading strategy.
**Notes
The indicator is non-overlay, meaning it plots below the price chart in a separate panel.
Avoid using a Period value of 1, as it may lead to unstable results due to insufficient data for standard deviation calculation.
This tool is best used as part of a broader trading system rather than in isolation.
**Why Use Gioteen-Norm?
The Gioteen-Norm indicator offers a fresh take on price normalization, blending statistical analysis with moving average techniques. Its flexibility and clarity make it suitable for traders of all levels—whether you're scalping on short timeframes or analyzing long-term trends. By publishing this for free, I hope to contribute to the TradingView community and help traders uncover hidden opportunities in the markets.
**Disclaimer
This indicator is provided for educational and informational purposes only. It does not constitute financial advice. Always backtest and validate any strategy before trading with real capital, and use proper risk management.
Sentiment Master Oscillator[BullByte] 
The  Sentiment Master Oscillator  is a modern market sentiment indicator designed for traders seeking to identify early trend shifts and potential reversals with clarity. This oscillator combines multiple technical tools—RSI, MACD, EMAs, ADX, ATR, and volume filters—to deliver layered signals that help you assess market momentum in a clear and simplified manner.
 Key Features: 
- Multi-Indicator Approach :
  Integrates RSI (with a smoothing function), MACD, and two EMAs to gauge momentum and trend direction. The oscillator also includes ADX and ATR filters to ensure that only markets with sufficient directional strength and volatility generate signals.
-  Dynamic Signal Zones :
  The oscillator produces a raw value ranging roughly from -3 to +3 (adjustable via a scaling factor). Positive readings suggest bullish conditions, while negative readings indicate bearish trends. Visual zones (Early, Confirmed, Strong) are clearly marked with color-coded horizontal lines to help you interpret the strength of the signal at a glance.
-  Adaptive Smoothing :
  For those who prefer quicker, more responsive signals (ideal for scalping), an adaptive smoothing option is available. When enabled, it applies a shorter smoothing period to the oscillator; otherwise, a more conservative base period is used.
-  Reversal Alerts :
  Yellow dots are plotted on the chart to highlight potential reversal points. These alerts are triggered when the oscillator crosses specific thresholds, coupled with volume and ATR conditions, signaling that a top or bottom may be forming.
-  Customizable Filters :
  -  ATR Filter :Ensures that the market's volatility is above a set threshold before signaling.  
  -  ADX Filter :Confirms sufficient trend strength.  
  -  Volume Filter : Requires that trading volume surges above a multiple of its simple moving average, filtering out low-volume noise.
-  Clear Signal Messaging :
  Based on the combined signals from various indicators, the script categorizes market sentiment into actionable messages such as "Early Buy", "Confirmed Buy", "Strong Buy", "Early Sell", "Confirmed Sell", and "Strong Sell". A "Grey Zone" label is used when the oscillator is near neutral, indicating that no clear trend is present.
 How to Use :
1.  Entry and Exit Decisions : Use the different signal stages (Early, Confirmed, Strong) as guides for your entries and exits.  
2.  Trend Confirmation : Rely on the multi-indicator setup for added confirmation of prevailing market conditions before executing trades.  
3.  Reversal Cues : Pay attention to the reversal dots for potential turning points in the market, which can be used to adjust positions or initiate trades.
 Disclaimer: 
This indicator is intended for educational and informational purposes only. It should not be taken as financial advice. Always use appropriate risk management and combine it with your analysis before making any trading decisions. Past performance is not indicative of future results.
By adhering to TradingView's publishing guidelines, the BullByte Sentiment Master is designed to provide transparency, simplicity, and robust analysis tools to enhance your trading strategy. Enjoy a clearer view of market sentiment and make more informed trading decisions!
HTF Trend Tracker [BigBeluga]HTF Trend Tracker   is a higher timeframe (HTF) trend tracking indicator designed to help traders identify significant trends, key levels, and market sentiment. The indicator dynamically adapts to the current price action, using HTF highs and lows to display trend direction and strength with detailed visuals.
  
🔵 Key Features:   
 Dynamic Trend Detection: 
   
     Uptrend is identified when the price closes above the HTF high.  
     Downtrend is detected when the price closes below the HTF low.  
     Midline changes color dynamically based on the trend direction:  
         Bullish Green:  Indicates an uptrend.  
         Bearish Red:  Indicates a downtrend.  
  
   
 Historical and Active HTF Levels:   
   
     Historic HTF highs and lows are displayed as dotted lines.  
     Current active HTF high and low levels are shown as solid lines.  
     Timeframe labels (e.g., "1D High" or "1D Low") mark the active levels for clarity.  
  
 Trend Change Signals:   
   
     A green  checkmark (✓)  is plotted when an uptrend starts.  
     A red  cross (✕)  appears when a downtrend begins.  
  
 
 Trend-Based Candle Coloring:   
   
     Candle colors change dynamically based on the trend and the price's distance from the midline:  
         Intense Bullish Green:  Price is far above the midline during an uptrend.  
         Intense Bearish Red:  Price is far below the midline during a downtrend.  
         Neutral Gray:  Price is near the midline.  
     Users can customize the colors to suit their preferences.  
  
 
🔵 Usage:   
 
  Identify uptrends and downtrends using the midline's color and the position of the close relative to the HTF levels.  
  Use solid lines and timeframe labels to track current HTF high and low levels.  
  Observe dotted lines for historical HTF levels to understand past price behavior.  
  Watch for checkmark (✓) and cross (✕) signals to spot trend changes and key market shifts.  
  Monitor candle colors to gauge trend intensity and proximity to the midline:  
     Intense colors signal strong trends, while neutral gray indicates consolidation near the midline.  
 
 HTF Trend Tracker   is an essential tool for traders aiming to follow higher timeframe trends, identify key levels, and make data-driven decisions based on price dynamics and trend strength. Its customizable features allow for flexible integration into any trading strategy.
Triangular Hull Moving Average + Volatility [BigBeluga]This indicator combines the  Triangular Hull Moving Average (THMA)  with a volatility overlay to provide a smoother trend-following tool while dynamically visualizing market volatility.  
🔵 Key Features: 
   
 THMA-Based Trend Detection:  The indicator applies a Triangular Hull Moving Average (THMA) to smooth price data, reducing lag while maintaining responsiveness to trend changes.
 
// THMA
thma(_src, _length) =>  
    ta.wma(ta.wma(_src,_length / 3) * 3 - ta.wma(_src, _length / 2) - ta.wma(_src, _length), _length)
   
  
  Dynamic Volatility Bands: When enabled, the indicator displays wicks extending from the THMA-based candles. These bands expand and contract based on price volatility.  
  
  Trend Reversal Signals The indicator marks trend shifts using triangle-shaped signals:  
   - Upward triangles appear when the THMA trend shifts to bullish.  
   - Downward triangles appear when the THMA trend shifts to bearish.  
  
  Customizable Settings: Users can adjust the THMA length, volatility calculation period, and colors for up/down trends to fit their trading style.  
  
  Informative Dashboard: The bottom-right corner displays the current trend direction and volatility percentage, helping traders quickly assess market conditions.  
  
   
🔵 Usage: 
   
  Trend Trading: The colored candles indicate whether the market is trending up or down. Traders can follow the trend direction and use trend reversals for entry or exit points.  
  Volatility Monitoring: When the volatility feature is enabled, the expanding or contracting wicks help visualize market momentum and potential breakout strength.  
  Signal Confirmation: The triangle signals can be used to confirm potential entry points when the trend shifts.  
   
This tool is ideal for traders who want a  responsive moving average with volatility insights  to enhance their trend-following strategies.  
Bitcoin Log Growth Curve OscillatorThis script presents the oscillator version of the  Bitcoin Logarithmic Growth Curve 2024  indicator, offering a new perspective on Bitcoin’s long-term price trajectory. 
By transforming the original logarithmic growth curve into an oscillator, this version provides a normalized view of price movements within a fixed range, making it easier to identify overbought and oversold conditions.
For a comprehensive explanation of the mathematical derivation, underlying concepts, and overall development of the Bitcoin Logarithmic Growth Curve, we encourage you to explore our primary script, Bitcoin Logarithmic Growth Curve 2024, available  here . This foundational script details the regression-based approach used to model Bitcoin’s long-term price evolution.
 Normalization Process 
The core principle behind this oscillator lies in the normalization of Bitcoin’s price relative to the upper and lower regression boundaries. By applying Min-Max Normalization, we effectively scale the price into a bounded range, facilitating clearer trend analysis. The normalization follows the formula:
 normalized price = (upper regresionline − lower regressionline) / (price − lower regressionline) 
 
This transformation ensures that price movements are always mapped within a fixed range, preventing distortions caused by Bitcoin’s exponential long-term growth. Furthermore, this normalization technique has been applied to each of the confidence interval lines, allowing for a structured and systematic approach to analyzing Bitcoin’s historical and projected price behavior.
By representing the logarithmic growth curve in oscillator form, this indicator helps traders and analysts more effectively gauge Bitcoin’s position within its long-term growth trajectory while identifying potential opportunities based on historical price tendencies.
Smart Market Bias [PhenLabs]📊 Smart Market Bias Indicator (SMBI) 
 Version: PineScript™ v6 
 Description 
The Smart Market Bias Indicator (SMBI) is an advanced technical analysis tool that combines multiple statistical approaches to determine market direction and strength. It utilizes complexity analysis, information theory (Kullback Leibler divergence), and traditional technical indicators to provide a comprehensive market bias assessment. The indicator features adaptive parameters based on timeframe and trading style, with real-time visualization through a sophisticated dashboard.
 🔧 Components 
 
 Complexity Analysis: Measures price movement patterns and trend strength
 KL Divergence: Statistical comparison of price distributions
 Technical Overlays: RSI and Bollinger Bands integration
 Filter System: Volume and trend validation
 Visual Dashboard: Dynamic color-coded display of all components
 Simultaneous current timeframe + higher time frame analysis
 
 🚨Important Explanation Feature🚨 
 By hovering over each individual cell in this comprehensive dashboard, you will get a thorough and in depth explanation of what each cells is showing you
 Visualization 
 HTF Visualization 
 📌 Usage Guidelines 
 
 Based on your own trading style you should alter the timeframe length that you would like to be analyzing with your dashboard
 The longer the term of the position you are planning on entering the higher timeframe you should have your dashboard set to
 
 Bias Interpretation: 
 
 Values > 50% indicate bullish bias
 Values < 50% indicate bearish bias
 Neutral zone: 45-55% suggests consolidation
 
 ✅ Best Practices: 
 
 Use appropriate timeframe preset for your trading style
 Monitor all components for convergence/divergence
 Consider filter strength for signal validation
 Use color intensity as confidence indicator
 
 ⚠️ Limitations 
 
 Requires sufficient historical data for accurate calculations
 Higher computational complexity on lower timeframes
 May lag during extremely volatile conditions
 Best performance during regular market hours
 
 What Makes This Unique 
 
 Multi-Component Analysis:  Combines complexity theory, statistical analysis, and traditional technical indicators
 Adaptive Parameters:  Automatically optimizes settings based on timeframe
 Triple-Layer Filtering:  Uses trend, volume, and minimum strength thresholds
 Visual Confidence System:  Color intensity indicates signal strength
 Multi-Timeframe Capabilities:  Allowing the trader to analyze not only their current time frame but also the higher timeframe bias
 
 🔧 How It Works 
The indicator processes market data through four main components:
 
 Complexity Score (40% weight):  Analyzes price returns and pattern complexity
 Kullback Leibler Divergence (30% weight):  Compares current and historical price distributions
 RSI Analysis (20% weight):  Momentum and oversold/overbought conditions
 Bollinger Band Position (10% weight):  Price position relative to volatility
 
 Underlying Method 
 
 Maintains rolling windows of price data for multiple calculations
 Applies custom normalization using hyperbolic tangent function
 Weights component scores based on reliability and importance
 Generates final bias percentage with confidence visualization
 
 💡  Note:  For optimal results, use in conjunction with price action analysis and consider multiple timeframe confirmation. The indicator performs best when all components show alignment.






















