MVRV | Lyro RS📊 MVRV | Lyro RS is a powerful on-chain valuation tool designed to assess the relative market positioning of Bitcoin (BTC) or Ethereum (ETH) based on the Market Value to Realized Value (MVRV) ratio. It highlights potential undervaluation or overvaluation zones, helping traders and investors anticipate cyclical tops and bottoms.
✨ Key Features :
🔁 Dual Asset Support: Analyze either BTC or ETH with a single toggle.
📐 Dynamic MVRV Thresholds: Automatically calculates median-based bands at 50%, 64%, 125%, and 170%.
📊 Median Calculation: Period-based median MVRV for long-term trend context.
💡 Optional Smoothing: Use SMA to smooth MVRV for cleaner analysis.
🎯 Visual Threshold Alerts: Background and bar colors change based on MVRV position relative to thresholds.
⚠️ Built-in Alerts: Get notified when MVRV enters under- or overvalued territory.
📈 How It Works :
💰 MVRV Calculation: Uses data from IntoTheBlock and CoinMetrics to obtain real-time MVRV values.
🧠 Threshold Bands: Median MVRV is used as a baseline. Ratios like 50%, 64%, 125%, and 170% signal various levels of market extremes.
🎨 Visual Zones: Green zones for undervaluation and red zones for overvaluation, providing intuitive visual cues.
🛠️ Custom Highlights: Toggle individual threshold zones on/off for a cleaner view.
⚙️ Customization Options :
🔄 Switch between BTC or ETH for analysis.
📏 Adjust period length for median MVRV calculation.
🔧 Enable/disable threshold visibility (50%, 64%, 125%, 170%).
📉 Toggle smoothing to reduce noise in volatile markets.
📌 Use Cases :
🟢 Identify undervalued zones for long-term entry opportunities.
🔴 Spot potential overvaluation zones that may precede corrections.
🧭 Use in confluence with price action or macro indicators for better timing.
⚠️ Disclaimer :
This indicator is for educational purposes only. It should not be used in isolation for making trading or investment decisions. Always combine with price action, fundamentals, and proper risk management.
Statistics
Anchored Probability Cone by TenozenFirst of all, credit to @nasu_is_gaji for the open source code of Log-Normal Price Forecast! He teaches me alot on how to use polylines and inverse normal distribution from his indicator, so check it out!
What is this indicator all about?
This indicator draws a probability cone that visualizes possible future price ranges with varying levels of statistical confidence using Inverse Normal Distribution , anchored to the start of a selected timeframe (4h, W, M, etc.)
Feutures:
Anchored Cone: Forecasts begin at the first bar of each chosen higher timeframe, offering a consistent point for analysis.
Drift & Volatility-Based Forecast: Uses log returns to estimate market volatility (smoothed using VWMA) and incorporates a trend angle that users can set manually.
Probabilistic Price Bands: Displays price ranges with 5 customizable confidence levels (e.g., 30%, 68%, 87%, 99%, 99,9%).
Dynamic Updating: Recalculates and redraws the cone at the start of each new anchor period.
How to use:
Choose the Anchored Timeframe (PineScript only be able to forecast 500 bars in the future, so if it doesn't plot, try adjusting to a lower anchored period).
You can set the Model Length, 100 sample is the default. The higher the sample size, the higher the bias towards the overall volatility. So better set the sample size in a balanced manner.
If the market is inside the 30% conifidence zone (gray color), most likely the market is sideways. If it's outside the 30% confidence zone, that means it would tend to trend and reach the other probability levels.
Always follow the trend, don't ever try to trade mean reversions if you don't know what you're doing, as mean reversion trades are riskier.
That's all guys! I hope this indicator helps! If there's any suggestions, I'm open for it! Thanks and goodluck on your trading journey!
Nowein-Anchored VWAP with 1% Bands Anchored VWAP with ±1% Bands Starting at 9:00 AM
This indicator calculates an Anchored Volume Weighted Average Price (VWAP) starting precisely at 9:00 AM each trading day (customizable). It plots the VWAP line alongside two dynamic bands set at ±1% above and below the VWAP. The bands help visualize potential support and resistance zones relative to the intraday VWAP anchored at market open.
Key Features:
Anchors VWAP calculation to user-defined start time (default 9:00 AM)
Displays VWAP line in orange for easy tracking
Shows upper and lower dashed bands at ±1% of VWAP in green and red, respectively
Bands update dynamically with each new bar throughout the trading day
Designed for intraday charts (1-minute, 5-minute, etc.)
Use this tool to better assess intraday price action around VWAP and identify potential trading opportunities based on price deviations from the anchored VWAP.
CANSLIM Từng Bước"CANSLIM Step-by-Step" Indicator Description for TradingView
CANSLIM Step-by-Step - Your Companion for Evaluating Stocks with the CANSLIM Methodology
Welcome, investors, to "CANSLIM Step-by-Step"! This indicator is designed to assist you in analyzing and evaluating stocks based on the seven core criteria of William J. O'Neil's renowned CANSLIM investment methodology.
Purpose of the Indicator:
This tool is not intended to provide fully automated buy/sell recommendations. Instead, it focuses on "digitizing" and visualizing each step in the CANSLIM evaluation process, helping you gain a more comprehensive and detailed overview of potential stocks.
Key Features:
Evaluation of 7 CANSLIM Criteria:
C (Current Quarterly Earnings): Allows manual input for the latest quarterly EPS growth (%) and positive EPS status. It also attempts to fetch data automatically (which may not be stable for all symbols) for comparison.
A (Annual Earnings & ROE): Prioritizes manual input for annual EPS growth rate (CAGR) and current ROE to ensure accuracy.
N (New Highs): Automatically analyzes price action from the chart to determine if the stock is near or making a new 52-week high.
S (Supply and Demand - Volume): Automatically analyzes current trading volume against its average to detect significant surges.
L (Leader or Laggard): You evaluate and input whether the stock is a market or industry leader.
I (Institutional Sponsorship): You evaluate and input the quality and quantity of significant institutional ownership.
M (Market Direction): Automatically analyzes the trend of a reference market index (e.g., VNINDEX) using moving averages.
Prioritized Manual Input for Financial Data: For criteria C and A, the indicator allows and encourages manual input to ensure the highest accuracy, given the inherent limitations of automatically accessing consistently updated financial data via Pine Script.
"Super Compact" Summary Table:
Clearly displays the status (Pass/Fail/N/A) of each criterion using color codes.
Provides specific values for each criterion (e.g., growth percentage, distance to 52-week high, volume ratio).
Aggregates a total score (out of 7) and a star rating (0 to 7 stars) for a quick overview of the stock's CANSLIM compliance.
Customizable Thresholds: You can adjust the evaluation thresholds for various criteria (e.g., minimum EPS growth %, minimum ROE %) to suit your risk appetite and personal standards.
How to Use Effectively:
Step 1: Select the stock symbol you wish to analyze.
Step 2: Open the indicator's settings:
Manually input your research findings for criteria C, A, L, and I.
Adjust thresholds and parameters for N, S, and M if needed.
Select the appropriate market index symbol for criterion M.
Step 3: Observe the summary table in the bottom-right corner of your screen for the overall assessment and detailed breakdown of each criterion.
"CANSLIM Step-by-Step" is a companion tool designed to help you systematize your stock evaluation process according to one of the most successful investment methodologies. Combine this indicator with your knowledge and experience to make informed investment decisions!
Commitment to Ongoing Development
We wish to share that the current "CANSLIM Step-by-Step" indicator is the initial version in our journey to build a more comprehensive CANSLIM stock evaluation support tool.
Our vision is to continuously develop and enhance this indicator with the following goals:
Increase Automation Capabilities: Explore solutions to automatically update certain basic financial data (for criteria C, A) more reliably and consistently, within the technical limits of Pine Script and available data sources.
Add Deeper Analytical Features: Such as visualizing changes in criteria over time, or comparisons with industry peers (where feasible).
Improve User Interface: Make data input and tracking even more intuitive and convenient.
Listen to and Integrate Community Feedback: We highly value all user feedback, bug reports, and feature suggestions to make "CANSLIM Step-by-Step" an increasingly useful tool.
This is a dedicated project, and we are committed to continually working to make "CANSLIM Step-by-Step" an even more powerful assistant for investors following the CANSLIM philosophy.
Daily Price RangeThe indicator is designed to analyze an instrument’s volatility based on daily extremes (High-Low) and to compare the current day’s range with the typical (median) range over a selected period. This helps traders assess how much of the "usual" daily movement has already occurred and how much may still be possible during the trading day.
Anchored VWAP with Bands DebugAnchored VWAP with ±1% Bands Starting at 9:00 AM
This indicator calculates an Anchored Volume Weighted Average Price (VWAP) starting precisely at 9:00 AM each trading day (customizable). It plots the VWAP line alongside two dynamic bands set at ±1% above and below the VWAP. The bands help visualize potential support and resistance zones relative to the intraday VWAP anchored at market open.
Key Features:
Anchors VWAP calculation to user-defined start time (default 9:00 AM)
Displays VWAP line in orange for easy tracking
Shows upper and lower dashed bands at ±1% of VWAP in green and red, respectively
Bands update dynamically with each new bar throughout the trading day
Designed for intraday charts (1-minute, 5-minute, etc.)
Use this tool to better assess intraday price action around VWAP and identify potential trading opportunities based on price deviations from the anchored VWAP.
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
SOPR with Z-Score Table📊 Glassnode SOPR with Dynamic Z-Score Table
ℹ️ Powered by Glassnode On-Chain Metrics
📈 Description:
This indicator visualizes the Spent Output Profit Ratio (SOPR) for major cryptocurrencies — Bitcoin, Ethereum, and Litecoin — along with a dynamically normalized Z-Score. SOPR is a key on-chain metric that reflects whether coins moved on-chain are being sold at a profit or a loss.
🔍 SOPR is calculated using Glassnode’s entity-adjusted SOPR feed, and a custom SMA is applied to smooth the signal. The normalized Z-Score helps identify market sentiment extremes by scaling SOPR relative to its historical context.
📊 Features:
Selectable cryptocurrency: Bitcoin, Ethereum, or Litecoin
SOPR smoothed by user-defined SMA (default: 10 periods)
Upper & lower bounds (±4%) for SOPR, shown as red/green lines
Background highlighting when SOPR moves outside normal range
Normalized Z-Score scaled between –2 and +2
Live Z-Score display in a compact top-right table
🧮 Calculations:
SOPR data is sourced daily from Glassnode:
Bitcoin: XTVCBTC_SOPR
Ethereum: XTVCETH_SOPR
Litecoin: XTVCLTC_SOPR
Z-Score is calculated as:
SMA of SOPR over zscore_length periods
Standard deviation of SOPR
Z-Score = (SOPR – mean) / standard deviation
Z-Score is clamped between –2 and +2 for visual consistency
🎯 Interpretation:
SOPR > 1 implies coins are sold in profit
SOPR < 1 suggests coins are sold at a loss
When SOPR is significantly above or below its recent range (e.g., +4% or –4%), it may signal overheating or capitulation
The Z-Score contextualizes how extreme the current SOPR is relative to history
📌 Notes:
Best viewed on daily charts
Works across selected assets (BTC, ETH, LTC)
Tick Value (Top-Center Fixed)this can be used by future traders some brokers and tradingview does not use tick value given by cme for some instruments , so this gives tick value which is used by tradingview chart
BPCO Z-ScoreBPCO Z-Score with Scaled Z-Value and Table
Description:
This custom indicator calculates the Z-Score of a specified financial instrument (using the closing price as a placeholder for the BPCO value), scales the Z-Score between -2 and +2 based on user-defined thresholds, and displays it in a table for easy reference.
The indicator uses a simple moving average (SMA) and standard deviation to calculate the original Z-Score, and then scales the Z-Score within a specified range (from -2 to +2) based on the upper and lower thresholds set by the user.
Additionally, the scaled Z-Score is displayed in a separate table on the right side of the chart, providing a clear, numerical value for users to track and interpret.
Key Features:
BPCO Z-Score: Calculates the Z-Score using a simple moving average and standard deviation over a user-defined window (default: 365 days). This provides a measure of how far the current price is from its historical average in terms of standard deviations.
Scaled Z-Score: The original Z-Score is then scaled between -2 and +2, based on the user-specified upper and lower thresholds. The thresholds default to 3.5 (upper) and -1.5 (lower), and can be adjusted as needed.
Threshold Bands: Horizontal lines are plotted on the chart to represent the upper and lower thresholds. These help visualize when the Z-Score crosses critical levels, indicating potential market overbought or oversold conditions.
Dynamic Table Display: The scaled Z-Score is shown in a dynamic table at the top-right of the chart, providing a convenient reference for traders. The table updates automatically as the Z-Score fluctuates.
How to Use:
Adjust Time Window: The "Z-Score Period (Days)" input allows you to adjust the time period used for calculating the moving average and standard deviation. By default, this is set to 365 days (1 year), but you can adjust this depending on your analysis needs.
Set Upper and Lower Thresholds: Use the "BPCO Upper Threshold" and "BPCO Lower Threshold" inputs to define the bands for your Z-Score. The default values are 3.5 for the upper band and -1.5 for the lower band, but you can adjust them based on your strategy.
Interpret the Z-Score: The Z-Score provides a standardized measure of how far the current price (or BPCO value) is from its historical mean, relative to the volatility. A value above the upper threshold (e.g., 3.5) may indicate overbought conditions, while a value below the lower threshold (e.g., -1.5) may indicate oversold conditions.
Use the Scaled Z-Score: The scaled Z-Score is calculated based on the original Z-Score, but it is constrained to a range between -2 and +2. When the BPCO value hits the upper threshold (3.5), the scaled Z-Score will be +2, and when it hits the lower threshold (-1.5), the scaled Z-Score will be -2. This gives you a clear, easy-to-read value to interpret the market's condition.
Data Sources:
BPCO Data: In this indicator, the BPCO value is represented by the closing price of the asset. The calculation of the Z-Score and scaled Z-Score is based on this price data, but you can modify it to incorporate other data streams as needed (e.g., specific economic indicators or custom metrics).
Indicator Calculation: The Z-Score is calculated using the following formulas:
Mean (SMA): A simple moving average of the BPCO (close price) over the selected period (365 days by default).
Standard Deviation (Std): The standard deviation of the BPCO (close price) over the same period.
Z-Score: (Current BPCO - Mean) / Standard Deviation
Scaled Z-Score: The Z-Score is normalized to fall within a specified range (from -2 to +2), based on the upper and lower threshold inputs.
Important Notes:
Customization: The indicator allows users to adjust the period (window) for calculating the Z-Score, as well as the upper and lower thresholds to suit different timeframes and trading strategies.
Visual Aids: Horizontal lines are drawn to represent the upper and lower threshold levels, making it easy to visualize when the Z-Score crosses critical levels.
Limitations: This indicator relies on historical price data (or BPCO) and assumes that the standard deviation and mean are representative of future price behavior. It does not account for potential market shifts or extreme events that may fall outside historical norms.
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
MVRVZ BTCMVRVZ BTC (Market Value to Realized Value Z-Score)
Description:
The MVRVZ BTC indicator provides insights into the relationship between the market value and realized value of Bitcoin, using the Market Value to Realized Value (MVRV) ratio, which is then adjusted using a Z-Score. This indicator highlights potential market extremes and helps in identifying overbought or oversold conditions, offering a unique perspective on Bitcoin's valuation.
How It Works:
MVRVZ is calculated by taking the difference between Bitcoin's Market Capitalization (MC) and Realized Capitalization (MCR), then dividing that by the Standard Deviation (Stdev) of the price over a specified period (usually 104 weeks).
The resulting value is plotted as the MVRVZ line, representing how far the market price deviates from its realized value.
Z-Score is then applied to the MVRVZ line, with the Z-Score bounded between +2 and -2, which allows it to be used within a consistent evaluation framework, regardless of how high or low the MVRVZ line goes. The Z-Score will reflect overbought or oversold conditions:
A Z-Score above +2 indicates the market is likely overbought (possible market top).
A Z-Score below -2 indicates the market is likely oversold (possible market bottom).
Values between -2 and +2 indicate more neutral market conditions.
How to Read the Indicator:
MVRVZ Line:
The MVRVZ line shows the relationship between market cap and realized cap. A higher value indicates the market is overvalued relative to the actual capital realized by holders.
The MVRVZ line can move above or below the top and bottom lines you define, which are adjustable according to your preferences. These lines act as trigger levels.
Top and Bottom Trigger Lines:
You can customize the Top Line and Bottom Line values to your preference.
When the MVRVZ line crosses the Top Line, the market might be considered overbought.
When the MVRVZ line crosses the Bottom Line, the market might be considered oversold.
SCDA Z-Score:
The Z-Score is displayed alongside the MVRVZ line and is bounded between -2 and +2. It scales proportionally based on the MVRVZ line's position relative to the top and bottom trigger lines.
The Z-Score ensures that even if the MVRVZ line moves beyond the trigger lines, the Z-Score will stay within the limits of -2 to +2, making it ideal for your custom evaluation system (SCDA).
Background Highlighting:
The background color changes when the MVRVZ line crosses key levels:
When the MVRVZ line exceeds the Top Trigger, the background turns red, indicating overbought conditions.
When the MVRVZ line falls below the Bottom Trigger, the background turns green, indicating oversold conditions.
Data Sources:
The data for the MVRVZ indicator is sourced from Glassnode and Coinmetrics, which provide the necessary values for:
BTC Market Cap (MC) – The total market capitalization of Bitcoin.
BTC Realized Market Cap (MCR) – The capitalization based on the price at which Bitcoin was last moved on the blockchain (realized value).
How to Use the Indicator:
Market Extremes:
Use the MVRVZ and Z-Score to spot potential market tops or bottoms.
A high Z-Score (above +2) suggests the market is overbought, while a low Z-Score (below -2) suggests the market is oversold.
Adjusting the Triggers:
Customize the Top and Bottom Trigger Lines to suit your trading strategy. These lines can act as dynamic reference points for when to take action based on the Z-Score or MVRVZ line crossing these levels.
Market Evaluation (SCDA Framework):
The bounded Z-Score (from -2 to +2) is tailored for your SCDA evaluation system, allowing you to assess market conditions based on consistent criteria, no matter how volatile the MVRVZ line becomes.
Conclusion:
The MVRVZ BTC indicator is a powerful tool for assessing the relative valuation of Bitcoin based on its market and realized capitalization. By combining it with the Z-Score, you get an easy-to-read, bounded evaluation system that highlights potential market extremes and helps you make informed decisions about Bitcoin's price behavior.
Correlation Drift📈 Correlation Drift
The Correlation Drift indicator is designed to detect shifts in market momentum by analyzing the relationship between correlation and price lag. It combines the principles of correlation analysis and lag factor measurement to provide a unique perspective on trend alignment and momentum shifts.
🔍 Core Concept:
The indicator calculates the Correlation vs PLF Ratio, which measures the alignment between an asset’s price movement and a chosen benchmark (e.g., BTCUSD). This ratio reflects how well the asset’s momentum matches the market trend while accounting for price lag.
📊 How It Works:
Correlation Calculation:
The script calculates the correlation between the asset and the selected benchmark over a specified period.
A higher correlation indicates that the asset’s price movements are in sync with the benchmark.
Price Lag Factor (PLF) Calculation:
The PLF measures the difference between long-term and short-term price momentum, dynamically scaled by recent volatility.
It highlights potential overextensions or lags in the asset’s price movements.
Combining Correlation and PLF:
The Correlation vs PLF Ratio combines these metrics to detect momentum shifts relative to the trend.
The result is a dynamic, smoothed histogram that visualizes whether the asset is leading or lagging behind the trend.
💡 How to Interpret:
Positive Values (Green/Aqua Bars):
Indicates bullish alignment with the trend.
Aqua: Rising bullish momentum, suggesting continuation.
Teal: Decreasing bullish momentum, signaling caution.
Negative Values (Purple/Fuchsia Bars):
Indicates bearish divergence from the trend.
Fuchsia: Falling bearish momentum, indicating increasing pressure.
Purple: Rising bearish momentum, suggesting potential reversal.
Clipping for Readability:
Values are clipped between -3 and +3 to prevent outliers from compressing the histogram.
This ensures clear visualization of typical momentum shifts while still marking extreme cases.
🚀 Best Practices:
Use Correlation Drift as a confirmation tool in conjunction with trend indicators (e.g., moving averages) to identify momentum alignment or divergence.
Look for transitions from positive to negative (or vice versa) as signals of potential trend shifts.
Combine with volume analysis to strengthen confidence in breakout or breakdown signals.
⚠️ Key Features:
Customizable Settings: Adjust the correlation length, PLF length, and smoothing factor to fine-tune the indicator for different market conditions.
Visual Gradient: The histogram changes color based on the strength and direction of the ratio, making it easy to identify shifts at a glance.
Zero Line Reference: Clearly distinguishes between bullish and bearish momentum zones.
🔧 Recommended Settings:
Correlation Length: 14 (for short to medium-term analysis)
PLF Length: 50 (to smooth out noise while capturing trend shifts)
Smoothing Factor: 3 (for enhanced clarity without excessive lag)
Benchmark Symbol: BTCUSD (or another relevant market indicator)
By providing a quantitative measure of trend alignment while accounting for price lag, the Correlation Drift indicator helps traders make more informed decisions during periods of momentum change. Whether you are trading crypto, forex, or equities, this tool can be a powerful addition to your momentum-based trading strategies.
⚠️ Disclaimer:
The Correlation Drift indicator is a technical analysis tool designed to aid in identifying potential shifts in market momentum and trend alignment. It is intended for informational and educational purposes only and should not be considered as financial advice or a recommendation to buy, sell, or hold any financial instrument.
Trading financial instruments, including cryptocurrencies, involves significant risk and may result in the loss of your capital. Past performance is not indicative of future results. Always conduct thorough research and seek advice from a certified financial professional before making any trading decisions.
The developer (RWCS_LTD) is not responsible for any trading losses or adverse outcomes resulting from the use of this indicator. Users are encouraged to test and validate the indicator in a simulated environment before applying it to live trading. Use at your own risk.
Future Events TableTo show any type of Future Events Table.
Example shows "astronomical cycle reversal dates" in 2025
*no change, just on a clean chart
Float LabelTakes the TradingView key stats on available float for a stock making it a clear indicator on your chart.
Hurst Exponent Oscillator [PhenLabs]📊 Hurst Exponent Oscillator -
Version: PineScript™ v5
📌 Description
The Hurst Exponent Oscillator (HEO) by PhenLabs is a powerful tool developed for traders who want to distinguish between trending, mean-reverting, and random market behaviors with clarity and precision. By estimating the Hurst Exponent—a statistical measure of long-term memory in financial time series—this indicator helps users make sense of underlying market dynamics that are often not visible through traditional moving averages or oscillators.
Traders can quickly know if the market is likely to continue its current direction (trending), revert to the mean, or behave randomly, allowing for more strategic timing of entries and exits. With customizable smoothing and clear visual cues, the HEO enhances decision-making in a wide range of trading environments.
🚀 Points of Innovation
Integrates advanced Hurst Exponent calculation via Rescaled Range (R/S) analysis, providing unique market character insights.
Offers real-time visual cues for trending, mean-reverting, or random price action zones.
User-controllable EMA smoothing reduces noise for clearer interpretation.
Dynamic coloring and fill for immediate visual categorization of market regime.
Configurable visual thresholds for critical Hurst levels (e.g., 0.4, 0.5, 0.6).
Fully customizable appearance settings to fit different charting preferences.
🔧 Core Components
Log Returns Calculation: Computes log returns of the selected price source to feed into the Hurst calculation, ensuring robust and scale-independent analysis.
Rescaled Range (R/S) Analysis: Assesses the dispersion and cumulative deviation over a rolling window, forming the core statistical basis for the Hurst exponent estimate.
Smoothing Engine: Applies Exponential Moving Average (EMA) smoothing to the raw Hurst value for enhanced clarity.
Dynamic Rolling Windows: Utilizes arrays to maintain efficient, real-time calculations over user-defined lengths.
Adaptive Color Logic: Assigns different highlight and fill colors based on the current Hurst value zone.
🔥 Key Features
Visually differentiates between trending, mean-reverting, and random market modes.
User-adjustable lookback and smoothing periods for tailored sensitivity.
Distinct fill and line styles for each regime to avoid ambiguity.
On-chart reference lines for strong trending and mean-reverting thresholds.
Works with any price series (close, open, HL2, etc.) for versatile application.
🎨 Visualization
Hurst Exponent Curve: Primary plotted line (smoothed if EMA is used) reflects the ongoing estimate of the Hurst exponent.
Colored Zone Filling: The area between the Hurst line and the 0.5 reference line is filled, with color and opacity dynamically indicating the current market regime.
Reference Lines: Dash/dot lines mark standard Hurst thresholds (0.4, 0.5, 0.6) to contextualize the current regime.
All visual elements can be customized for thickness, color intensity, and opacity for user preference.
📖 Usage Guidelines
Data Settings
Hurst Calculation Length
Default: 100
Range: 10-300
Description: Number of bars used in Hurst calculation; higher values mean longer-term analysis, lower values for quicker reaction.
Data Source
Default: close
Description: Select which data series to analyze (e.g., Close, Open, HL2).
Smoothing Length (EMA)
Default: 5
Range: 1-50
Description: Length for smoothing the Hurst value; higher settings yield smoother but less responsive results.
Style Settings
Trending Color (Hurst > 0.5)
Default: Blue tone
Description: Color used when trending regime is detected.
Mean-Reverting Color (Hurst < 0.5)
Default: Orange tone
Description: Color used when mean-reverting regime is detected.
Neutral/Random Color
Default: Soft blue
Description: Color when market behavior is indeterminate or shifting.
Fill Opacity
Default: 70-80
Range: 0-100
Description: Transparency of area fills—higher opacity for stronger visual effect.
Line Width
Default: 2
Range: 1-5
Description: Thickness of the main indicator curve.
✅ Best Use Cases
Identifying if a market is regime-shifting from trending to mean-reverting (or vice versa).
Filtering signals in automated or systematic trading strategies.
Spotting periods of randomness where trading signals should be deprioritized.
Enhancing mean-reversion or trend-following models with regime-awareness.
⚠️ Limitations
Not predictive: Reflects current and recent market state, not future direction.
Sensitive to input parameters—overfitting may occur if settings are changed too frequently.
Smoothing can introduce lag in regime recognition.
May not work optimally in markets with structural breaks or extreme volatility.
💡 What Makes This Unique
Employs advanced statistical market analysis (Hurst exponent) rarely found in standard toolkits.
Offers immediate regime visualization through smart dynamic coloring and zone fills.
🔬 How It Works
Rolling Log Return Calculation:
Each new price creates a log return, forming the basis for robust, non-linear analysis. This ensures all price differences are treated proportionally.
Rescaled Range Analysis:
A rolling window maintains cumulative deviations and computes the statistical “range” (max-min of deviations). This is compared against the standard deviation to estimate “memory”.
Exponent Calculation & Smoothing:
The raw Hurst value is translated from the log of the rescaled range ratio, and then optionally smoothed via EMA to dampen noise and false signals.
Regime Detection Logic:
The smoothed value is checked against 0.5. Values above = trending; below = mean-reverting; near 0.5 = random. These control plot/fill color and zone display.
💡 Note:
Use longer calculation lengths for major market character study, and shorter ones for tactical, short-term adaptation. Smoothing balances noise vs. lag—find a best fit for your trading style. Always combine regime awareness with broader technical/fundamental context for best results.
Statistical Reliability Index (SRI)Statistical Reliability Index (SRI)
The Statistical Reliability Index (SRI) is a professional financial analysis tool designed to assess the statistical stability and reliability of market conditions. It combines advanced statistical methods to gauge whether current market trends are statistically consistent or prone to erratic behavior. This allows traders to make more informed decisions when navigating trending and choppy markets.
Key Concepts:
1. Extrapolation of Cumulative Distribution Functions (CDF)
What is CDF?
A Cumulative Distribution Function (CDF) is a statistical tool that models the probability of a random variable falling below a certain value.
How it’s used in SRI:
The SRI utilizes the 95th percentile CDF of recent returns to estimate the likelihood of extreme price movements. This helps identify when a market is experiencing statistically significant changes, crucial for forecasting potential breakouts or breakdowns.
Weight in SRI:
The weight of the CDF extrapolation can be adjusted to emphasize its impact on the overall reliability index, allowing customization based on the trader's preference for tail risk analysis.
2. Bias Factor (BF)
What is the Bias Factor?
The Bias Factor measures the ratio of the current market price to the expected mean price calculated over a defined period. It represents the deviation from the typical price level.
How it’s used in SRI:
A higher bias factor indicates that the current price significantly deviates from the historical average, suggesting a potential mean reversion or trend exhaustion.
Weight in SRI:
Adjusting the Bias Factor weight lets users control how much this deviation influences the SRI, balancing between momentum trading and mean reversion strategies.
3. Coefficient of Variation (CV)
What is CV?
The Coefficient of Variation (CV) is a statistical measure that expresses the ratio of the standard deviation to the mean. It indicates the relative variability of asset returns, helping gauge the risk-to-return consistency.
How it’s used in SRI:
A lower CV indicates more stable and predictable price behavior, while a higher CV signals increased volatility. The SRI incorporates the inverse of the normalized CV to reflect price stability positively.
Weight in SRI:
By adjusting the CV weight, users can prioritize consistent price movements over erratic volatility, aligning the indicator with risk tolerance and strategy preferences.
Interpreting the SRI:
1. SRI Plot:
The SRI plot dynamically changes color to reflect market conditions:
Aqua Line: Indicates uptrend stability, signaling statistically consistent upward movements.
Fuchsia Line: Indicates downtrend stability, where statistically reliable downward movements are present.
The overlay background shifts between colors:
Aqua Background: Signifies statistical stability, where trends are historically consistent.
Fuchsia Background: Indicates statistical instability, often associated with trend uncertainty.
Yellow Background: Marks choppy periods, where statistical data suggests that market conditions are not conducive to reliable trading.
2. SRI Volatility Plot:
Displays the volatility of the SRI itself to detect when the indicator is stable or unstable:
Blue Area Fill: Signifies that the SRI is stable, indicating trending conditions.
Yellow Area Fill: Represents choppy or unstable SRI movements, suggesting sideways or unreliable market conditions.
A Chop Threshold Line (dotted yellow) highlights the maximum acceptable SRI volatility before the market is considered too unpredictable.
3. Stability Assessment:
Stable Trend (No Chop):
The SRI is smooth and consistent, often accompanied by aqua or fuchsia lines.
Volatility remains below the chop threshold, indicating a low-risk, trend-following environment.
Chop Mode:
The SRI becomes erratic, and the volatility plot spikes above the threshold.
Marked by a yellow shaded background, indicating uncertain and non-trending conditions.
[Trend Identification:
Use the color-coded SRI line and background to determine uptrend or downtrend reliability.
Be cautious when the SRI volatility plot shows yellow, as this signals trading conditions may not be reliable.
Practical Use Cases:
Trend Confirmation:
Utilize the SRI plot color and background to confirm whether a detected trend is statistically reliable.
Chop Mode Filtering:
During yellow chop periods, it is advisable to reduce trading activity or adopt range-bound strategies.
Strategy Filter:
Combine the SRI with trend-following indicators (like moving averages) to enhance entry and exit accuracy.
Volatility Monitoring:
Pay attention to the SRI volatility plot, as spikes often precede erratic price movements or trend reversals.
Disclaimer:
The Statistical Reliability Index (SRI) is a technical analysis tool designed to aid in market stability assessment and trend validation. It is not intended as a standalone trading signal generator. While the SRI can help identify statistically reliable trends, it is essential to incorporate additional technical and fundamental analysis to make well-informed trading decisions.
Trading and investing involve substantial risk, and past performance does not guarantee future results. Always use risk management practices and consult with a financial advisor to tailor strategies to your individual risk profile and objectives.
Multi-TF BOS/CHoCH Detectori am abhijit i am devloping this structure maping indicator with alert .
on dated may 12-5-2025. disclaimer-it is only for educational purpose and not giving surety of success use it by your own risk
cc AJGB Candle Range Finder with TableOverview:
The "cc AJGB Candle Range Finder with Table" is a versatile Pine Script indicator designed to identify and visualize price ranges within the 1 minute charts based on UTC+2 Time Zone. Unlike traditional range indicators, it offers three unique calculation methods to define ranges based on minute and hour interactions, displays ranges as boxes with labeled point values, and summarizes average range sizes in a customizable table. This tool is ideal for analyzing price ranges of specific time based ranges.
Features:
Customizable Time Range: Users specify a start and end minute (0-59) to define the range period (e.g., 29th to 35th minute).
Three Calculation Methods:
Minute Only: Uses the minute of each bar to identify ranges (e.g., matches user-specified minutes).
Minute - Hour: Adjusts the minute by subtracting the hour, allowing for dynamic range detection across hourly cycles.
Minute + Hour: Combines minute and hour values for a unique range calculation, useful for specific intraday patterns.
Visual Output: Draws boxes around detected ranges, with labels showing the start/end minutes and range size in points.
Summary Table: Displays the average range size (in points) for each method, with customizable position, colors, and text size.
How It Works:
The indicator evaluates each bar’s timestamp in (UTC+2 ONLY) to match user-specified minutes using one or more selected methods. When a start minute is detected, it tracks the high and low prices until the end minute, drawing a box to highlight the range and labeling it with the range size in points. A table summarizes the average range size for each method, helping traders assess typical price movements during the specified period.
Market Analysis: Compare range sizes across different methods to understand intraday volatility patterns.
Settings Customization: Adjust colors, table position, and label sizes to suit your chart preferences.
Settings:
Range to Find: Set start and end minutes.
Range Selection: Enable/disable each method and customize colors.
Range Label Size: Choose label size (Tiny to Huge).
Table Settings: Configure table position (Top, Bottom, Left, Right), sub-position, text size, and colors.
Notes:
Only works on 1 minute charts
The indicator works best using Start Times that are lower than the End Times.
Ensure the chart is set to UTC+2 Time Zone for accurate range detection.
Why It’s Unique:
Unlike standard range indicators that focus on sessions or fixed periods, this tool allows precise minute-based range detection with three distinct calculation methods, offering flexibility for data gathering. The interactive table provides quick insights into average range sizes.
Linear Regression Volume | Lyro RSLinear Regression Volume | Lyro RS
⚠️Disclaimer⚠️
Always combine this indicator with other forms of analysis and risk management. Please do your own research before making any trading decisions.
The LR Volume | 𝓛𝔂𝓻𝓸 𝓡𝓢 indicator blends linear regression with volume-adjusted moving average s to dynamically outline price equilibrium and trend intensity. By integrating volume into its regression model, it highlights meaningful price movement relative to trading activity.
📌 How It Works:
Volume-Weighted Regression Baseline
Price is filtered through one of four volume-adjusted moving averages (SMA, RMA, HMA, ALMA) before being passed through a linear regression model, forming a dynamic fair value line.
Deviation Bands
The indicator plots 1x, 2x, and 3x standard deviation zones above and below the baseline, helping identify potential extremes, volatility spikes, and mean reversion areas.
Slope-Based Color Logic
The baseline and fill areas are dynamically colored:
- 🟢 Green for positive slope (uptrend)
- 🔴 Red for negative slope (downtrend)
- ⚪ Gray for neutral movement
⚙️ Inputs & Options:
Regression Length – Controls how many bars are used in the moving average and regression calculation.
Deviation Multiplier – Adjusts the width of the bands surrounding the regression baseline.
MA Type – Choose from 4 types:
SMA (Simple Moving Average)
RMA (Relative Moving Average)
HMA (Hull Moving Average)
ALMA (Arnaud Legoux Moving Average)
Band Colors – Customizable upper/lower band colors to match your visual style.
🔔 Alerts:
Long Signal – Triggers when the regression slope turns positive.
Short Signal – Triggers when the regression slope turns negative.
Money Flow: In & Out Detector[THANHCONG]Indicator Name:
Money Flow: In & Out Detector
Indicator Description:
The Money Flow: In & Out Detector indicator uses technical indicators such as RSI (Relative Strength Index), MFI (Money Flow Index), and volume analysis to determine money inflow and outflow in the market.
This indicator helps traders identify changes in money flow, allowing them to detect buy and sell signals based on the combination of the following factors:
RSI > 50 and MFI > 50: Money inflow, indicating a buy signal.
RSI < 50 and MFI < 50: Money outflow, indicating a sell signal.
Volume increase/decrease relative to the average: Identifies strong market behavior changes.
Adjustable Parameters:
RSI Length: The number of periods to calculate the RSI (default is 14).
MFI Length: The number of periods to calculate the MFI (default is 14).
Volume MA Length: The number of periods to calculate the moving average of volume (default is 20).
Volume Increase/Decrease (%): The percentage threshold for volume change compared to the moving average (default is 20%).
Look Back Period: The number of periods used to identify peaks and troughs (default is 20).
How to Use the Indicator:
Money Inflow: When both RSI and MFI are above 50, and volume increases significantly relative to the moving average, the indicator shows a Buy signal.
Money Outflow: When both RSI and MFI are below 50, and volume decreases significantly relative to the moving average, the indicator shows a Sell signal.
Identifying Peaks and Troughs: The indicator also helps identify market peaks and troughs based on technical conditions.
Note:
This indicator assists in decision-making, but does not replace comprehensive market analysis.
Use this indicator in conjunction with other technical analysis methods to increase the accuracy of trade signals.
Steps for Publishing the Indicator on TradingView:
Log in to TradingView:
Go to TradingView and log into your account.
Access Pine Script Editor:
Click on Pine Editor from the menu under the chart.
Paste your Pine Script® code into the editor window.
Check the Source Code:
Ensure your code is error-free and running correctly.
Review the entire source code and add the MPL-2.0 license notice if necessary.
Save and Publish:
After testing and confirming the code works correctly, click Add to Chart to try the indicator on your chart.
If satisfied with the result, click Publish Script at the top right of the Pine Editor.
Provide a name for the indicator and then enter the detailed description you’ve prepared.
Ensure you specify the MPL-2.0 license in the description if required.
Choose the Access Type:
You can choose either Public or Private access for your indicator depending on your intention.
Submit for Publication:
Wait for TradingView to review and approve your indicator. Typically, this process takes a few working days for verification and approval.
User Guide:
You can share detailed instructions for users on how to use the indicator on TradingView, including how to adjust the parameters and interpret the signals. For example:
Set RSI Length: Experiment with different RSI Length values to find the sensitivity that suits your strategy.
Interpreting In/Out Signals: When there is strong money inflow (In), consider entering a buy order. When there is strong money outflow (Out), consider selling.
CorrelationMulti-Timeframe Correlation Indicator
This Pine Script indicator measures the correlation between the current symbol and a reference symbol (default: GLD) across three different timeframes. It provides traders with valuable insights into how assets move in relation to each other over short, medium, and long-term periods.
Key Features
Multiple Timeframe Analysis: Calculates correlation coefficients over three customizable periods (default: 20, 50, and 200 bars)
Visual Reference Lines: Displays horizontal lines at +1, 0, and -1 to indicate perfect positive correlation, no correlation, and perfect negative correlation
Color-Coded Outputs: Shows short-term correlation in green, medium-term in yellow, and long-term in red for easy visual interpretation
Understanding Correlation
The correlation coefficient measures the statistical relationship between two data series, ranging from -1 to +1:
+1: Perfect positive correlation (both assets move together in the same direction)
0: No correlation (movements are random and independent)
-1: Perfect negative correlation (assets move in opposite directions)
How To Use This Indicator
Market Relationships: Identify how strongly your current asset correlates with the reference symbol
Diversification Analysis: Find assets with negative correlations to build a diversified portfolio
Divergence Opportunities: Watch for changes in correlation patterns that might signal trading opportunities
Trend Confirmation: Use correlation with benchmark assets to confirm broader market trends
Customization Options
Reference Symbol: Change the default GLD to any other symbol you want to compare against
Period Lengths: Adjust the short, medium, and long timeframes to match your trading strategy and timeframe
This indicator helps traders make more informed decisions by understanding the interrelationships between different assets across various timeframes, potentially improving portfolio construction and risk management strategies.
Daily Average 5m Candle SizeThis indicator measures the average size of each 5 min candle then works out the end of day average for you. Very important for profit targets and stops