Smart S/R ZonesThis is not your average S/R script.
It combines proximity, bounce frequency, and volume clustering to automatically identify the most reliable support and resistance zones on your chart — no guesswork needed.
How It Works:
• Scans for recent highs/lows, SMA50 & SMA200, and pivot swing points
• Ranks each potential level using a weighted scoring system:
• Proximity to current price (50%)
• Bounce Count (30%) — how many times price respected that level
• Volume Score (20%) — how much volume traded around that level
• The top support and resistance levels are plotted with:
• Clear dashed lines
• Color-filled zones
• Simple percentage distance labels
Why This Script Stands Out:
• No settings to tweak — it just works
• Helps you react faster with high-confidence levels
• Adapts to any market: crypto, forex, stocks, indexes
• Ideal for both intraday and swing trading setups
Built-in Intelligence. Clean Visuals. Zero Noise.
Trend Analysis
AlgoRanger Dynamic Trend Flow + Smart Buy and Sell📊 AlgoRanger Dynamic Trend Flow + Smart Buy/Sell
An Intelligent Trend Indicator with Automated Buy & Sell Signals
🔍 What This Indicator Does:
This indicator dynamically visualizes market trend direction using color-coded zones (green for bullish, red for bearish), along with automated Buy/Sell labels to guide your entry and exit points.
🟢 Green Zones = Bullish Trend
🔴 Red Zones = Bearish Trend
✅ Buy/Sell Labels = Smart signals based on momentum and trend strength
Perfect for trend-following traders looking for a clean, simple visual to assess trend direction and make confident trading decisions.
⭐ Best Used with Line Chart (Not Candlesticks)
This indicator is designed to work best with Line Charts, which emphasize price flow and trend direction without the noise of candlestick wicks.
Using it with Line Charts provides a clearer visualization of Trend Flow and smoother signal recognition.
It reduces market noise, especially on lower timeframes, improving accuracy in identifying trend changes.
🧠 How to Use:
1. Watch for Zone Colors
Green Zone = Look for Buy opportunities
Red Zone = Look for Sell opportunities
Frequent color shifts = Ranging market — use caution
2. Follow Buy/Sell Signals
Buy Signal: When the zone turns green and a Buy label appears
Sell Signal: When the zone turns red and a Sell label appears
Tip: Signals work best in trending conditions where zones hold direction consistently
⚙️ Customization & Flexibility
Adjustable smoothing and sensitivity settings (for short- or long-term trends)
Turn Buy/Sell labels on/off
GRU-Inspired Buy/Sell IndicatorIndicator created using the GRU-Inspired Buy/Sell Indicator principles.
SuperTrend: Silent Shadow 🕶️ SuperTrend: Silent Shadow — Operate in trend. Vanish in noise.
Overview
SuperTrend: Silent Shadow is an enhanced trend-following system designed for traders who demand clarity in volatile markets and silence during indecision.
It combines classic Supertrend logic with a proprietary ShadowTrail engine and an adaptive Silence Protocol to filter noise and highlight only the cleanest signals.
Key Features
✅ Core Supertrend Logic
Built on Average True Range (ATR), this trend engine identifies directional bias with visual clarity. Lines adjust dynamically with price action and flip when meaningful reversals occur.
✅ ShadowTrail: Stepped Counter-Barrier
ShadowTrail doesn’t predict reversals — it reinforces structure.
When price is trending, ShadowTrail forms a stepped ceiling in downtrends and a stepped floor in uptrends. This visual containment zone helps define the edges of price behavior and offers a clear visual anchor for stop-loss placement and trade containment.
✅ Silence Protocol: Adaptive Noise Filtering
During low-volatility zones, the system enters “stealth mode”:
• Trend lines turn white to indicate reduced signal quality
• Fill disappears to reduce distraction
This helps avoid choppy entries and keeps your focus sharp when the market isn’t.
✅ Visual Support & Stop-Loss Utility
When trendlines flatten or pause, they naturally highlight price memory zones. These flat sections often align with:
• Logical stop-loss levels
• Prior support/resistance areas
• Zones of reduced volatility where price recharges or rejects
✅ Custom Styling
Full control over line colors, width, transparency, fill visibility, and silence behavior. Tailor it to your strategy and visual preferences.
How to Use
• Use Supertrend color to determine bias — flips mark momentum shifts
• ShadowTrail mirrors the primary trend as a structural ceiling/floor
• Use flat segments of both lines to identify consolidation zones or place stops
• White lines = low-quality signal → stand by
• Combine with RSI, volume, divergence, or your favorite tools for confirmation
Recommended For:
• Traders seeking clearer trend signals
• Avoiding false entries in sideways or silent markets
• Identifying key support/resistance visually
• Structuring stops around real market containment levels
• Scalping, swing, or position trading with adaptive clarity
Built by Sherlock Macgyver
Forged for precision. Designed for silence.
When the market speaks, you listen.
When it doesn’t — you wait in the shadows.
CandelaCharts - Buyside & Sellside 📝 Overview
The Buyside & Sellside Liquidity Indicator is designed to identify and emphasize one of the foundational concepts within the ICT (Inner Circle Trader) trading methodology: liquidity levels.
This tool focuses on pinpointing key areas in the market where buy-side and sell-side liquidity is concentrated, providing traders with insights into potential price targets, reversal zones, and institutional order flow behavior.
By highlighting these liquidity zones, the indicator serves as a strategic aid in understanding market dynamics and enhancing decision-making in alignment with ICT principles.
📦 Features
Buyside & Sellside Liquidity
Invalidated Liquidity
Threshold
Styling
⚙️ Settings
Liquidity: Controls visibility of Bullish/Bearish Liquidity levels.
Invalidated: Displays the invalidated liquidity levels.
Levels: Controls the number of Liquidity levels that will be displayed.
Line Style: Customize the line style and width.
Threshold: Filter by swing points the Liquidity levels.
Labels: Control the Labels visibility.
⚡️ Showcase
Buyside & Sellside
Invalidated
🚨 Alerts
This script offers alert options for all signal types.
Bearish Signal
A bearish signal is generated when the price reaches a Buyside Liquidity level.
Bullish Signal
A bullish signal is generated when the price reaches a Sellside Liquidity level.
⚠️ Disclaimer
Trading involves significant risk, and many participants may incur losses. The content on this site is not intended as financial advice and should not be interpreted as such. Decisions to buy, sell, hold, or trade securities, commodities, or other financial instruments carry inherent risks and are best made with guidance from qualified financial professionals. Past performance is not indicative of future results.
Reversal Knockout v1.1\ Reversal Knockout v1.1 — User Manual \
Reversal Knockout is a technical indicator designed to detect potential price turning points using a dual approach: a reversal logic with bar coloring and a combined sequence of setups, countdowns, and exhaustion patterns.
\ What does this indicator do?\
\ Colors candles\ based on the relationship between two smoothed moving averages (T3).
\ Identifies overextension conditions\ based on a sequence of 9 consecutive closes aligned with price direction.
\ Confirms exhaustion\ if, after that setup, 13 follow-through conditions (countdown) are met.
\ Highlights special signals called “Knockouts”\ , which represent strong potential reversal scenarios.
\ Candle Coloring\
Candles are automatically colored to make trend and potential reversal points visually easier to interpret:
🔵 Bull Trend: User-defined color (default light blue)
🔴 Bear Trend: User-defined color (default light red)
🟡 Bullish Reversal: When price crosses below the slower average (default yellow)
🟡 Bearish Reversal: When price crosses above the slower average (default yellow)
This logic is based on the relationship between two T3 moving averages (one fast, one slow), calculated with a customizable smoothing factor.
\ Setup and Countdown Logic\
Setups (9):
A bullish setup forms if the price closes below the close from 4 bars earlier for 9 consecutive candles.
A bearish setup forms if the price closes above the close from 4 bars earlier for 9 consecutive candles.
When the ninth close is completed, a green “9” (buy) or purple “9” (sell) is displayed.
Countdowns (13):
After a setup, a follow-through phase begins.
If 13 additional conditions are met (price < low\ for buys or > high\ for sells), a purple “13” is shown, signaling potential exhaustion.
\ Knockout: Explosive Reversal Potential\
The indicator also identifies special reversal patterns called \ Knockout\ .
These signals appear when, in addition to a “9”, the price shows technical excess behavior near key support or resistance zones:
Knockout ▲ (buy): Appears below the candle when a buy signal is detected with specific downside pressure conditions.
Knockout ▼ (sell): Appears above the candle when a sell signal is detected with upside pressure conditions.
These signals stand out as high-probability reversal opportunities.
\ Usage Recommendations\
The indicator is designed to work on any timeframe, but it is recommended to use it alongside market structure and volume analysis.
“Knockout” signals may be used as high-probability trend change alerts, especially after a “13”.
Can be combined with momentum indicators and moving averages for greater effectiveness.
Moffitt Candle ClosureMoffitt Candle Closure method, wait for a closure above or below the wick of the prior opposing candle!
200W MA Extension ZonesThis indicator is specifically designed for analyzing Bitcoin on a 1-week chart. It plots the 200-week simple moving average (SMA) and visualizes key extension zones above it (50%, 100%, and 150%) to help assess long-term valuation extremes.
The zones are color-coded to highlight potential accumulation or distribution areas:
🟦 Very Cheap
🟩 Cheap
🟨 Fair Value
🟧 Expensive
🟥 Very Expensive
These visual bands help identify when Bitcoin may be significantly undervalued or overvalued relative to its long-term trend.
⚠️ Important: Use this indicator only on the weekly time frame (1W). Applying it to daily or intraday charts will not reflect the intended valuation model.
You can adjust the extension levels and shading transparency in the settings panel for personalized analysis.
[TehThomas] - Fair Value GapsThis script is designed to automatically detect and visualize Fair Value Gaps (FVGs) on your chart in a clean, intuitive, and highly responsive way. It’s built with active traders in mind, offering both dynamic updates and customization options that help you stay focused on price action without being distracted by outdated or irrelevant information.
What Are Fair Value Gaps?
Fair Value Gaps are areas on a chart where there’s an inefficiency in price, typically formed when price moves aggressively in one direction, leaving a gap between the wicks of consecutive candles. These gaps represent imbalanced price action where not all buy or sell orders were efficiently matched. As a result, they often become magnet zones where price returns later to "fill" the imbalance before continuing in its intended direction. Many traders use them as points of interest for entries, re-entries, or anticipating reversals and consolidations.
This concept is frequently used in Smart Money and ICT-based trading models, where understanding how price seeks efficiency is crucial to anticipating future moves. When combined with concepts like liquidity, displacement, and market structure, FVGs become powerful tools for technical decision-making.
Script Features & Functionality
1. Live Updating Gaps (Dynamic Shrinking)
One of the core features of this script is its ability to track and dynamically shrink Fair Value Gaps as price trades into them. Instead of leaving a static zone on your chart, the gap will adjust in real-time, reflecting the portion that has been filled. This gives you a much more accurate picture of remaining imbalance and avoids misleading zones.
2. Automatic Cleanup After Fill
Once price fully fills an FVG, the script automatically removes it from the chart. This helps keep your workspace clean and focused only on relevant price zones. There’s no need to manually manage your gaps, everything is handled behind the scenes to reduce clutter and distraction.
3. Static Mode Option
While dynamic updating is the default, some traders may prefer to keep the original size of the gap visible even after partial fills. For that reason, the script includes a toggle to switch from live-updating (shrinking) mode to static mode. In static mode, FVGs stay fixed from the moment they are drawn, giving you a more traditional visual reference point.
4. Multi-Timeframe Support (MTF)
You can now view higher timeframe FVGs, such as those from the 1H or 4H chart, while analyzing lower timeframes like the 5-minute. This allows you to see key imbalances from broader market context without having to flip between charts. FVGs from higher timeframes will be drawn distinctly so you can differentiate them at a glance.
5. Cleaner Visualization
The script is designed with clarity in mind. All drawings are streamlined, and filled gaps are removed to maintain a minimal, distraction-free chart. This makes it easier to combine this tool with other indicators or price-action-based strategies without overloading your workspace.
6. Suitable for All Market Types
This script can be used on any asset that displays candlestick-based price action — including crypto, forex, indices, and stocks. Whether you're scalping low-timeframe setups or swing trading with a higher timeframe bias, FVGs remain a useful concept and this script adapts to your trading style.
Use Case Examples
On a 5-minute chart, display 1-hour FVGs to catch major imbalance zones during intraday trading.
Combine the FVGs with liquidity levels and inducement patterns to build ICT-style trade setups.
Use live-updating gaps to monitor in-progress fills and evaluate whether a zone still holds validity.
Set the script to static mode to perform backtesting or visual replay with historical setups.
Final Notes
Fair Value Gaps are not a standalone trading signal, but when used with market structure, liquidity, displacement, and order flow concepts, they provide high-probability trade locations that align with institutional-style trading models. This script simplifies the visualization of those zones so you can react faster, stay focused on clean setups, and eliminate unnecessary distractions.
Whether you’re trading high volatility breakouts or patiently waiting for retracements into unfilled imbalances, this tool is designed to support your edge with precision and flexibility.
___________________________________
Thanks for your support!
If you found this indicator helpful or learned something new, drop a like 👍 and leave a comment, I’d love to hear your thoughts! 🚀
Make sure to follow me for more price action insights, free indicators, and trading strategies. Let’s grow and trade smarter together! 📈
Market Structure- ZigZag, Break of Structure & Order BlocksDescription:
This script is an all-in-one market structure tool designed for traders who follow price action, Smart Money Concepts (SMC), or institutional order flow. It combines Order Block detection , Break of Structure (BOS) , Internal Structure Shifts (CHoCH) , and a ZigZag swing framework to provide a clear and actionable view of market behavior.
Key Features:
Order Blocks (OB) :
-Detects Bullish (Green) and Bearish (Red) order blocks upon valid market structure shifts.
-Optional deletion of mitigated (touched) blocks to keep charts clean.
-Customizable block duration, fill color, and border color.
Break of Structure (BOS) :
-Marks BOS with horizontal dotted lines when price breaks previous swing highs/lows.
-Confirms new trends and structural shifts.
Internal Structure Shifts (CHoCH-like) :
-Detects early internal changes in direction before BOS.
-User-selectable logic: based on candle Open or High/Low.
-Plotted as small black triangle markers.
ZigZag Swings :
-Connects confirmed internal shifts with black zigzag lines.
-Visually simplifies trend structure and major swing points.
-Tracks last swing highs/lows for BOS validation.
Alerts :
-Bullish/Bearish Engulfments (OB signals)
-Internal Structure Shifts
-Bullish/Bearish Break of Structure
-OB Mitigation Events
Inputs & Settings :
-Show/Hide Bullish or Bearish Order Blocks
-Calculate internal shifts by: Open or High/Low
-Set order block fill and border colors
-Enable or disable automatic deletion of mitigated blocks
-Set duration for order block display
This tool is designed to support price action trading by visually mapping key structural changes and zones of interest directly on your chart. It is not intended to function as a standalone trading strategy , but rather as a supplementary tool to inform your own analysis and discretion.
EMA 9/21/50 + VWAP + MACD + RSI Pro [v7]Updated to make table update on bar close, any time frame. Removed RSI plots
Granger Causality Flow IndicatorGranger Causality Flow Indicator (GC Flow)
█ OVERVIEW
The Granger Causality Flow Indicator (GC Flow) attempts to quantify the potential predictive relationship between two user-selected financial instruments (Symbol X and Symbol Y). In essence, it explores whether the past values of one series (e.g., Symbol X) can help explain the current value of another series (e.g., Symbol Y) better than Y's own past values alone.
This indicator provides a "Granger Causality Score" (GC Score) for both directions (X → Y and Y → X). A higher score suggests a stronger statistical linkage where one series may lead or influence the other. The indicator visualizes this "flow" of potential influence through background colors and on-chart text.
Important Note: "Granger Causality" does not imply true economic or fundamental causation. It is a statistical concept indicating predictive power or information flow. This implementation also involves simplifications (notably, using AR(1) models) due to the complexities of full Vector Autoregression (VAR) models in Pine Script®.
█ HOW IT WORKS
The indicator's methodology is based on comparing the performance of Autoregressive (AR) models:
1. Data Preprocessing:
Fetches historical close prices for two user-defined symbols (X and Y).
Optionally applies first-order differencing (`price - price `) to the series. Differencing is a common technique to achieve a proxy for stationarity, which is an underlying assumption for Granger Causality tests. Non-stationary series can lead to spurious correlations.
2. Autoregressive (AR) Models (Simplified to AR(1)):
Due to Pine Script's current limitations for complex multivariate time series models, this indicator uses simplified AR(1) models (where the current value is predicted by its immediately preceding value).
Restricted Model (for Y → Y): Predicts the target series (e.g., Y) using only its own past value (Y ).
`Y = c_R + a_R * Y + residuals_R`
The variance of `residuals_R` (Var_R) is calculated.
Unrestricted Model (Proxy for X → Y): To test if X Granger-causes Y, the indicator examines if the past values of X (X ) can explain the residuals from the restricted model of Y.
`residuals_R = c_UR' + b_UR * X + residuals_UR`
The variance of these final `residuals_UR` (Var_UR) is calculated.
The same process is repeated to test if Y Granger-causes X.
3. Granger Causality (GC) Score Calculation:
The GC Score quantifies the improvement in prediction from adding the other series' past values. It's calculated as:
`GC Score = 1 - (Var_UR / Var_R)`
A score closer to 1 suggests that the "causing" series significantly reduces the unexplained variance of the "target" series (i.e., Var_UR is much smaller than Var_R), indicating stronger Granger causality.
A score near 0 (or capped at 0 if Var_UR >= Var_R) suggests little to no improvement in prediction.
The score is calculated over a rolling `Calculation Window`.
Pine Script® Snippet (Conceptual GC Score Logic):
// Conceptual representation of GC Score calculation
// var_R: Variance of residuals when Y is predicted by Y
// var_UR: Variance of residuals when Y's AR(1) residuals are predicted by X
score = 0.0
if var_R > 1e-9 // Avoid division by zero
score := 1.0 - (var_UR / var_R)
score := score < 0 ? 0 : score // Ensure score is not negative
4. Determining Causal Flow:
The calculated GC Scores for X → Y and Y → X are compared against a user-defined `Significance Threshold for GC Score`.
If GC_X→Y > threshold AND GC_Y→X > threshold: Bidirectional flow.
If GC_X→Y > threshold only: X → Y flow.
If GC_Y→X > threshold only: Y → X flow.
Otherwise: No significant flow.
█ HOW TO USE IT
Interpreting the Visuals:
Background Color:
Green: Indicates X → Y (Symbol 1 potentially leads Symbol 2).
Orange: Indicates Y → X (Symbol 2 potentially leads Symbol 1).
Blue: Indicates Bidirectional influence.
Gray: No significant Granger causality detected based on the threshold.
Data Window Plots: The actual GC Scores for X → Y (blue) and Y → X (red) are plotted and visible in TradingView's Data Window. A dashed gray line shows your `Significance Threshold`.
On-Chart Table (Last Bar): Displays the currently detected causal direction text (e.g., "BTCUSDT → QQQ").
Potential Applications:
Intermarket Analysis: Explore potential lead-lag relationships between different asset classes (e.g., commodities and equities, bonds and currencies).
Pair Trading Components: Identify if one component of a potential pair tends to lead the other.
Confirmation Tool: Use alongside other analyses to see if a move in one asset might foreshadow a move in another.
Considerations:
Symbol Choice: Select symbols that have a plausible economic or market relationship.
Stationarity: Granger Causality tests ideally require stationary time series. The `Use Differencing` option is a simple proxy. True stationarity testing is complex. Non-stationary data can yield misleading results.
Lag Order (p): This indicator is fixed at p=1 due to Pine Script® limitations. In rigorous analysis, selecting the optimal lag order is crucial.
Calculation Window: Shorter windows are more responsive but may be noisier. Longer windows provide smoother scores but lag more.
Significance Threshold: Adjust this based on your desired sensitivity for detecting causal links. There's no universally "correct" threshold; it depends on the context and noise level of the series.
█ INPUTS
Symbol 1 (X): The first symbol in the analysis.
Symbol 2 (Y): The second symbol (considered the target when testing X → Y).
Use Differencing: If true, applies first-order differencing to both series as a proxy for stationarity.
Calculation Window (N): Lookback period for AR model coefficient estimation and variance calculations.
Lag Order (p): Currently fixed at 1. This defines the lag used (e.g., X , Y ) in the AR models.
Significance Threshold for GC Score: A value between 0.01 and 0.99. The calculated GC Score must exceed this to be considered significant.
█ VISUALIZATION
Background Color: Dynamically changes based on the detected Granger causal flow (Green for X → Y, Orange for Y → X, Blue for Bidirectional, Gray for None).
GC Scores (Data Window):
Blue Plot: GC Score for X → Y.
Red Plot: GC Score for Y → X.
Significance Threshold Line: A dashed gray horizontal line plotted at the level of your input threshold.
On-Chart Table: Displayed on the top-right (on the last bar), showing the current causal direction text.
█ ALERTS
The indicator can generate alerts for:
Emergence of X → Y causality.
Emergence of Y → X causality.
General change or cessation of a previously detected causal relationship.
█ IMPORTANT DISCLAIMERS & LIMITATIONS
Correlation vs. Causation: Granger causality measures predictive power, not true underlying economic causation. A strong GC Score doesn't prove one asset *causes* another to move, only that its past values improve predictions.
Stationarity Assumption: While differencing is offered, it's a simplified approach. Non-stationary data can lead to spurious (false) Granger causality detection.
Model Simplification (AR(1)): This script uses AR(1) models for simplicity. Real-world relationships can involve more complex dynamics and higher lag orders. The fixed lag of p=1 is a significant constraint.
Sensitivity to Parameters: Results can be sensitive to the chosen symbols, calculation window, differencing option, and significance threshold.
No Statistical Significance Testing (p-values): This indicator uses a direct threshold on the GC Score itself, not a formal statistical test (like an F-test producing p-values) typically found in econometric software.
Use this indicator as an exploratory tool within a broader analytical framework. Do not rely on it as a standalone basis for trading decisions.
█ CREDITS & LICENSE
Author: mastertop ( Twitter: x.com )
Version: 1.0 (Released: 2025-05-08)
This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
© mastertop, 2025
Asian Range + Midpoint + Liquidity Grab AlertsPlot Asian Range 12am to 08am GMT with Midpoint and Liquidity Grab Alerts
Interests Zones | @CRYPTOKAZANCEVInterests Zones (POI)
The indicator highlights key Interests Zones on the chart (i.e. support and resistance levels)
Developed based on the trading strategy of Pavel Kazantsev @cryptokazancev
Developer - @ZeeZeeMon
Зоны интереса (POI)
Индикатор выделяет на графике ключевые зоны интереса (то есть уровни поддержки и сопротивления)
Разработаны на основе торговой стратегии Павла Казанцева @cryptokazancev
Разработчик - @ZeeZeeMon
Inside Bar IndicatorFind Inside Bar helps price action traders spot inside bars without having to watch the chart constantly.
Adaptive Hurst Exponent Regime FilterAdaptive Hurst Exponent Regime Filter (AHERF)
█ OVERVIEW
The Adaptive Hurst Exponent Regime Filter (AHERF) is designed to identify the prevailing market regime—be it Trending, Mean-Reverting, or a Random Walk/Transition phase. While the Hurst Exponent is a well-known tool for this purpose, AHERF introduces a key innovation: an adaptive threshold . Instead of relying solely on the traditional fixed 0.5 Hurst value, this indicator's threshold dynamically adjusts based on current market volatility, aiming to provide more nuanced and responsive regime classifications.
This tool can assist traders in:
Gauging the current character of the market.
Tailoring trading strategies to the identified regime (e.g., deploying trend-following systems in Trending markets or mean-reversion tactics in Mean-Reverting conditions).
Filtering out trades that may be counterproductive to the dominant market behavior.
█ HOW IT WORKS
The indicator operates through the following key calculations:
1. Hurst Exponent Calculation:
The script computes an approximate Hurst Exponent (H). It utilizes log price changes as its input series.
The `calculateHurst` function implements a variance scaling approach:
It defines three sub-periods based on the main `Hurst Lookback Period`.
It calculates the standard deviation of the input series over these sub-periods.
The Hurst Exponent is then estimated from the slope of a log-log regression between the standard deviations and their respective sub-period lengths. A simplified calculation using the first and last sub-periods is performed: `H = (log(StdDev3) - log(StdDev1)) / (log(N3) - log(N1))`.
Theoretically, a Hurst Exponent:
H > 0.5 suggests persistence (trending behavior).
H < 0.5 suggests anti-persistence (mean-reverting behavior).
H ≈ 0.5 suggests a random walk (unpredictable movement).
Pine Script® Snippet (Hurst Calculation Call):
float logPriceChange = math.log(close) - math.log(close );
// ... ensure logPriceChange is not na on first bar ...
float hurstValue = calculateHurst(logPriceChange, hurstLookbackInput);
2. Volatility Proxy Calculation:
To enable the adaptive nature of the threshold, a volatility proxy is calculated.
Users can select the `Volatility Metric` to be either:
Average True Range (ATR), normalized by the closing price.
Standard Deviation (StdDev) of simple price returns.
This proxy quantifies the current degree of price activity or fluctuation in the market.
Pine Script® Snippet (Volatility Proxy Call):
float volatilityProxy = getVolatilityProxy(volatilityMetricInput, volatilityLookbackInput);
3. Adaptive Threshold Calculation:
This is the core of AHERF's adaptability. Instead of a static 0.5 line as the sole determinant, the script computes a dynamic threshold.
The adaptive threshold is calculated as: `0.5 + (Threshold Sensitivity * Volatility Proxy)`.
This means the threshold starts at the baseline 0.5 level and then adjusts upwards or downwards based on the current `volatilityProxy` scaled by the `Threshold Sensitivity (k)` input.
Pine Script® Snippet (Adaptive Threshold Calculation):
float adaptiveThreshold = 0.5 + sensitivityInput * nz(volatilityProxy, 0.0);
4. Regime Identification:
The prevailing market regime is determined by comparing the `hurstValue` to this `adaptiveThreshold`, incorporating a `Threshold Buffer` to reduce noise and clearly delineate zones:
Trending: `hurstValue > adaptiveThreshold + bufferInput`
Mean-Reverting: `hurstValue < adaptiveThreshold - bufferInput`
Random/Transition: Otherwise (Hurst value is within the buffer zone around the adaptive threshold).
Pine Script® Snippet (Regime Determination Logic):
if not na(hurstValue) and not na(adaptiveThreshold)
if hurstValue > adaptiveThreshold + bufferInput
currentRegimeColor := TRENDING_COLOR
regimeText := "Trending"
else if hurstValue < adaptiveThreshold - bufferInput
currentRegimeColor := MEAN_REVERTING_COLOR
regimeText := "Mean-Reverting"
// else remains Random/Transition
█ HOW TO USE IT
Interpreting the Visuals:
Observe the plotted `Hurst Exponent (H)` line (White) relative to the `Adaptive Threshold` line (Orange).
The background color provides an immediate indication of the current regime: Green for Trending, Red for Mean-Reverting, and Gray for Random/Transition.
The fixed `0.5 Level` (Dashed Gray) is plotted for reference against traditional Hurst interpretation.
Labels "T", "M", and "R" appear below bars to signal new entries into Trending, Mean-Reverting, or Random/Transition regimes, respectively.
Inputs Customization:
Hurst Exponent Calculation
Hurst Lookback Period: Defines the number of bars used for the Hurst Exponent calculation. Longer periods generally yield smoother Hurst values, reflecting longer-term market memory. Shorter periods are more responsive.
Adaptive Threshold Settings
Volatility Metric: Choose "ATR" or "StdDev" to drive the adaptive threshold. Experiment to see which best suits the asset.
Volatility Lookback: The lookback period for the selected volatility metric.
Threshold Sensitivity (k): A crucial multiplier determining how strongly volatility influences the adaptive threshold. Higher values mean volatility has a greater impact, potentially widening or shifting the regime bands more significantly.
Threshold Buffer: Creates a neutral zone around the adaptive threshold. This helps prevent overly frequent regime shifts due_to minor Hurst fluctuations.
█ ORIGINALITY AND USEFULNESS
The AHERF indicator distinguishes itself by:
Implementing an adaptive threshold mechanism for Hurst Exponent analysis. This threshold dynamically responds to changes in market volatility, offering a more flexible approach than a fixed 0.5 reference, potentially leading to more contextually relevant regime detection.
Providing clear, at-a-glance visualization of market regimes through background coloring and distinct plot shapes.
Offering user-configurable parameters for both the Hurst calculation and the adaptive threshold components, allowing for tuning across various assets and timeframes.
Traders can leverage AHERF to better align their chosen strategies with the prevailing market character, potentially enhancing trade filtering and decision-making processes.
█ VISUALIZATION
The indicator plots the following in a separate pane:
Hurst Exponent (H): A white line representing the calculated Hurst value.
Adaptive Threshold: An orange line representing the dynamic threshold.
Fixed 0.5 Level: A dashed gray horizontal line for traditional Hurst reference.
Background Color: Changes based on the identified regime:
Green: Trending regime.
Red: Mean-Reverting regime.
Gray: Random/Transition regime.
Regime Entry Shapes: Plotted below the price bars (forced overlay for visibility):
"T" (Green Label): Signals entry into a Trending regime.
"M" (Teal Label): Signals entry into a Mean-Reverting regime.
"R" (Cyan Label): Signals entry into a Random/Transition regime.
█ ALERTS
The script provides alert conditions for changes in the market regime:
Regime Shift to Trending: Triggers when the Hurst Exponent crosses above the adaptive threshold into a Trending state.
Regime Shift to Mean-Reverting: Triggers when the Hurst Exponent crosses below the adaptive threshold into a Mean-Reverting state.
Regime Shift to Random/Transition: Triggers when the Hurst Exponent enters the Random/Transition zone around the adaptive threshold.
These can be configured directly from the TradingView alerts panel.
█ NOTES & DISCLAIMERS
The Hurst Exponent calculation is an approximation; various methods exist, each with its nuances.
The performance and relevance of the identified regimes can differ across financial instruments and timeframes. Parameter tuning is recommended.
This indicator is intended as a decision-support tool and should not be the sole basis for trading decisions. Always integrate its signals within a broader analytical framework.
Past performance of any trading system or indicator, including those derived from AHERF, is not indicative of future results.
█ CREDITS & LICENSE
Author: mastertop ( Twitter: x.com )
Color Palette: Uses the `MaterialPalette` library by MASTERTOP_ASTRAY.
This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
© mastertop, 2025
π Pi-MA Bandπ Pi-MA Band – Parametric Moving Averages with π Scaling
The π Pi-MA Band is a custom moving average indicator that applies the mathematical constant π (3.14159) as a multiplier to traditional moving average lengths, offering a unique perspective on market smoothing and trend detection.
🔍 Core Features:
Three Dynamic MAs: Includes a Fast, Slow, and Long moving average, each with customizable base lengths and types (EMA, SMA, WMA, HMA, RMA, VWMA, DEMA, TEMA).
π-Based Lengths: Each MA length is automatically scaled by π to align with cyclical and fractal market behavior.
Color Adaptive Bands:
The fast/slow band dynamically changes color based on trend direction (green when fast > slow, red when fast < slow).
A secondary fill highlights when both fast and slow MAs are positioned above or below the long-term MA, indicating strong bullish or bearish alignment.
Visual Clarity: Distinct line thickness and color coding for fast, slow, and long MAs make it easy to assess momentum and trend shifts.
Alerts: Built-in alert conditions notify you of key crossover events between the fast and slow MAs.
📈 Use Cases:
Trend Confirmation: Use the alignment of all three MAs to validate bullish or bearish market conditions.
Momentum Shift Detection: Crossover alerts help traders identify emerging trends early.
Customization: Suitable for scalpers, swing traders, and long-term investors due to adjustable lengths and MA types.
NIFTY Option Chain Table with Custom CE/PE Price FiltersThis Pine Script creates a powerful and visually organized option chain dashboard for NIFTY Index Options, showing 10 Call Options (CE) and 10 Put Options (PE), with real-time prices updated on a 5-minute chart.
You can filter and view only the most relevant option contracts based on your preferred price ranges, helping you make quick decisions for scalping, intraday, or positional trades.
🔍 How It Works:
You manually select up to 10 Call Option symbols and 10 Put Option symbols from NSE (e.g., NIFTY240530C18000, NIFTY240530P18000, etc.).
Keep that time options this are old options in defalt so there will be a error
The script fetches the real-time close price of each option using the request.security() function.
You define the minimum and maximum price range separately for Calls and Puts.
The script filters out any options that fall outside of your desired price range.
Only a limited number of matching options (as set by you) are displayed in the table for both Calls and Puts.
The table is shown at your preferred location on the chart (Bottom Right, Top Left, etc.).
✅ Features:
🔟 Supports exactly 10 CE and 10 PE options for tracking.
📈 Live price updates pulled directly from the chart timeframe (5-min).
🎯 Custom price filters for CE and PE (separate inputs).
📊 Show only the top X number of contracts that meet your filter criteria.
🧱 Vertical layout with clear headers and color-coded sections (green for Calls, red for Puts).
🎛️ Position the table wherever it's most convenient on your chart.
⚡ Helps you quickly spot low premium or range-bound options during the day.
📌 Use Case:
Ideal for:
Option scalpers and day traders who want to focus only on options within a specific price zone.
Traders who want to monitor multiple strikes simultaneously without clutter.
Users building custom NIFTY strategies based on option premiums.
FVG Candle HighlighterThis indicator highlights only the true Fair Value Gap (FVG) creator candle — the middle candle in a 3-bar FVG formation — with zero clutter.
🔹 Bullish FVG: Candle is colored if price gaps above the high two bars back
🔹 Bearish FVG: Candle is colored if price gaps below the low two bars back
✨ No boxes. No zones. Just pure, visual price-action accuracy.
🔧 Powered by Pine Script v6
🧠 Based on institutional-style FVG logic
🎯 Ideal for Smart Money / ICT / Order Block strategies
Trend Strength IndexThis is a refined and fixed version of the classic True Strength Index (TSI) indicator. TSI is a momentum oscillator developed by William Blau that captures both trend direction and strength by analyzing the double-smoothed price momentum.
Unlike the standard version, this script is fixed to only update on closed candles, ensuring signals are stable and do not repaint or fluctuate mid-bar—ideal for traders who want reliable confirmation before making decisions.
Key Features:
Double EMA smoothing of momentum
Stable and reliable signal generation
Perfect for spotting reversals and trend continuations
Fixed updates only at candle close
Best used in combination with trend-following tools, divergences, or price action for maximum effectiveness
Sunday OpenThis indicator shows the opening price of the daily candle on Sunday .
This price range is a good confirmation for the price reversal. Also, this level is a strong range from which the price gives a good reaction .
This Sunday open line can be used as an additional confirmation to the trading strategy to have a clearer entry point.