OPEN-SOURCE SCRIPT
Zaktualizowano

EdgeMap

585
EdgeMap — Triple-Confirmed Statistical Price Extension Zones

EdgeMap overlays three independent mathematical frameworks on your chart to identify where price is statistically extended and where the highest-conviction mean reversion zones exist. Instead of arbitrary support and resistance lines, every level is grounded in quantifiable mathematics — ATR-based volatility envelopes, standard deviation channels from linear regression, and a volume-weighted cost-basis z-score. When all three frameworks converge, you have triple-confirmed statistical confluence — the strongest possible signal that price is at an extreme.

HOW IT WORKS

EdgeMap operates three separate measurement systems simultaneously. Each is anchored to a different mathematical basis and measures a different dimension of price behavior. The power comes from their independence — they have no shared inputs, so when they agree, the signal is stronger than any single measure.

Frame 1: ATR Envelopes. Five layers of ATR multiples (default 1x, 1.5x, 2x, 2.5x, 3x) are projected above and below the adaptive Donchian midline. These measure how far price has extended relative to its own recent volatility. The Donchian period adapts dynamically based on ATR velocity (fast ATR vs slow ATR ratio), expanding the lookback in high-volatility environments and contracting it in low-volatility ones. Each layer represents a progressively rarer price extension. The outer layers are zones price reaches infrequently, making them higher-conviction areas for mean reversion entries.

Frame 2: Linear Regression σ Channel. A linear regression line calculates the statistical best-fit slope of recent price action over a configurable lookback (default 80 bars). Standard deviation bands at 1σ, 2σ, and 3σ are plotted above and below this regression line. In a normal distribution, 68% of price action stays within 1σ, 95% within 2σ, and 99.7% within 3σ. Crypto assets have fat-tailed distributions, which means breaches of 2-3σ are rarer than the math predicts but tend to revert more aggressively — making these levels particularly useful for countertrend strategies.

Frame 3: RealPnL Z-Score. A lightweight replication of volume-weighted realized profit and loss pressure. Two rolling VWAPs (long-term and short-term) are blended to estimate the average holder's cost basis. The difference between current price and cost basis produces a profit/loss margin, which is weighted by relative volume and normalized into a z-score. Negative z-scores mean holders are underwater (discount territory). Positive z-scores mean holders are in profit (premium territory). This adds a sentiment dimension that pure price-based frameworks cannot capture — it tells you whether the people holding this asset are in pain or euphoria.

The critical difference between the three frames is what they measure. The ATR envelopes answer "how far from the range center is price?" The σ channel answers "how far from the trend slope is price?" The RealPnL z-score answers "how much pain or greed are holders experiencing?" When all three answers point to the same conclusion, you have triple-confirmed confluence.

TRIPLE-CONFIRMED CONFLUENCE DIAMONDS

EdgeMap continuously checks whether any ATR level falls within a configurable threshold (default 0.5%) of any σ level. When they converge, the ATR dots on that level turn yellow and the probability table marks the row with a ✦ symbol.

Colored diamonds appear on the chart only when all three frameworks agree simultaneously. A cyan diamond below the bar means price has reached a lower ATR level that converges with a σ level AND the RealPnL z-score is in discount territory (default z below -1.0). A magenta diamond above the bar means price has reached an upper confluence zone AND the RealPnL z-score is in premium territory (default z above +1.0).

This triple filter dramatically reduces false signals. Many price extensions occur at statistically significant ATR and σ levels, but if holders are not yet in pain (for buys) or not yet euphoric (for sells), the reversion catalyst may not be present. The RealPnL filter ensures that the sentiment conditions for mean reversion are actually in place before flagging the zone.

The RealPnL filter can be toggled on or off. When disabled, diamonds revert to dual confirmation (ATR + σ only). When enabled, diamonds become significantly rarer but significantly more meaningful.

PROBABILITY TABLE

The table in the corner displays real-time statistics for each ATR layer. The ATR Lvl column shows the price of the ATR envelope level. The σ Lvl column shows the nearest σ level price for comparison. The Prob % column shows the empirical probability of price reaching that ATR distance from the midline, calculated from the historical lookback (default 500 bars). Green probability means price visits that level frequently (common, less edge). Yellow means moderate probability. Red means rare extension (higher edge for mean reversion). The Conf column shows ✦ when ATR and σ levels converge at that layer, or — when they don't.

