Daily Candle Bias Backtesting Stats @MaxMaserati This indicator, is a powerful backtesting and probability tool designed to quantify the "follow-through" of specific candle types across different market sessions.
It identifies specific price action setups and tracks whether price hits a "Target" (continuation) or an "Invalidation" (reversal) first, providing real-time win rates for your favorite sessions.
The Candle Bias Stats indicator automatically categorizes every candle based on the MMM candle bias and tracks their historical success rate. It calculates how often a candle's high/low is broken before its opposite end is touched. By breaking this data down into sessions (Asian, London, NY), it identifies high-probability "time-of-day" windows where specific price action setups are most reliable.
MMM CANDLE LOGIC
Bullish Expansion & Breakout Signatures
Bullish Body Close Plus (BuBC Plus): Represents strong bullish momentum where price closes above the previous high and near its own top, signaling that buyers are in complete control.
Bullish Body Close Minus (BuBC Minus): Indicates weak bullish momentum; while the price closes above the previous high, a long top wick shows sellers pushed back, suggesting a potential retest of the previous high.
Bearish Expansion & Breakout Signatures
Bearish Body Close Plus (BeBC Plus): A very strong bearish signal where price closes below the previous low and near its own bottom, indicating sellers are dominant.
Bearish Body Close Minus (BeBC Minus): Signifies weak bearish momentum; the price breaks the previous low but finishes with a long bottom wick as buyers push back, often leading to a retest of the old ceiling.
Bullish Reversal & Trap Signatures (Affinity)
Bullish Affinity Plus (BuAF Plus): A strong bullish reversal where a new low is made, but sellers hit a wall and get trapped, causing price to finish near its top with a long bottom wick.
Bullish Affinity Minus (BuAF Minus): A weak bullish bounce where a new low is made and price finishes back inside the previous range, but buyers lack the energy for a significant move.
Bearish Reversal & Trap Signatures (Affinity)
Bearish Affinity Plus (BeAF Plus): A strong bearish reversal; buyers are trapped after making a new high, and price finishes near its bottom with a long top wick.
Bearish Affinity Minus (BeAF Minus): A weak bearish drop where sellers stop the rise but lack the energy to push price significantly lower.
Neutral & Volatility Signatures
Close Inside Bullish (CI•BuAF): Bullish neutral state where price stays inside the previous candle’s range but finishes in the top half, indicating buyers are slightly more active.
Close Inside Bearish (CI•BeAF): Bearish neutral state where price remains inside the previous box and finishes in the bottom half.
Seek & Destroy Bullish (S&D•BuAF): Bullish volatility characterized by price moving above and below the previous candle before buyers win the battle and close price near the top.
Seek & Destroy Bearish (S&D•BeAF): Bearish volatility where sellers win a high-chaos battle, closing price near the bottom after sweeping both sides of the previous candle.
H4 CANDLE EXAMPLE
Deep Dive: Analysis of the 4H Statistics
The image presents a comprehensive backtest of 4,999 total candles from September 2022 to December 2025. Here is the breakdown of what the interface is telling us:
1. The Strategy: Target vs. Invalidation
The indicator tracks BuBC (Bullish Body Close) and BeBC (Bearish Body Close).
The Target: For a Bullish candle, the target is the High. For a Bearish candle, it is the Low.
The Invalidation: The opposite end of the candle (the Low for Bullish, the High for Bearish).
The Goal: To see which level is touched first in the subsequent bars.
2. Global Performance (The Top Right Table)
Looking at the BuBC (1402 samples) section:
Target First (67.8%): In nearly 7 out of 10 cases, once a 4H candle closes "bullish" (breaking the previous high), the price continues higher to break its own high before it ever returns to take out its own low.
Both Hit (17.7%): This is a critical metric. It represents "Stop Runs" or "Wicks" where price hits the target but also hits the invalidation within the same tracking period.
Efficiency (1.3 Bars): This tells us the "follow-through" is almost immediate. If the trade doesn't work within 1 or 2 candles, the statistical edge drops off significantly.
3. The Session Breakdown (The Bottom Left Table)
This is where the "Edge" is found. Not all hours of the day are created equal.
Asian Late (02:00-06:00) – The "Star" Performer: With a 72.9% Target rate, this is labeled "BEST." It has the lowest "Both%" (6.5%), meaning moves during these hours are incredibly "clean." If a setup forms here, price usually moves directly to the target without looking back.
London Open & Overlap (06:00-14:00): These sessions maintain a high win rate (approx. 70%). This suggests that the European session provides reliable trend continuation for the S&P 500.
NY Session (14:00-18:00) – The "Trap" Zone: This is labeled "WORST" for a reason. While the win rate is basically a coin flip (49.6%), the Both% spikes to 36.7%. This means that even if you are right about the direction, the market is highly likely to "sweep" your stop loss before going to the target. It is the most volatile and "fake-out" prone time for this specific setup.
Summary of the Data
The statistics show that the S&P 500 4H Candle Bias is a highly reliable trend-following indicator, provided you trade it at the right time.
The data suggests a clear three-step logic:
Directional Edge: Both Bullish and Bearish body closes have a natural ~67% probability of continuation.
Timing is Everything: Trading during the Late Asian and London sessions increases your probability of success to over 70% with very low risk of a "fake-out."
Risk Warning: Avoid "Body Close" breakout strategies during the NY Mid-day (14:00-18:00). The statistics prove that this window is dominated by "Seek and Destroy" price action, where price is mathematically likely to hit both your target and your stop, usually hitting the stop first.
Sentiment
Volume And ROC Surge DetectorSharing this indicator I made for myself.
Volume and ROC are early indicators of long moves. When ROC + Volume happens together, it's BOOM.
This indicator called, Volume + ROC Surge Detector is a real-time momentum alert indicator designed to spot early institutional activity and explosive price moves. It combines Volume Surge analysis with Price Rate of Change (ROC) to identify when price and participation align.
The script monitors abnormal volume relative to a moving average and confirms direction using ROC strength. When both volume expansion and directional momentum occur together, it triggers high-confidence “Boom” signals for bullish or bearish moves.
To avoid noise, the indicator includes state-based alert control, ensuring each signal fires only once per condition change and only in real-time, not on historical bars.
Key Features
1. Detects bullish and bearish ROC momentum shifts
2. Identifies positive and negative volume anomalies
3. Flags combined Volume + ROC “Boom” events
4. Real-time alerts only (no repaint, no bar-close spam)
5. Duplicate alert prevention using internal state tracking
6. Clean on-chart visual markers for instant recognition. Disable visuals for cleaner chart.
Best Use Cases:
1. Catching breakouts and breakdowns early
2. Spotting smart money participation
3. Momentum confirmation for trend, intraday, and swing trading
4. Works across stocks, crypto, and indices
Alerts:
1. ROC Bullish Alert
When it fires:
Price Rate of Change (ROC) crosses above the positive ROC threshold
Alert messages:
🟢 ROC Change Bullish → TICKER @ price
What it means: Price momentum has turned strongly bullish. Early sign of upside acceleration
2. ROC Bearish Alert
When it fires:
Price ROC crosses below the negative ROC threshold
Alert message:
🔴 ROC Change Bearish → TICKER @ price
What it means:
Price momentum has turned strongly bearish. Early sign of downside acceleration
3. Positive Volume Surge Alert
When it fires:
Current volume exceeds
Average Volume × Volume Surge Multiplier
Alert message:
📈 +Ve Vol Change → TICKER @ volume
What it means:
Unusual participation / smart money activity. Strength entering the move
4. Negative Volume Alert (Volume Dry-Up)
When it fires:
Current volume drops below
Average Volume ÷ Volume Surge Multiplier
Alert message:
📉 -Ve Vol Change → TICKER @ volume
What it means:
Participation is fading. Trend exhaustion or consolidation risk
5. Boom Bull Alert (High-Conviction Signal)
When it fires:
Both conditions occur together:
Bullish ROC AND Volume Surge (high participation)
Alert message:
💥 Boom Volume + ROC Bull → TICKER @ price
What it means: Momentum + volume alignment. Strong breakout / continuation probability
6. Boom Bear Alert (High-Conviction Signal)
When it fires:
Both conditions occur together: Bearish ROC AND Volume Surge (high participation)
Alert message:
💣 Boom Volume + ROC Bear → TICKER @ price
What it means: Momentum + volume alignment to the downside. Strong breakdown / continuation probability
This indicator is built for traders who want clarity, speed, and signal discipline—not lagging confirmations or noisy alerts.
Binance futures Funding Rate Sentiment ZonesHello,
This script is pretty much self explanatory.
Instead of having to have Binance open to check the Funding rate for futures USDT coins, it is shown in TradingView.
There are multiple colors that are shown:
-0.05% to 0.05% = neutral funding, no color on background
-+0.05% to -+0.1% = transition zone, long/short population increasing/decreasing
-+0.1% to -+ 2% = extreme positive / negative funding, red color
Fundamental Dashboard [Standalone]Overview
The Fundamental Strength Dashboard is a streamlined utility designed to evaluate the fundamental health of a stock directly on your chart. Instead of relying solely on price action, this indicator fetches real-time financial data to assess profitability, valuation, and financial stability.
It aggregates five core financial metrics into a single "Fundamental Score" (0-5) and displays a clear rating (Strong Buy, Buy, Neutral, or Weak/Sell) in a customizable dashboard table.
How It Works
The script analyzes the following 5 Key Fundamental Metrics. For a stock to receive a "point" for a specific metric, it must meet the criteria defined in your settings:
Net Income (Profitability): Checks if the company is actually profitable (Net Income > 0).
EPS (Earnings Per Share): Ensures the company has positive Earnings Per Share (TTM).
P/E Ratio (Valuation): Checks if the stock is valued reasonably compared to your maximum threshold (default: < 45).
Debt-to-Equity (Leverage): Analyzes financial risk. Lower is better (default: < 0.5).
ROE (Efficiency): Measures how effectively management uses equity to generate profit (default: > 15%).
The Scoring System
The indicator calculates a cumulative score based on how many of the above criteria are met:
Score 5/5 → STRONG BUY: The stock meets all profitability, valuation, and stability criteria.
Score 4/5 → BUY: The stock misses only one criterion but is otherwise fundamentally sound.
Score 0-3 → WEAK / SELL: The stock fails multiple fundamental checks (e.g., negative earnings, high debt, or overvaluation).
Features & Customization
Every trader has different risk appetites and sector preferences. You can fully customize the thresholds in the Settings menu:
Max P/E Threshold: Adjust this based on the sector (e.g., Tech stocks typically have higher P/Es than Utilities).
Min ROE %: Set your requirement for management efficiency.
Max Debt/Equity: Tighten or loosen leverage requirements.
Visuals: Change the table position (Top Right, Bottom Right, etc.) and color scheme to match your chart theme.
How to Use
Add the indicator to your chart.
Open the Settings (Gear icon).
Adjust the Dynamic Thresholds to fit the sector you are trading.
Look at the dashboard on the chart to see a snapshot of the stock's fundamental health.
Disclaimer
This script is for educational and informational purposes only. It relies on third-party financial data provided by TradingView, which may occasionally be missing or delayed. Always do your own research (DYOR) before making investment decisions.
Binance Perp Basis % (Auto)Hello,
This script is pretty much self explanatory.
It is the real-time basis rate % of Binance futures crypto paired with USDT.
If the indicator shows "NaN" it means that the coin exists in USDT.P but does not have a homologue in spot to run the basis rate & calculation.
To change colors:
for positive & negative basis rate % you simply have to open the script & change the values here shown:
//=== 4. Plot =================================================================
col = basis >= 0 ? color.new(color. white , 0) : color.new(color. black , 0)
To change the 0 line color and opacity:
line(0, "Zero line", color=color.new(color.gray, 60), linestyle=hline.style_dashed)
deKoder | Business Cycle vs BitcoinThis indicator overlays Bitcoin's detrended momentum with the US ISM Manufacturing PMI (a key business cycle proxy) to visually dissect the relationship between crypto cycles and broader economic health.
Inspired by ongoing debates in crypto macro analysis (e.g., "Is there a 4-year halving cycle, or is it just the business cycle?" ), it highlights potential lead-lag dynamics - challenging the popular view that PMI strictly leads Bitcoin rallies and tops.
Key Features
• BTC Momentum Wave (Yellow/Orange Line):
Detrended deviation from Bitcoin's long-term "fair value" (24-month SMA).
Formula: ((close / sma(close, 24)) * 100 - 100) * 0.15
- Positive (yellow): BTC overvalued relative to trend | bullish momentum
- Negative (orange): Undervalued relative to trend | bearish momentum
• PMI Wave (Teal/Red Line):
ISM Manufacturing PMI centered at zero (raw PMI - 50, scaled ×3 for alignment).
- Positive (teal): Expansion (>50 raw) — economic tailwinds.
- Negative (red): Contraction (<50 raw) — headwinds, often linked to risk-off in assets.
• S&P 500 Momentum (White Line, Optional):
Similar deviation for SPX, showing how equities bridge BTC's volatility and PMI's smoothness.
• Divergence Highlights (Bar & Background Colors):
- Teal/Green Zones : BTC momentum positive while PMI negative → BTC signaling early recovery (potential lead by 1-3+ months at bottoms).
- Maroon/Red Zones : BTC momentum negative while PMI positive → BTC warning of rollovers (early bear signals).
- Neutral: No color — aligned cycles.
• Overlaid SMA on Price Chart :
24-month SMA for BTC (teal when price above, red when below) — quick fair value reference.
How to Interpret: Does BTC Lead the Business Cycle?
The chart flips the common meme ( "No 4-year cycle, it's just the business cycle" ) by visually emphasising BTC's potential as a forward-looking signal .
Historical cycles (2013–2025) show:
• BTC Leads at Bottoms : E.g., 2018–2019 and 2022 troughs — BTC momentum crosses positive 2–4 months before PMI, as speculative traders price in liquidity easing/recoveries ahead of manufacturing data.
• Coincident or BTC-Led at Tops : Peaks align closely (e.g., 2017, 2021), with PMI rollovers often coinciding or slightly leading the initial BTC euphoria fade. BTC then rolls over before PMI confirms later.
• Why? Markets are anticipatory (6–12 months forward), while PMI is a lagged survey snapshot. BTC, as a high-beta risk asset, amplifies early sentiment shifts before they hit factory orders/employment.
Inputs & Customization
• BTC Source (Default: BITSTAMP:BTCUSD)
• Fair Value MA Length (Default: 24 months)
• Show S&P (Default: False)
• PMI Multiplier (Default: 3.0)
• BTC Momentum Multiplier (Default: 0.15)
• Cap BTC Momentum at ±100 (Default: True)
• Toggle Early Cross Arrows, Bar/Background Deviation Colors, Difference Histogram
My Price Curtain by @magasineMy Price Curtain by @magasine
Functional Description
My Price Curtain is a high-performance visual analysis tool designed to provide traders with immediate context regarding price positioning relative to institutional benchmarks. Unlike standard moving averages, this indicator creates a "curtain" of data that dynamically colors the chart background and provides real-time performance metrics to identify trend dominance at a glance.
Key Features & Differential Value
Multi-Method Dynamic Benchmarking: Choose between five different calculation methods: SMA, EMA, WMA, RMA, or a manual Fixed Price. This allows you to switch from a standard technical trend (MA) to a "break-even" or "entry point" analysis (Fixed Price) instantly.
Intelligent Visual Feedback: The "Curtain" logic automatically colors the chart background—Green for Bullish dominance and Red for Bearish dominance—reducing cognitive load during fast-paced sessions.
Advanced Statistical Tracking: The indicator includes a built-in Performance Table that tracks the percentage of bars closing above or below the selected benchmark. This helps traders quantify the strength of a trend over the entire visible dataset.
Precision Labeling & Distance Analysis: A dynamic, color-coded label tracks the price on the Y-axis. It calculates and displays the exact percentage distance from the price to the benchmark in real-time, helping to identify overextended moves.
Optional Deviation Zones: Enable visual "Safety Zones" (boxes) that project a user-defined percentage deviation from the average, assisting in identifying potential volatility expansion or exhaustion areas.
Trading Utilities
Trend Confirmation: Use the background color and "Bars Above" percentage to confirm if you are trading with the path of least resistance.
Scalping & Intraday Support: The "Distance" metric is essential for scalpers to avoid entering trades too far from the average (mean reversion risk).
Custom Strategy Benchmark: Use the "Fixed Price" mode to set your specific entry price and see your real-time performance and "curtain" status relative to your position.
Hurst-Optimized Adaptive Channel [Kodexius]Hurst-Optimized Adaptive Channel (HOAC) is a regime-aware channel indicator that continuously adapts its centerline and volatility bands based on the market’s current behavior. Instead of using a single fixed channel model, HOAC evaluates whether price action is behaving more like a trend-following environment or a mean-reverting environment, then automatically selects the most suitable channel structure.
At the core of the engine is a robust Hurst Exponent estimation using R/S (Rescaled Range) analysis. The Hurst value is smoothed and compared against user-defined thresholds to classify the market regime. In trending regimes, the script emphasizes stability by favoring a slower, smoother channel when it proves more accurate over time. In mean-reversion regimes, it deliberately prioritizes a faster model to react sooner to reversion opportunities, similar in spirit to how traders use Bollinger-style behavior.
The result is a clean, professional adaptive channel with inner and outer bands, dynamic gradient fills, and an optional mean-reversion signal layer. A minimalist dashboard summarizes the detected regime, the current Hurst reading, and which internal model is currently preferred.
🔹 Features
🔸 Robust Regime Detection via Hurst Exponent (R/S Analysis)
HOAC uses a robust Hurst Exponent estimate derived from log returns and Rescaled Range analysis. The Hurst value acts as a behavioral filter:
- H > Trend Start threshold suggests trend persistence and directional continuation.
- H < Mean Reversion threshold suggests anti-persistence and a higher likelihood of reverting toward a central value.
Values between thresholds are treated as Neutral, allowing the channel to remain adaptive without forcing a hard bias.
This regime framework is designed to make the channel selection context-aware rather than purely reactive to recent volatility.
🔸 Dual Channel Engine (Fast vs Slow Models)
Instead of relying on one fixed channel, HOAC computes two independent channel candidates:
Fast model: shorter WMA basis and standard deviation window, intended to respond quickly and fit more reactive environments.
Slow model: longer WMA basis and standard deviation window, intended to reduce noise and better represent sustained directional flow.
Each model produces:
- A midline (basis)
- Outer bands (wider deviation)
- Inner bands (tighter deviation)
This structure gives you a clear core zone and an outer envelope that better represents volatility expansion.
🔸 Rolling Optimization Memory (Model Selection by Error)
HOAC includes an internal optimization layer that continuously measures how well each model fits current price action. On every bar, each model’s absolute deviation from the basis is recorded into a rolling memory window. The script then compares total accumulated error between fast and slow models and prefers the one with lower recent error.
This approach does not attempt curve fitting on multiple parameters. It focuses on a simple, interpretable metric: “Which model has tracked price more accurately over the last X bars?”
Additionally:
If the regime is Mean Reversion, the script explicitly prioritizes the fast model, ensuring responsiveness when reversals matter most.
🔸 Optional Output Smoothing (User-Selectable)
The final selected channel can be smoothed using your choice of:
- SMA
- EMA
- HMA
- RMA
This affects the plotted midline and all band outputs, allowing you to tune visual stability and responsiveness without changing the underlying decision engine.
🔸 Premium Visualization Layer (Inner Core + Outer Fade)
HOAC uses a layered band design:
- Inner bands define the core equilibrium zone around the midline.
- Outer bands define an extended volatility envelope for extremes.
Gradient fills and line styling help separate the core from the extremes while staying visually clean. The midline includes a subtle glow effect for clarity.
🔸 Adaptive Bar Tinting Strength (Regime Intensity)
Bar coloring dynamically adjusts transparency based on how far the Hurst value is from 0.5. When market behavior is more decisively trending or mean-reverting, the tint becomes more pronounced. When behavior is closer to random, the tint becomes more subtle.
🔸 Mean-Reversion Signal Layer
Mean-reversion signals are enabled when the environment is not classified as Trending:
- Buy when price crosses back above the lower outer band
- Sell when price crosses back below the upper outer band
This is intentionally a “return to channel” logic rather than a breakout logic, aligning signals with mean-reversion behavior and avoiding signals in strongly trending regimes by default.
🔸 Minimalist Dashboard (HUD)
A compact table displays:
- Current regime classification
- Smoothed Hurst value
- Which model is currently preferred (Fast or Slow)
- Trend flow direction (based on midline slope)
🔹 Calculations
1) Robust Hurst Exponent (R/S Analysis)
The script estimates Hurst using a Rescaled Range approach on log returns. It builds a returns array, computes mean, cumulative deviation range (R), standard deviation (S), then converts RS into a Hurst exponent.
calc_robust_hurst(int length) =>
float r = math.log(close / close )
float returns = array.new_float(length)
for i = 0 to length - 1
array.set(returns, i, r )
float mean = array.avg(returns)
float cumDev = 0.0
float maxCD = -1.0e10
float minCD = 1.0e10
float sumSqDiff = 0.0
for i = 0 to length - 1
float val = array.get(returns, i)
sumSqDiff += math.pow(val - mean, 2)
cumDev += (val - mean)
if cumDev > maxCD
maxCD := cumDev
if cumDev < minCD
minCD := cumDev
float R = maxCD - minCD
float S = math.sqrt(sumSqDiff / length)
float RS = (S == 0) ? 0.0 : (R / S)
float hurst = (RS > 0) ? (math.log10(RS) / math.log10(length)) : 0.5
hurst
This design avoids simplistic proxies and attempts to reflect persistence (trend tendency) vs anti-persistence (mean reversion tendency) from the underlying return structure.
2) Hurst Smoothing
Raw Hurst values can be noisy, so the script applies EMA smoothing before regime decisions.
float rawHurst = calc_robust_hurst(i_hurstLen)
float hVal = ta.ema(rawHurst, i_smoothHurst)
This stabilized hVal is the value used across regime classification, dynamic visuals, and the HUD display.
3) Regime Classification
The smoothed Hurst reading is compared to user thresholds to label the environment.
string regime = "NEUTRAL"
if hVal > i_trendZone
regime := "TRENDING"
else if hVal < i_chopZone
regime := "MEAN REV"
Higher Hurst implies more persistence, so the indicator treats it as a trend environment.
Lower Hurst implies more mean-reverting behavior, so the indicator enables MR logic and emphasizes faster adaptation.
4) Dual Channel Models (Fast and Slow)
HOAC computes two candidate channel structures in parallel. Each model is a WMA basis with volatility envelopes derived from standard deviation. Inner and outer bands are created using different multipliers.
Fast model (more reactive):
float fastBasis = ta.wma(close, 20)
float fastDev = ta.stdev(close, 20)
ChannelObj fastM = ChannelObj.new(fastBasis, fastBasis + fastDev * 2.0, fastBasis - fastDev * 2.0, fastBasis + fastDev * 1.0, fastBasis - fastDev * 1.0, math.abs(close - fastBasis))
Slow model (more stable):
float slowBasis = ta.wma(close, 50)
float slowDev = ta.stdev(close, 50)
ChannelObj slowM = ChannelObj.new(slowBasis, slowBasis + slowDev * 2.5, slowBasis - slowDev * 2.5, slowBasis + slowDev * 1.25, slowBasis - slowDev * 1.25, math.abs(close - slowBasis))
Both models store their structure in a ChannelObj type, including the instantaneous tracking error (abs(close - basis)).
5) Rolling Error Memory and Model Preference
To decide which model fits current conditions better, the script stores recent errors into rolling arrays and compares cumulative error totals.
var float errFast = array.new_float()
var float errSlow = array.new_float()
update_error(float errArr, float error, int maxLen) =>
errArr.unshift(error)
if errArr.size() > maxLen
errArr.pop()
Each bar updates both error histories and computes which model has lower recent accumulated error.
update_error(errFast, fastM.error, i_optLookback)
update_error(errSlow, slowM.error, i_optLookback)
bool preferFast = errFast.sum() < errSlow.sum()
This is an interpretable optimization approach: it does not attempt to brute-force parameters, it simply prefers the model that has tracked price more closely over the last i_optLookback bars.
6) Winner Selection Logic (Regime-Aware Hybrid)
The final model selection uses both regime and rolling error performance.
ChannelObj winner = regime == "MEAN REV" ? fastM : (preferFast ? fastM : slowM)
rawMid := winner.mid
rawUp := winner.upper
rawDn := winner.lower
rawUpInner := winner.upper_inner
rawDnInner := winner.lower_inner
In Mean Reversion, the script forces the fast model to ensure responsiveness.
Otherwise, it selects the lowest-error model between fast and slow.
7) Optional Output Smoothing
After the winner is selected, the script optionally smooths the final channel outputs using the chosen moving average type.
smooth(float src, string type, int len) =>
switch type
"SMA" => ta.sma(src, len)
"EMA" => ta.ema(src, len)
"HMA" => ta.hma(src, len)
"RMA" => ta.rma(src, len)
=> src
float finalMid = i_enableSmooth ? smooth(rawMid, i_smoothType, i_smoothLen) : rawMid
float finalUp = i_enableSmooth ? smooth(rawUp, i_smoothType, i_smoothLen) : rawUp
float finalDn = i_enableSmooth ? smooth(rawDn, i_smoothType, i_smoothLen) : rawDn
float finalUpInner = i_enableSmooth ? smooth(rawUpInner, i_smoothType, i_smoothLen) : rawUpInner
float finalDnInner = i_enableSmooth ? smooth(rawDnInner, i_smoothType, i_smoothLen) : rawDnInner
This preserves decision integrity since smoothing happens after model selection, not before.
8) Dynamic Visual Intensity From Hurst
Transparency is derived from the distance of hVal to 0.5, so stronger behavioral regimes appear with clearer tints.
int dynTrans = int(math.max(20, math.min(80, 100 - (math.abs(hVal - 0.5) * 200))))
Global Sessions Pro NY/London/Tokyo - O/C/H/LGLOBAL SESSIONS PRO — NY / LONDON / TOKYO
Session Opens, Highs, Lows, Midpoints, Closes, Ranges & Killzones
OVERVIEW
Global Sessions Pro is a comprehensive session-mapping indicator designed for traders who rely on market structure, session context, and time-based behavior.
The indicator automatically plots New York, London, and Tokyo sessions, including:
• Session Open, High, Low, Midpoint, and Close
• Prior session levels projected forward
• Session range boxes
• Right-side labeled price levels (clearly identified)
• Stacked session summary labels (no overlap)
• Optional killzones and overlap windows
• Breakout alerts (prior or current session levels)
The script is fully timezone-aware, DST-safe, and works on any chart timeframe.
KEY FEATURES
SESSION MAPPING
For each session (NY / London / Tokyo), the indicator can display:
• Open
• High
• Low
• Midpoint (High + Low) / 2
• Close
Each level is drawn with its own horizontal line and optional right-side label, so there is never confusion about which line represents which level.
SESSION RANGE BOXES
Optional shaded boxes highlight the true session range as it develops in real time.
These are useful for visualizing:
• Compression vs expansion
• Relative session volatility
• Strength or weakness between sessions
Opacity and visibility are fully configurable.
RIGHT-SIDE LEVEL LABELS
Each session level can be labeled on the right edge of the chart, showing:
• Session name (NY / Lon / Tok)
• Level type (O / H / L / M / C)
• Optional price value
Examples:
NY H: 18234.25
Lon L: 18098.50
Tok M: 18142.75
This eliminates ambiguity when multiple session levels overlap or share similar colors.
SESSION SUMMARY LABELS (AUTO-STACKED)
At the top of each session range, an optional summary label displays:
• Session name
• Open / High / Low / Close
• Total range (points)
• Range in ticks
• ATR multiple
Summary labels are automatically stacked vertically using ATR-based or tick-based spacing, preventing overlap even when multiple sessions occur close together.
PRIOR SESSION LEVELS
The indicator can project prior session levels into the next session, including:
• Prior High and Low
• Optional prior Open, Close, and Midpoint
These levels are commonly used for:
• Support and resistance
• Liquidity sweeps
• Mean reversion
• Failed breakouts
Projection length is configurable and safely capped to comply with TradingView drawing limits.
KILLZONES AND SESSION OVERLAPS
Optional background shading highlights key institutional windows:
• London Open
• New York Open
• London / New York overlap
These zones help identify high-probability volatility windows and time-based trade filters.
All killzones respect the selected session timezone basis.
ALERTS
Built-in alerts are available for:
• Break of prior session high
• Break of prior session low
• Break of current session high
• Break of current session low
Alerts can be configured to trigger on wick or close.
Alert logic is written using precomputed crossover detection to ensure historical consistency and avoid missed or false alerts.
TIMEZONE AND SESSION HANDLING (IMPORTANT)
SESSION TIME BASIS OPTIONS
The indicator supports three session-time modes:
Market Local (DST-aware) – Recommended
• New York uses America/New_York
• London uses Europe/London
• Tokyo uses Asia/Tokyo
• Automatically adjusts for daylight saving time
UTC (Fixed)
• Sessions are interpreted strictly in UTC
• Best for crypto or non-DST workflows
• Requires manual adjustment during DST changes
Custom Timezone
• Define a single custom timezone for all sessions
This ensures sessions display correctly regardless of the chart’s timezone.
DEFAULT SESSION TIMES
(Default values assume Market Local (DST-aware) mode)
Tokyo: 09:00 – 15:00
London: 08:00 – 16:30
New York: 09:30 – 16:00
These defaults are optimized for cash and index trading.
FX traders may adjust session windows as needed.
BEST USE CASES
This indicator is particularly effective for:
• Index futures (ES, NQ, RTY, DAX, FTSE)
• Forex session-based strategies
• Time-based breakout systems
• Liquidity sweep and mean-reversion models
• London Open and New York Open trading
• Multi-session market context analysis
PERFORMANCE AND SAFETY NOTES
• All future-drawn objects are capped to comply with TradingView limits
• Crossover logic is evaluated every bar to prevent calculation drift
• Old session drawings are automatically culled to reduce chart clutter
• Works on all intraday and higher timeframes
RECOMMENDED SETTINGS
For most traders:
• Session Time Basis: Market Local (DST-aware)
• Show Open / High / Low / Midpoint: ON
• Prior Session Levels: ON
• Summary Labels: ON
• Killzones: ON
• Alerts: ON (Close-based)
FINAL NOTES
This indicator is designed to provide objective session structure without opinionated trade signals. It works best as a context layer combined with your own execution rules, confirmations, and risk management.
If you trade time, structure, and liquidity, this script provides the framework.
Buy / Sell Volume Header / NPR21📊 Buy / Sell Volume Header – NPR21
Overview
Buy / Sell Volume Header – NPR21 displays real-time Buy vs Sell volume dominance in a clean, Thinkorswim-style fixed header at the top of the chart.
Instead of cluttering candles with labels, this indicator presents volume information in a compact, side-by-side header, allowing traders to instantly gauge who is in control of the current bar—buyers or sellers—without losing focus on price action.
How It Works
Buy and Sell volume are estimated using candle structure:
Buy Volume is derived from the portion of the candle closing above the low
Sell Volume is derived from the portion of the candle closing below the high
Percentages show relative dominance for the most recently confirmed bar
This approach provides a fast, intuitive order-flow bias that works across futures, indices, crypto, and equities.
Key Features
✔ Thinkorswim-style fixed header
✔ Side-by-side Buy | Sell layout (no overlap)
✔ Bold green/red backgrounds with white text
✔ Compact font for intraday trading
✔ Updates only on confirmed bars (non-repainting)
✔ No candle clutter
✔ Optimized for scalping and intraday trading
Best Use Cases
Confirming buyer vs seller control
Adding confluence to:
Momentum indicators
VWAP / EMA strategies
Market structure & BOS setups
Quick decision support during:
Breakouts
Pullbacks
Range highs/lows
This tool is designed to be confirmation, not a standalone signal.
Notes
This is a volume estimation tool, not true bid/ask or footprint data
Best used alongside price action and structure
Money VolThe indicator displays the trading volume in monetary terms and its ratio to the average trading volume over 100 periods. It highlights volumes that are 2x, 5x, 10x, or less than 2x the average.
Индикатор показывает объем торгов в денежном выражении, отношение к среднему объему торгов за 100 периодов, подсвечивает х2, х5, х10 и меньше более чем х2
BTC - RHODL (Proxy Flow) b]Title: BTC - RHODL Ratio (Proxy Flow Edition) | RM
Overview & Philosophy
The RHODL Ratio is one of the most respected macro-on-chain metrics in the Bitcoin industry. Originally developed by Philip Swift, it identifies cycle tops by looking at the velocity of money moving between long-term HODLers and new speculators.
Why a "Proxy" instead of the "Original"? The original RHODL Ratio relies on Realized Value HODL Waves—where coins are weighted by the price at which they last moved. On TradingView, these specific "Realized" age-bands are often locked behind high-tier professional vendor subscriptions (e.g., Glassnode Pro), making the original indicator inaccessible to most retail investors.
To solve this, I present this Proxy Flow Edition. Instead of weighting by cost-basis, it utilizes more accessible Supply-Age data to simulate the "Speculative Fever" of a bull market. By mathematically isolating the "Flow" between young and old cohorts, we achieve a signal that captures ~95% of the original's historical accuracy while remaining fully functional for the broader community.
Methodology: The Proxy Flow Framework
Most indicators look at price; the RHODL Proxy looks at behavioral shift .
1. The Young vs. Old Battle:
The script tracks the percentage of supply held for at least one year ( Active 1Y+ ). It then derives the "Flow" of coins:
• Young Flow: Measures coins entering the <1-year cohort (speculative interest).
• Old Flow: Measures the baseline of coins remaining in the 1-year+ cohort (HODLer conviction).
2. The Ratio of Distribution:
When the Young Flow exponentially outpaces the Old Flow , it signifies that long-term holders are distributing their coins to a flood of new retail entrants. Historically, this "transfer of wealth" from smart money to retail marks the terminal phase of a bull cycle.
3. Age Normalization:
Bitcoin’s network naturally matures over time. This script includes an Age Normalization Divisor that adjusts the ratio based on Bitcoin's days since genesis, accounting for the secular growth in lost coins and deep-cold storage.
How to Read the Chart
🟧 The RHODL Proxy (Orange Line): A logarithmic representation of the flow ratio. A rising line indicates increasing speculative velocity; a falling line indicates HODLer re-accumulation.
🔴 The Overheated Zone (> 0.5): The danger zone. This area captures the "Speculative Fever" typical of cycle peaks. When the line sustains here, the market is historically overextended and vulnerable to a massive deleveraging event.
🟢 The Accumulation Zone (< -0.5): The maximum opportunity zone. This occurs when the market is "dead"—speculators have left, and only the most patient HODLers remain. Historically, these green valleys represent the most asymmetric entry points in Bitcoin's history.
Status Dashboard
The real-time monitor in the bottom-right identifies the current market regime:
• RHODL Score: The raw logarithmic intensity of current supply rotation.
• Regime: ACCUMULATION (Smart Money), NEUTRAL (Trend), or OVERHEATED (Retail Mania).
Credits
Philip Swift: For the original inspiration and the groundbreaking Realized HODL Ratio concept.
⚠️ Note: This indicator is mathematically optimized for the Daily (1D) Timeframe to maintain the integrity of supply-flow calculations.
Disclaimer
This script is for research and educational purposes only. On-chain metrics are probabilistic, not deterministic. Always manage your risk according to your investment horizon.
Tags
bitcoin, btc, rhodl, on-chain, hodl, cycles, speculation, rotation, macro, Rob Maths
BTC - BEAM: Adaptive Multiple (Open-Source)Title: BTC - BEAM: Adaptive Multiple Cycle Oscillator | RM
Overview & Philosophy
The BTC - BEAM (Bitcoin Economics Adaptive Multiple) is a premier macro-valuation tool designed to identify the "Logarithmic Pulse" of Bitcoin's 4-year cycles. Unlike standard oscillators that lose relevance as the network grows, BEAM uses an adaptive baseline that tracks Bitcoin’s fundamental growth curve with precision.
It identifies the harmonic distance between the current price and its multi-year mean, helping you spot the rare windows of deep capitulation and terminal euphoria.
Methodology
This edition is a hardened, gap-proof and Open-Source implementation of the canonical BEAM model.
1. The 1400-Day Anchor (200 Weeks):
The model is anchored to a 1400-day Simple Moving Average. On the Weekly chart, this aligns with the legendary 200-week moving average—the historical "floor" of the Bitcoin network. It represents one full halving cycle of data.
2. Daily-Lock Architecture:
Even when viewed on the 1W chart, the script performs its calculations using Daily data. This ensures that the oscillator captures the exact peak day of a cycle, providing a "high-resolution" signal within a "low-noise" weekly environment.
3. Logarithmic Normalization:
We calculate the natural logarithm of the price-to-mean relationship, scaled by a factor of 2.5: Score = ln(Price / 1400d MA) / 2.5 This creates a standardized "Multiple" that remains comparable across all Bitcoin eras.
How to Read the Chart (1W Context)
🟧 The BEAM Line (Orange): Tracks the "macro heat" of the market. On the 1W chart, look for the slope of this line to identify cycle acceleration.
🔴 The Cycle Ceiling (Score > 1.0): Historical Cycle Tops. When the weekly candle sustains in this zone, the market has reached a state of unsustainable mania. Every major blow-off top has been captured in this red corridor.
🟢 The Cycle Floor (Score < 0.1): Generational Accumulation. On the 1W chart, these zones appear as extended "green troughs." These are the only times in history where Bitcoin is fundamentally "too cheap" relative to its 4-year trend.
The Status Dashboard
The bottom-right monitor provides immediate cycle classification:
• BEAM Score: The exact logarithmic multiple.
• Cycle Regime: ACCUMULATION , NEUTRAL , or OVERHEATED .
Credits
BitcoinEcon: For the original concept of the BEAM adaptive model.
⚠️ RECOMMENDATION: While this indicator captures daily data, it is strongly recommended to be viewed on the Weekly (1W) Timeframe. The 1W chart filters market noise and perfectly reveals the long-term "Cycle Narrative."
Disclaimer
This script is for research and educational purposes only. Macro indicators provide structural context; they are not crystal balls. Always manage your risk according to your personal financial plan.
Tags
bitcoin, btc, beam, macro, cycle, halving, log-growth, valuation, on-chain, Rob Maths
Composite Fear & Greed IndexComposite Fear & Greed Index
This is an advanced, professional-grade sentiment analysis engine designed to quantify market psychology. Unlike standard oscillators that rely on a single metric, this script uses a weighted composite of four distinct technical components to generate a holistic "Fear & Greed" score.
It includes Multi-Timeframe (MTF) capabilities, proprietary FOMO/Panic detection logic, and Zero-Lag trend analysis.
1. Unique Mathematical Methodology
This script is not a simple overlay of existing indicators. It uses a Composite Normalization Engine to blend four distinct metrics into a single, bounded 0-100 oscillator.
The "Mashup" Problem Solved: Standard indicators like MACD are "unbounded" (they can go to infinity), while RSI is "bounded" (0-100). You cannot simply average them.
Our Solution: This script calculates the Z-Score of the MACD histogram relative to its historical deviation and normalizes it into a 0-100 percentile. This allows for a mathematically valid combination with RSI and Bollinger Bands.
The Component Logic:
Momentum (RSI): (Weight: 30%) Pure price velocity.
Volatility (Bollinger %B): (Weight: 25%) Relative position within volatility bands.
Trend Strength (Normalized MACD): (Weight: 25%) Uses the custom Z-Score logic described above.
Trend Integrity (ZLEMA): (Weight: 20%) We replaced the standard SMA with a custom Zero-Lag Exponential Moving Average (ZLEMA) algorithm. This removes the "lag" associated with traditional sentiment analysis, allowing the index to react to crypto volatility in real-time.
The Calculation: These raw values are weighted and smoothed to produce the final Index Value.
Greater than 80: Extreme Greed (High risk of reversal)
Less than 20: Extreme Fear (Potential accumulation zone)
2. Unique Features
A. FOMO & Panic Event Detection The script does not just track price; it tracks behavior.
FOMO (Fear Of Missing Out): Triggered when Price breaks the Upper Bollinger Band + RSI is Overbought + Volume spikes > 2.5x the average. This often marks local tops.
PANIC: Triggered when Price drops significantly in one bar + Volume spikes > 3.0x the average + RSI is Oversold. This often marks capitulation bottoms.
B. Divergence Detection The script automatically detects and plots Regular Bullish and Bearish divergences between Price and the Sentiment Index.
Bullish Divergence: Price makes a Lower Low, but Sentiment makes a Higher Low (indicating waning selling pressure).
Bearish Divergence: Price makes a Higher High, but Sentiment makes a Lower High (indicating waning buying pressure). Note: The script plots these signals precisely on the indicator line corresponding to the pivot point.
C. Multi-Timeframe (MTF) Engine Users can view the "Daily" sentiment score while trading on a 5-minute or 15-minute chart. This allows scalpers to align their trades with the higher-timeframe market psychology.
3. Usage Guide
Step 1: Trend Alignment Look at the dashboard or the main line color. Green indicates Greed/Uptrend, Red indicates Fear/Downtrend.
Step 2: Extremes
Sell/Take Profit: When the Index crosses 80 (Extreme Greed) or a "FOMO" triangle appears.
Buy/Long: When the Index crosses 20 (Extreme Fear) or a "PANIC" triangle appears.
Step 3: Confirmation Use the Divergence Dots as confirmation. A "Panic" signal followed by a "Bullish Divergence" dot is a high-probability reversal setup.
Settings
Timeframe: Select the MTF resolution (default is Chart).
Weights: You can adjust the influence of RSI, MACD, BB, or Trend to fit your specific asset class.
Visuals: Fully customizable colors, table position, and toggle switches for shapes/backgrounds.
Disclaimer: This script is for informational purposes only and does not constitute financial advice.
BTC - AXIS: Coppock + Williams %R CompositeTitle: BTC - AXIS: Coppock + Williams %R Composite | RM
Overview & Philosophy
AXIS (Advanced X-Momentum Intensity Score) is a specialized momentum composite designed to identify market structural shifts. In physics, an axis is the central line around which a body rotates; in this indicator, the Zero-Baseline acts as the AXIS for capital flow.
By fusing a slow-moving momentum engine ( Coppock Curve ) with a high-sensitivity tactical oscillator ( Williams %R ), this tool filters out the "market noise" that leads to overtrading and focuses on the high-conviction "Trend-Aligned Dips."
Methodology
Most indicators either suffer from too much lag (Moving Averages) or too much noise (Standard RSI). AXIS solves this through "Speed-Balanced Normalization."
1. Macro Engine (Coppock Curve): Named after Edwin Coppock, this component identifies major market bottoms by smoothing two separate Rates of Change (RoC). It is your structural compass.
2. Tactical Trigger (Williams %R): Created by Larry Williams, this measures the current close relative to the High-Low range.
• Re-centered Logic: Standard Williams %R oscillates between 0 and -100. Here, this is re-centered to oscillate around zero, ensuring it interacts mathematically correctly with the Coppock baseline.
3. The AXIS Score: The Composite line (Orange) is the weighted sum of these two engines. It provides a singular view of the market's "Net Momentum Intensity."
How to Read the Chart
🟧 The AXIS Composite (Orange Line): The primary signal line. It tracks the speed and exhaustion of the price by fusing macro and tactical data.
• Red Zone (> 150): Overheated. Short and long-term momentum are at extreme highs. Risk of a blow-off top or local reversal is high.
• Green Zone (< -150): Capitulation. The market is statistically exhausted. Historically, these zones represent high-conviction accumulation areas.
• Bullish Momentum (> 0): The market is rotating above the central Axis. Buyers are in control of the trend.
• Bearish Momentum (< 0): The market is rotating below the central Axis. Sellers are in control of the trend.
🟦 The Coppock Line (Blue): The macro filter. When Blue is above 0, the long-term trend is up.
🟥 The Williams %R Line (Red): The short-term cycles. Watch for divergences here to spot early trend fatigue.
Strategy: The "AXIS Alignment" Signal
The highest-conviction entry point—and the primary "Alpha" of this tool—occurs when:
The macro trend is Bullish ( Blue Line > 0 ).
The market experiences a correction, pushing the Orange (AXIS) Line into the Green Capitulation Zone.
The AXIS Score turns back upward.
This indicates that a short-term panic has been absorbed by a long-term bull trend—the ideal "Buy the Dip" scenario.
Settings
• Long/Short RoC: Standardized to 14/11 for cycle accuracy.
• Weighting: Allows you to prioritize trend (Coppock) or cycle sensitivity (%R).
• Visibility Toggles: Fully customizable display switches for each line.
Credits
• Edwin Coppock: For the foundation of long-term recovery momentum.
• Larry Williams: For the Percent Range methodology.
⚠️ Note: This indicator is optimized for the Daily (1D) Timeframe. Please switch your chart to 1D for accurate signal reading.
Disclaimer
This script is for research and educational purposes only. Past performance does not guarantee future results.
Tags
bitcoin, btc, axis, momentum, oscillator, coppock, williams r, on-chain, valuation, cycle, Rob Maths
Nifty Hierarchical Macro GuardOverview
The Nifty Hierarchical Macro Guard is a "Market Compass" indicator specifically designed for Indian equity traders. It locks its logic to the Nifty 50 Index (NSE:NIFTY) and applies a strict hierarchy of trend analysis. The goal is simple: prioritize the long-term trend (Monthly/Weekly) to decide if you should even be in the market, then use the short-term trend (Daily) for precise exit timing.
This script ensures you never ignore a macro "crash" signal while trying to trade minor daily fluctuations.
The Color Hierarchy (Priority Logic)
The indicator uses a "Top-Down" filter. Higher timeframe signals override lower timeframe signals:
Level 1: Monthly (Ultra-Macro) — Deep Maroon
Condition: Nifty 10 EMA is below the 20 EMA on the Monthly chart.
Action: This is the highest priority. The background will turn Deep Maroon, overriding all other colors. This is your "Forget Trading" signal. The long-term structural trend is broken.
Level 2: Weekly (Macro Warning) — Dark Red
Condition: Monthly is Bullish, but Nifty 10 EMA is below the 20 EMA on the Weekly chart.
Action: The background turns Dark Red. This indicates a significant macro correction. You should stay out of fresh positions and protect capital.
Level 3: Daily (Tactical) — Light Red / Light Green
Condition: Both Monthly and Weekly are Bullish (Green).
Action: The background will now react to the Daily 10/20 EMA cross.
Light Green: Nifty is healthy; safe for fresh positions.
Light Red: Tactical exit signal. Nifty is seeing short-term weakness; exit positions quickly.
Key Features
Symbol Locked: No matter what stock you are viewing (Reliance, HDFC, Midcaps), the background only reacts to NSE:NIFTY.
Clean Interface: No messy lines or labels on the price chart. The information is conveyed purely through background color shifts.
Customizable: Change the MA types (EMA/SMA) and lengths (e.g., 10/20 or 20/50) in the settings.
Macro Dashboard: A small, transparent table in the top-right corner displays exactly which timeframe is currently controlling the background color.
How to Use for Nifty Strategy
Stay Out: If the chart is Deep Maroon or Dark Red, do not look for "buying the dip." Wait for the macro health to return.
Take Exits: If the background is Light Green and suddenly turns Light Red, it means the Daily Daily 10/20 cross has happened. Exit your Nifty-sensitive positions immediately.
RSI Distribution [Kodexius]RSI Distribution is a statistics driven visualization companion for the classic RSI oscillator. In addition to plotting RSI itself, it continuously builds a rolling sample of recent RSI values and projects their distribution as a forward drawn histogram, so you can see where RSI has spent most of its time over the selected lookback window.
The indicator is designed to add context to oscillator readings. Instead of only treating RSI as a single point estimate that is either “high” or “low”, you can evaluate the current RSI level relative to its own recent history. This makes it easier to recognize when the market is operating inside a familiar regime, and when RSI is pushing into rarer tail conditions that tend to appear during momentum bursts, exhaustion, or volatility expansion.
To complement the histogram, the script can optionally overlay a Gaussian curve fitted to the sample mean and standard deviation. It also runs a Jarque Bera normality check, based on skewness and excess kurtosis, and surfaces the result both visually and in a compact dashboard. On the oscillator panel itself, RSI is presented with a clean gradient line and standard overbought and oversold references, with fills that become more visible when RSI meaningfully extends beyond key thresholds.
🔹 Features
1. Distribution Histogram of Recent RSI Values
The script stores the last N RSI values in an internal sample and uses that rolling window to compute a frequency distribution across a user selected number of bins. The histogram is drawn into the future by a configurable width in bars, which keeps it readable and prevents it from colliding with the active RSI plot. The result is a compact visual summary of where RSI clusters most often, whether it is spending more time near the center, or shifting toward higher or lower regimes.
2. Gaussian Overlay for Shape Intuition
If enabled, a fitted bell curve is drawn on top of the histogram using the sample mean and standard deviation. This overlay is not intended as a direct trading signal. Its purpose is to provide a fast visual comparator between the empirical RSI distribution and a theoretical normal shape. When the histogram diverges strongly from the curve, you can quickly spot skew, heavy tails, or regime changes that often occur when market structure or volatility conditions shift.
3. Jarque Bera Normality Check With Clear PASS/FAIL Feedback
The script computes skewness and excess kurtosis from the RSI sample, then forms the Jarque Bera statistic and compares it to a fixed 95% critical value. When the distribution is closer to normal under this test, the status is marked as PASS, otherwise it is marked as FAIL. This result is displayed in the dashboard and can also influence the histogram styling, giving immediate feedback about whether the recent RSI behavior resembles a bell shaped distribution or a more distorted, regime driven profile.
Jarque Bera is a goodness of fit test that evaluates whether a dataset looks consistent with a normal distribution by checking two shape properties: skewness (asymmetry) and kurtosis (tail heaviness, expressed here as excess kurtosis where a perfect normal has 0). Under the null hypothesis of normality, skewness should be near 0 and excess kurtosis should be near 0. The test combines deviations in both into a single statistic, which is then compared to a chi square threshold. A PASS in this script means the sample does not show strong evidence against normality at the chosen threshold, while a FAIL means the sample is meaningfully skewed, heavy tailed, or both. In practical trading terms, a FAIL often suggests RSI is behaving in a regime where extremes and asymmetry are more common, which is typical during strong trends, volatility expansions, or one sided market pressure. It is still a statistical diagnostic, not a prediction tool, and results can vary with lookback length and market conditions.
4. Integrated Stats Dashboard
A compact table in the top right summarizes key distribution moments and the normality result: Mean, StdDev, Skewness, Kurtosis, and the JB statistic with PASS/FAIL text. Skewness is color coded by sign to quickly distinguish right skew (more time at higher RSI) versus left skew (more time at lower RSI), which can be helpful when diagnosing trend bias and momentum persistence.
5. RSI Visual Quality and Context Zones
RSI is plotted with a gradient color scheme and standard overbought and oversold reference lines. The overbought and oversold areas are filled with a smart gradient so visual emphasis increases when RSI meaningfully extends beyond the 70 and 30 regions, improving readability without overwhelming the panel.
🔹 Calculations
This section summarizes the main calculations and transformations used internally.
1. RSI Series
RSI is computed from the selected source and length using the standard RSI function:
rsi_val = ta.rsi(rsi_src, rsi_len)
2. Rolling Sample Collection
A float array stores recent RSI values. Each bar appends the newest RSI, and if the array exceeds the configured lookback, the oldest value is removed. Conceptually:
rsi_history.push(rsi_val)
if rsi_history.size() > lookback
rsi_history.shift()
This maintains a fixed size window that represents the most recent RSI behavior.
3. Mean, Variance, and Standard Deviation
The script computes the sample mean across the array. Variance is computed as sample variance using (n - 1) in the denominator, and standard deviation is the square root of that variance. These values serve both the dashboard display and the Gaussian overlay parameters.
4. Skewness and Excess Kurtosis
Skewness is calculated from the standardized third central moment with a small sample correction. Kurtosis is computed as excess kurtosis (kurtosis minus 3), so the normal baseline is 0. These two metrics summarize asymmetry and tail heaviness, which are the core ingredients for the Jarque Bera statistic.
5. Jarque Bera Statistic and Decision Rule
Using skewness S and excess kurtosis K, the Jarque Bera statistic is computed as:
JB = (n / 6.0) * (S^2 + 0.25 * K^2)
Normality is flagged using a fixed critical value:
is_normal = JB < 5.991
This produces a simple PASS/FAIL classification suitable for fast chart interpretation.
6. Histogram Binning and Scaling
The RSI domain is treated as 0 to 100 and divided into a configurable number of bins. Bin size is:
bin_size = 100.0 / bins
Each RSI sample maps to a bin index via floor(rsi / bin_size), with clamping to ensure the index stays within valid bounds. The script counts occurrences per bin, tracks the maximum frequency, and normalizes each bar height by freq/max_freq so the histogram remains visually stable and comparable as the window updates.
7. Gaussian Curve Overlay (Optional)
The Gaussian overlay uses the normal probability density function with mu as the sample mean and sigma as the sample standard deviation:
normal_pdf(x) = (1 / (sigma * sqrt(2*pi))) * exp(-0.5 * ((x - mu)/sigma)^2)
For drawing, the script samples x across the histogram width, evaluates the PDF, and normalizes it relative to its peak so the curve fits within the same visual height scale as the histogram.
BTC - VDD Multiple (Approx)Overview & Philosophy
⚠️ Note: This indicator is optimized for the Daily (1D) Timeframe. Please switch your chart to 1D for accurate signal reading.
The BTC – VDD Multiple (Approx) is an advanced oscillator designed to identify market overheating and cycle tops by analyzing the velocity of value moving through the market.
In traditional On-Chain Analysis, Value Days Destroyed (VDD) is a premier metric for spotting macro tops. It multiplies the coin age (how long a coin was held) by the price at which it was moved. When old coins (HODLer money) move at high prices, VDD spikes, signaling massive profit-taking.
The Problem: Real "Coin Days Destroyed" (CDD) data is typically locked behind institutional paywalls or unavailable on standard TradingView plans.
The Solution: This script calculates a Deterministic Proxy. By analyzing the relationship between Exchange Volume, Price, and a Dormancy Constant, we can approximate the structure of the VDD Multiple without needing a premium data feed.
Methodology
The VDD Multiple works by comparing short-term market velocity against a long-term baseline.
1. The Proxy Calculation
Since we cannot directly access the age of coins on TradingView, we model the economic weight of the move:
Proxy Value = Exchange Volume * Price * Dormancy Factor
This creates a synthetic representation of "Value Throughput."
2. The Multiple
We compare the immediate heat of the market against the yearly trend:
• Short-Term MA (2 Days): Captures flash spikes and sudden liquidity exit events.
• Long-Term MA (365 Days): Represents the baseline "hum" of network activity.
VDD Multiple = Short Term MA / Long Term MA
How to Read the Chart
The indicator plots the Multiple as a line and uses background highlighting to signal extreme regimes.
🔴 The Red Zone (Overheated > 2.9)
Meaning: Current value transfer is ~3x higher than the yearly average.
Interpretation: Historically, sharp spikes into the Red Zone correlate with Local or Cycle Tops. This indicates that massive volume is changing hands at high prices—typically a sign of "Smart Money" distributing into "Dumb Money" FOMO.
Note: In strong bull runs, price can push higher even after a VDD spike, but the risk/reward ratio is extremely poor here.
🟢 The Green Zone (Undervalued < 0.75)
Meaning: Market activity is quiet and below the yearly baseline.
Interpretation: These are periods of apathy or accumulation. Historically, extended time spent in the Green Zone (the "flatline") has offered the best asymmetric buying opportunities.
🟠 The Orange Line (Neutral)
Meaning: The market is in transition or equilibrium.
Strategy & Context
This indicator is best used as a Macro Cycle Tool, not a day-trading signal.
• Exit Strategy: Look for "Clusters" of Red Spikes. A single spike often marks a local correction, but a cluster of intense spikes while price makes new highs (Divergence) is a strong Cycle Top warning.
• Entry Strategy: Historically the best entries occur when the indicator flattens out in the Green Zone for weeks or months. This suggests sellers are exhausted and the market has reached a floor.
Credits
This script is an approximation of the original VDD Multiple concept. Full credit for the underlying on-chain theory goes to the pioneers of this metric:
• Concept: The original Value Days Destroyed metric was popularized by Hans Hauge and Glassnode.
• The Multiple: The specific application of a Short/Long MA Multiple on VDD is widely attributed to analysts like TXMC and Bitbo.
This script adapts these concepts for the free TradingView environment using exchange volume proxies.
Settings
• Data Source: Defaults to BINANCE:BTCUSDT to capture high-volume liquidity.
• Short MA: Default is 2 Days to capture rapid velocity spikes.
• Long MA: Default is 365 Days to track the annual trend.
Disclaimer
This tool is an approximation based on exchange volume, not raw blockchain data. While exchange volume and on-chain volume are highly correlated during cycle extremes, they are not identical. This script is for educational and research purposes only. Past performance does not guarantee future results.
Tags
bitcoin, btc, onchain, vdd, cdd, valuation, cycle, top, bottom, Rob Maths
HMA & RSI Delta Hybrid SignalsA lag-free trend follower combining Hull Moving Average (HMA) with RSI Momentum Delta to filter false signals and catch high-probability reversals.
# 🚀 HMA & RSI Delta Hybrid Signals
This indicator represents a hybrid approach to trend trading by combining the smoothness of the **Hull Moving Average (HMA)** with the explosive detection capabilities of **RSI Momentum Delta**.
Unlike standard indicators that rely solely on price crossovers, this tool confirms the trend direction with the *velocity* of the price change (Momentum Delta), reducing false signals in choppy markets.
### 🧠 How It Works?
**1. Trend Detection (HMA):**
The script uses the **Hull Moving Average**, known for being extremely fast and lag-free, to determine the overall market direction.
* **Orange Line:** Represents the HMA Trend. The slope determines if we are in an Uptrend or Downtrend.
**2. Momentum Confirmation (RSI Delta):**
Instead of looking at raw RSI levels (like 70 or 30), this algorithm calculates the **"Delta"** (Absolute change from the previous bar).
* It asks: *"Is the price moving in the trend direction with enough speed?"*
* If the RSI jumps significantly (determined by the `Delta Threshold`), it confirms a strong entry.
### 🎯 Signal Modes (Sensitivity)
You can choose between two modes depending on your trading style:
* **🛡️ Conservative Mode (Default):**
* Strict filtering.
* Requires the Trend to match the HMA direction AND the RSI Delta to exceed the specific threshold (e.g., 0.8).
* *Best for:* Avoiding false signals in sideways markets.
* **⚔️ Aggressive Mode:**
* Faster entries.
* Requires the Trend to match the HMA direction AND any positive momentum change in RSI.
* *Best for:* Scalping or catching the very beginning of a move.
### ✨ Key Features
* **Non-Repainting Signals:** Once a bar closes, the signal is fixed.
* **Non-Repeating:** It will not spam multiple "BUY" signals in a row; it waits for a trend change or reset.
* **Visual Trend:** Background color changes based on the HMA slope (Green for Bullish, Purple for Bearish).
* **Fully Customizable:** Adjust HMA length, RSI period, and Delta sensitivity.
---
**⚠️ DISCLAIMER:** This tool is for educational and analytical purposes only. Always manage your risk.
Intraday Volume Pulse GSK-VIZAG-AP-INDIA📊 Intraday Volume Pulse — by GSK-VIZAG-AP-INDIA
Overview:
This indicator displays a simple and effective intraday volume summary in table format, starting from a user-defined session time. It provides an approximate breakdown of buy volume, sell volume, cumulative delta, and total volume — all updated in real-time.
🧠 Key Features
✅ Session Start Control
Choose the session start hour and minute (default is 09:15 for NSE).
🌐 Timezone Selector
View volume data in your preferred timezone: IST, GMT, EST, CST, etc.
📈 Buy/Sell Volume Estimation Logic
Buy Volume: When candle closes above open
Sell Volume: When candle closes below open
Equal: Volume split equally if Open == Close
🔄 Daily Auto-Reset
All volume metrics reset at the start of a new trading day.
🎨 Color-Coded Volume Insights
Buy Volume: Green shade if positive
Sell Volume: Red shade if positive
Cumulative Delta: Dynamic red/green based on net pressure
Total Volume: Neutral gray with emphasis text
🧾 Readable Number Formatting
Volumes are displayed in "K", "L", and "Cr" units for easier readability.
📌 Table Positioning
Choose from top/bottom corners to best fit your layout.
⚠️ Note
All data shown is approximate and based on candle structure — it does not reflect actual order book or tick-level data. This is a visual estimation tool to guide real-time intraday decisions.
✍️ Signature
GSK-VIZAG-AP-INDIA
Creator of practical TradingView tools focused on volume dynamics and trader psychology.
SCOTTGO - RSI Divergence IndicatorRSI Divergence Indicator
This indicator combines the Relative Strength Index (RSI) with an automatic divergence detection system.
It is designed to help traders spot potential trend changes by:
Color-Coded RSI: The main RSI line dynamically changes color (e.g., green/red) above and below a user-defined threshold (default 50) to highlight strong or weak momentum instantly.
Divergence Signals: It automatically identifies and plots four types of RSI divergences (Regular Bullish, Hidden Bullish, Regular Bearish, and Hidden Bearish) between the price and the oscillator.
Custom Alerts: Includes alerts for all divergence types so you can be notified when a new signal is found.
This tool helps visualize momentum shifts and potential reversals in the market.
EMA Slope Angle V2 Auto Threshold# EMA Slope Angle Indicator
## Overview
The EMA Slope Angle Indicator visualizes the Exponential Moving Average (EMA) slope as an angle in degrees, providing traders with a clear, quantitative measure of trend strength and direction. The indicator features **automatic threshold calculation based on Gaussian distribution**, making it adaptive to any market and timeframe.
## Key Features
### 🎯 **Automatic Threshold Calculation (NEW!)**
- **Gaussian Distribution-Based**: Automatically calculates optimal thresholds from the 50% interquartile range (IQR) of historical angle data
- **Asset-Adaptive**: Thresholds adjust to each instrument's unique volatility and price characteristics
- **No Manual Tuning Required**: Simply enable "Use Auto Thresholds" and let the indicator optimize itself
### 📊 **Dynamic EMA Coloring**
- **Color Intensity**: EMA line color intensity reflects slope strength
- **Visual Feedback**:
- Green shades for uptrends (darker = stronger)
- Red shades for downtrends (darker = stronger)
- Gray for flat/neutral conditions
### 📈 **Regime Detection**
- **Three Regimes**: RISING, FALLING, and FLAT
- **Smart Classification**: Based on statistical distribution of angles
- **Non-Repainting**: All calculations use confirmed bars only
### 🔔 **Trend-Shift Signals**
- **Visual Arrows**: Automatic signals when transitioning from FLAT to RISING/FALLING
- **Configurable**: Enable/disable signals as needed
- **Reliable**: Only triggers on significant regime changes
### 📋 **KPI Dashboard**
- **Real-Time Metrics**: Current angle, regime, and last signal
- **Auto-Threshold Display**: Shows calculated thresholds when auto-mode is active
- **Statistics**: Optional angle distribution statistics
- **Clean Layout**: Top-right corner, non-intrusive
### 📊 **Angle Statistics (Optional)**
- **Distribution Analysis**: Histogram of angle ranges
- **Dynamic Buckets**: Automatically adjusts to data distribution when auto-mode is enabled
- **Percentage Breakdown**: See how often each angle range occurs
## Settings
### Main Settings
- **EMA Length**: Period for the Exponential Moving Average (default: 50)
- **Slope Lookback Bars**: Number of bars to calculate slope over (default: 5)
### Angle Settings
- **Use Auto Thresholds**: Enable automatic threshold calculation (recommended!)
- **Analysis Period**: Number of bars to analyze for distribution (default: 500)
- **Manual Thresholds**: Flat, Rising, and Falling triggers (used when auto-mode is off)
- **Max Angle for Color Saturation**: Maximum angle for color intensity scaling
### Display Options
- **Colors**: Customize uptrend, downtrend, and flat colors
- **Show Signals**: Enable/disable trend-shift arrows
- **Show Statistics**: Display angle distribution table
- **Show Dashboard**: Toggle KPI dashboard visibility
## How It Works
### Angle Calculation
The indicator calculates the angle between the current EMA value and the EMA value N bars ago:
```
Angle = arctan((EMA_now - EMA_then) / lookback) × 180° / π
```
### Auto-Threshold Calculation
When enabled, the indicator:
1. Analyzes historical angle data over the specified period
2. Calculates mean and standard deviation
3. Determines thresholds based on the 50% interquartile range (IQR):
- **Flat Threshold**: ±0.674σ (middle 50% of data)
- **Rising Trigger**: 75th percentile (mean + 0.674σ)
- **Falling Trigger**: 25th percentile (mean - 0.674σ)
### Regime Classification
- **FLAT**: Angle within ±Flat Threshold
- **RISING**: Angle ≥ Rising Trigger
- **FALLING**: Angle ≤ Falling Trigger
## Use Cases
### Trend Following
- Identify strong trends (high angle values)
- Spot trend reversals (regime changes)
- Filter trades based on trend strength
### Range Trading
- Detect flat/consolidation periods
- Avoid trading during choppy markets
- Enter when regime shifts from FLAT to RISING/FALLING
### Multi-Timeframe Analysis
- Apply to different timeframes for confirmation
- Use higher timeframe for trend direction
- Use lower timeframe for entry timing
## Tips for Best Results
1. **Enable Auto-Thresholds**: Let the indicator adapt to your instrument
2. **Adjust Analysis Period**: Use more bars for stable markets, fewer for volatile ones
3. **Combine with Price Action**: Use regime changes as confirmation, not standalone signals
4. **Multi-Timeframe**: Check higher timeframes for trend context
5. **Backtest First**: Test settings on historical data before live trading
## Technical Details
- **Non-Repainting**: All calculations use `barstate.isconfirmed`
- **Pine Script v6**: Latest version for optimal performance
- **Efficient**: Minimal computational overhead
- **Customizable**: Extensive settings for fine-tuning
## Version History
**v2.0** (Current)
- Added automatic threshold calculation based on Gaussian distribution
- Dynamic bucket adjustment for statistics
- Enhanced dashboard with auto-threshold display
- Improved regime detection using IQR method
**v1.0**
- Initial release with manual thresholds
- Basic EMA coloring
- Trend-shift signals
- KPI dashboard
## Support
For questions, suggestions, or bug reports, please leave a comment or contact the author.
---
**Disclaimer**: This indicator is for educational purposes only. Past performance does not guarantee future results. Always use proper risk management and never risk more than you can afford to lose.
**Keywords**: EMA, slope, angle, trend, automatic thresholds, Gaussian distribution, regime detection, non-repainting, adaptive
Supply and Demand Zones [BigBeluga]🔵 OVERVIEW
The Supply and Demand Zones indicator automatically identifies institutional order zones formed by high-volume price movements. It detects aggressive buying or selling events and marks the origin of these moves as demand or supply zones. Untested zones are plotted with thick solid borders, while tested zones become dashed, signaling reduced strength.
🔵 CONCEPTS
Supply Zones: Identified when 3 or more bearish candles form consecutively with above-average volume. The script then searches up to 5 bars back to find the last bullish candle and plots a supply zone from that candle’s low to its low plus ATR.
Demand Zones: Detected when 3 or more bullish candles appear with above-average volume. The script looks up to 5 bars back for a bearish candle and plots a demand zone from its high to its high minus ATR.
Volume Weighting: Each zone displays the cumulative bullish or bearish volume within the move leading to the zone.
Tested Zones: If price re-enters a zone and touches its boundary after being extended for 15 bars, the zone becomes dashed , indicating a potential weakening of that level.
Overlap Logic: Older overlapping zones are removed automatically to keep the chart clean and only show the most relevant supply/demand levels.
Zone Expiry: Zones are also deleted after they’re fully broken by price (i.e., price closes above supply or below demand).
🔵 FEATURES
Auto-detects supply and demand using volume and candle structure.
Extends valid zones to the right side of the chart.
Solid borders for fresh untested zones.
Dashed borders for tested zones (after 15 bars and contact).
Prevents overlapping zones of the same type.
Labels each zone with volume delta collected during zone formation.
Limits to 5 zones of each type for clarity.
Fully customizable supply and demand zone colors.
🔵 HOW TO USE
Use supply zones as potential resistance levels where sell-side pressure could emerge.
Use demand zones as potential support areas where buyers might step in again.
Pay attention to whether a zone is solid (untested) or dashed (tested).
Combine with other confluences like volume spikes, trend direction, or candlestick patterns.
Ideal for swing traders and scalpers identifying key reaction levels.
🔵 CONCLUSION
Supply and Demand Zones is a clean and logic-driven tool that visualizes critical liquidity zones formed by institutional moves. It tracks untested and tested levels, giving traders a visual edge to recognize where price might bounce or reverse due to historical order flow.






