The ATR row displays the raw ATR value and raw standard deviation value. Comparing these gives you a quick read on regime — when σ is much larger than ATR, the regression sees more dispersion than volatility alone suggests, indicating a trending move rather than random noise.

The PnL Z row at the bottom shows the current RealPnL z-score and labels it DISCOUNT (cyan background), PREMIUM (magenta background), or NEUTRAL (gray background). This gives you an instant read on whether the third confirmation framework is active.

ADAPTIVE PRICE FORMATTING

All price labels and table values automatically adjust decimal precision based on the asset's price magnitude. Assets above $1,000 show one decimal place. Assets between $100-$999 show two decimals. Assets between $10-$99 show three decimals. Assets under $10 show four decimals. This ensures the levels are readable whether you're charting Bitcoin at $69,000 or a DeFi token at $1.20.

SETTINGS GUIDE

Adaptive Donchian: Match the Donchian Length and Adaptive K to your primary signal indicator for synchronized levels. Default 21 length with 0.4 adaptive K suits 30-minute to 1-hour timeframes.

ATR Envelopes: The five ATR multipliers control the spacing of the orange envelope layers. Default 1x through 3x provides good coverage from common levels to rare extremes. Adjust the multipliers if you want tighter or wider spacing for your asset's typical range.

Regression σ Channel: The Regression Length controls how many bars the linear regression looks back. Default 80 works well on 1H (about 3.3 days). For daily charts, reduce to 30-40. For 15-minute charts, increase to 120-150. The σ Layer values (1, 2, 3) set the standard deviation multipliers.

Confluence Detection: The Convergence Threshold controls how close an ATR level and σ level need to be (in percentage terms) to register as confluence. Default 0.5% is moderately strict. Widen to 1.0% for more confluence zones, tighten to 0.25% for stricter convergence.

RealPnL Filter: All RealPnL inputs should match your standalone RealPnL indicator settings for consistency. The Buy Z Threshold (default -1.0) sets how deep into discount territory the z-score must be for cyan buy diamonds. The Sell Z Threshold (default +1.0) sets how high into premium territory for magenta sell diamonds. Tighten to -1.5/+1.5 for fewer, higher-conviction diamonds. Loosen to -0.5/+0.5 for more signals. The filter can be toggled off entirely with the Require RealPnL Confirmation checkbox.

Probability Table: The Historical Lookback (default 500 bars) determines how many bars are sampled for probability calculations. Lower values make probabilities more responsive to recent conditions. Higher values give more stable long-term probabilities. The calculation runs every 50 bars to maintain performance.

WHAT EDGEMAP IS NOT

EdgeMap does not generate buy or sell signals. It does not tell you when to enter or exit a trade. It maps the statistical landscape of price extension across three independent dimensions — volatility (ATR), trend deviation (σ), and holder sentiment (RealPnL) — so you can see where the edge exists for mean reversion strategies. The triple-confirmed diamonds are location alerts with sentiment confirmation, not trade execution signals. Pair EdgeMap with a signal-generating indicator for complete trade execution.

BEST USED WITH

EdgeMap is designed as a companion overlay. It pairs naturally with any mean reversion or countertrend signal system. Use it to validate whether a buy or sell signal is occurring at a statistically significant price level with the right sentiment conditions, or to identify in advance where you expect high-conviction setups to emerge. The triple confirmation framework — location (ATR + σ) plus sentiment (RealPnL) — provides the "where" and "why" for your trading decisions, while your signal indicator provides the "when."
Informacje o Wersji
cosmetic
Informacje o Wersji
cosmetic
Informacje o Wersji
cosmetic
Informacje o Wersji
cosmetic
Informacje o Wersji
cosmetic
Informacje o Wersji
cosmetic
Informacje o Wersji
cosmetic
Informacje o Wersji
Cosmetic
Informacje o Wersji
Cosmetic
Informacje o Wersji
Cosmetic
Informacje o Wersji
cosmetic
Informacje o Wersji
Cosmetic
Informacje o Wersji
Cosmetic
Informacje o Wersji
added next buy/next sell targets to info table
Informacje o Wersji
cosmetic
Informacje o Wersji
cosmetic
Informacje o Wersji
cosmetic
Informacje o Wersji
cosmetic
Informacje o Wersji
cosmetic
Informacje o Wersji
cosmetic
Informacje o Wersji
cosmetic
Informacje o Wersji
cosmetic

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.