Tidal Divergence [JOAT]Tidal Divergence
Tidal Divergence is a composite divergence detector that lives in a sub-pane and projects high-conviction divergence visuals onto the price chart. The composite blends three volume-based oscillators — Money Flow Index, percentile-ranked Cumulative Volume Delta, and z-scored OBV rate-of-change — into a single normalized stream. Both regular and hidden divergences are detected. Persistent zones are drawn at divergence pivots, and zone mitigation is tracked with body / wick / rejection modes.
What makes it different
Single-oscillator divergence indicators give a single perspective. Tidal Divergence's composite triangulates three independent volume-derived oscillators so a divergence in the composite is supported by three volume readings instead of one.
Hidden divergences (continuation pattern: price higher low plus oscillator lower low for bull) are detected separately from regular divergences (reversal pattern), with distinct line styles on the price chart.
Each detected divergence creates a persistent demand or supply zone with optional FVG-confluence gating, dynamic alpha-by-age (zones fade as they age), and explicit mitigation logic (body / wick / two-close rejection variants).
A composite percentile envelope (5th to 95th percentile of the last 200 bars) is drawn behind the oscillator so absolute readings are easy to interpret in context.
How it works
MFI(14), daily-reset CVD then ta.percentrank(cvd, 100), OBV ROC z-score over a 20-bar mean / stdev. Three legs, each normalized to roughly the same scale.
Composite equals 0.40 times the normalized MFI plus 0.35 times the normalized CVD percentile plus 0.25 times the clamped OBV ROC z. Hull-smoothed and scaled to centi-percent.
Pivots are detected on the composite stream. A regular bull divergence requires a price lower low paired with a composite higher low within a 5-to-60-bar window. Hidden bull requires a price higher low plus composite lower low. Bear variants invert the conditions.
At each divergence pivot, two horizontal lines are drawn (edge equals lowest wick / highest wick. base equals lowest body / highest body), with a linefill between them, on the price chart via force_overlay=true.
Zone mitigation: body mode (close beyond edge) or wick mode (high/low beyond edge), optionally with two-close rejection requirement.
Optional FVG confluence requires a recent 3-bar Fair Value Gap before firing the divergence-final alert.
Reading the chart
In-pane : composite line tinted by direction with a smoothed signal line, gradient ribbon between them, breath-modulated zero midline, plus and minus 70 overbought / oversold thresholds, and the percentile envelope as an atmospheric backdrop.
In-pane divergence markers : regular divergences as solid connector plots, hidden divergences as broken (dashed-equivalent) connectors.
Cross-pane : price-to-price divergence connector lines on the price chart (regular solid, hidden dashed). Each line has a small REG BULL DIV 4520.50 or HID BEAR DIV label at the current pivot.
Cross-pane zone fills with age-graded transparency.
Zone edge price labels follow the right edge of each active zone.
Mitigation flash labels print at the bar where a zone is broken.
A cross-pane composite tint paints a soft mint / red background when the composite is clearly above or below plus or minus 30.
Signals
Regular bullish / bearish divergence
Hidden bullish / bearish divergence (continuation)
Bull / bear zone touch
Bull / bear zone mitigated
Bull / bear stack (three or more active zones plus a fresh regular divergence)
Bull / bear streak (composite above / below zero for N consecutive bars)
All gated on barstate.isconfirmed or barstate.ishistory. No future references. No lookahead_on.
Inputs
MFI : MFI length.
Divergence : pivot lookback left / right, detect hidden divergences toggle.
Zones : zone extreme length, max zone age, mitigation mode, allow-rejection toggle.
FVG Confluence : require FVG, FVG lookback bars.
Visual : bullish / bearish colors.
Cross-pane Visuals : divergence lines, divergence labels, zone edge labels, composite tint.
Dashboard : position, size.
How traders use this
Reversal entries : a regular bull divergence with the composite leaving an oversold extreme is a high-quality long setup, especially when accompanied by an FVG below the divergence price.
Continuation entries : a hidden bull divergence during a clearly trending bull regime is a structurally supported add-on entry on a pullback.
Zone trades : after a divergence prints, treat its zone as an active demand or supply level. Reactions to the zone (touch with rejection candles) are tradable. Mitigation invalidates the level.
Composite filter : only trade with the composite in agreement (composite above 0 for longs). The cross-pane tint helps you stay aligned without checking the pane.
Limitations
Divergence detection inherently lags the actual extreme by the right-pivot window.
Composite values are smoothed and need warm-up bars before they stabilize.
Cumulative Volume Delta is a tick-volume proxy, not true level-2 order flow.
A divergence is a probability, not a guarantee. Many divergences fail before completing their implied reversal.
Compatibility
Pine Script v6 open-source indicator (pane plus cross-pane). Any symbol with volume data. Cross-pane elements use force_overlay=true. No request.security calls.
Defaults
14-bar MFI, 14-left / 5-right pivot, body mitigation, FVG confluence off by default, mint / red palette, top-right medium dashboard. Enable FVG confluence to filter for higher-quality setups.
Indicator

MACD Pressure Zones | Alpha S+MACD Pressure Zones
MACD Pressure Zones is a normalized MACD histogram oscillator designed to show momentum pressure on a 0 to 100 scale.
Instead of displaying the raw MACD histogram around a zero line, this script normalizes the histogram over a selected lookback period and maps it into a bounded oscillator range. This allows users to compare MACD histogram pressure across different market conditions with fixed reference zones such as 90, 85, 50, 15, and 10.
The script does not provide entry or exit recommendations. Its purpose is to help users study momentum pressure, extended momentum areas, neutral pressure, and cooling or heating behavior inside a simplified MACD-based zone structure.
────────────────────
Core Concept
────────────────────
The standard MACD histogram shows the distance between the MACD line and the signal line.
When the histogram expands, momentum pressure is increasing.
When the histogram contracts, momentum pressure is weakening.
This script takes that MACD histogram value and normalizes it into a 0 to 100 range.
The normalized structure uses five main reference levels:
• 90: Extreme upper momentum pressure
• 85: Upper pressure zone
• 50: Neutral pressure level
• 15: Lower pressure zone
• 10: Extreme lower momentum pressure
The red line is a smoothed version of the normalized MACD histogram. It helps users read the broader momentum pressure curve rather than reacting to every individual histogram bar.
────────────────────
What This Script Shows
────────────────────
The script can display:
• normalized MACD histogram columns
• smoothed MACD pressure line
• 90 and 85 upper pressure levels
• 50 neutral pressure level
• 15 and 10 lower pressure levels
• upper and lower zone background highlights
• histogram expansion or contraction state
• current pressure zone
• momentum heating or cooling state
• positive or negative pressure bias
• number of bars spent inside upper or lower pressure zones
• optional status panel
These elements are designed to help users identify whether MACD histogram pressure is extended, recovering, cooling, expanding, or returning toward neutral.
────────────────────
How It Works
────────────────────
1. The script calculates the MACD line using the selected fast and slow EMA lengths.
2. The signal line is calculated from the MACD line.
3. The MACD histogram is calculated as MACD minus signal.
4. The histogram is normalized over the selected lookback period.
5. The normalized value is mapped into a 0 to 100 oscillator range.
6. A smoothed red pressure line is calculated from the normalized oscillator.
7. The script compares the pressure line with the 90, 85, 50, 15, and 10 reference levels.
8. Zone background highlights appear when the pressure line enters upper or lower pressure areas.
9. Histogram columns become visually stronger or weaker depending on expansion or contraction.
10. The status panel summarizes current pressure, zone, momentum state, bias, zone duration, and histogram condition.
This structure converts MACD histogram behavior into a cleaner zone-based momentum pressure map.
────────────────────
Inputs And Customization
────────────────────
Users can adjust:
• MACD fast length
• MACD slow length
• MACD signal length
• source price
• normalization lookback
• red line smoothing length
• 0 to 100 clamping
• extreme upper pressure level
• upper pressure level
• neutral pressure level
• lower pressure level
• extreme lower pressure level
• zone background visibility
• histogram visibility
• red line visibility
• status panel visibility
• panel position
• panel text size
• histogram colors
• red line color
• reference level color
• panel background color
The default levels are designed around a 90 / 85 / 50 / 15 / 10 pressure-zone framework.
────────────────────
Visual Elements
────────────────────
The script includes:
• normalized histogram columns
• smoothed red pressure line
• horizontal reference levels
• upper pressure background
• lower pressure background
• status panel
The histogram columns show the normalized MACD histogram value.
The red line smooths the normalized histogram and makes the pressure cycle easier to read.
The 50 level acts as the neutral pressure reference.
The 85 and 90 levels mark upper momentum pressure zones.
The 15 and 10 levels mark lower momentum pressure zones.
The panel summarizes the current state without adding directional trade labels to the chart.
────────────────────
Reference States
────────────────────
Extreme Upper Pressure:
The smoothed pressure line is at or above the upper extreme level.
Upper Pressure:
The smoothed pressure line is inside the upper pressure zone.
Positive Pressure:
The pressure line is above the neutral level but below the upper pressure zone.
Neutral Pressure:
The pressure line is near the neutral reference level.
Negative Pressure:
The pressure line is below the neutral level but above the lower pressure zone.
Lower Pressure:
The smoothed pressure line is inside the lower pressure zone.
Extreme Lower Pressure:
The smoothed pressure line is at or below the lower extreme level.
Heating:
The smoothed pressure line is rising.
Cooling:
The smoothed pressure line is falling.
Expanding:
The normalized histogram is increasing compared with the prior bar.
Contracting:
The normalized histogram is decreasing compared with the prior bar.
These states are informational and should not be interpreted as trading instructions.
────────────────────
How To Use
────────────────────
Use this script as a MACD histogram pressure and momentum-zone viewer.
General interpretation examples:
• When the red line is above 85, MACD histogram pressure is in an upper extended area.
• When the red line is above 90, the upper pressure condition is more extreme.
• When the red line moves down from the upper pressure zone, momentum pressure may be cooling.
• When the red line is near 50, MACD histogram pressure is closer to neutral.
• When the red line is below 15, MACD histogram pressure is in a lower extended area.
• When the red line is below 10, the lower pressure condition is more extreme.
• When the red line rises from the lower pressure zone, momentum pressure may be heating.
• Zone Bars can help users see how long the pressure line has remained in an upper or lower pressure zone.
• Histogram expansion can show strengthening pressure, while contraction can show fading pressure.
This script is best reviewed together with price action, trend structure, volatility, support and resistance, and higher-timeframe context.
────────────────────
Confirmation And Repainting Notes
────────────────────
The script calculates MACD, the histogram, normalization range, and the smoothed pressure line from available chart data.
On realtime candles, values can change before the candle closes because the MACD histogram and normalization values can update intrabar.
For more conservative analysis, users should review the oscillator after candle confirmation.
The script does not use future price data to predict market direction.
────────────────────
Limitations
────────────────────
This script does not predict future price movement.
It does not provide entry or exit recommendations.
A high pressure reading does not guarantee a reversal.
A low pressure reading does not guarantee a rebound.
MACD histogram behavior can remain extended during strong trends.
Normalization depends on the selected lookback period, so readings may change when the lookback setting changes.
Different symbols and timeframes may require different settings.
This script should not be used as a standalone trading system.
────────────────────
Disclaimer
────────────────────
This publication is for educational and informational chart analysis only.
It does not constitute financial advice, investment advice, or a recommendation to trade any financial instrument.
All trading and investment decisions are the responsibility of the user.
━━━━━━━━━━━━━━━━━━━━
MACD Pressure Zones
MACD Pressure Zones는 MACD 히스토그램을 0~100 범위로 정규화하여 모멘텀 압력 구간을 보여주는 오실레이터형 지표입니다.
일반 MACD 히스토그램을 0선 중심으로 표시하는 대신, 이 스크립트는 선택한 lookback 구간 안에서 히스토그램 값을 정규화하고 이를 고정된 오실레이터 범위로 변환합니다. 이를 통해 90, 85, 50, 15, 10과 같은 기준 구간을 사용해 다양한 시장 상황의 MACD 히스토그램 압력을 비교할 수 있습니다.
이 지표는 진입 또는 청산 추천을 제공하지 않습니다. 목적은 모멘텀 압력, 확장된 모멘텀 구간, 중립 압력, cooling 또는 heating 상태를 단순한 MACD 기반 구간 구조 안에서 분석하는 것입니다.
────────────────────
핵심 개념
────────────────────
일반 MACD 히스토그램은 MACD 라인과 시그널 라인 사이의 거리를 보여줍니다.
히스토그램이 확장되면 모멘텀 압력이 증가하는 상태로 볼 수 있습니다.
히스토그램이 수축되면 모멘텀 압력이 약해지는 상태로 볼 수 있습니다.
이 스크립트는 MACD 히스토그램 값을 0~100 범위로 정규화합니다.
정규화된 구조는 다섯 개의 주요 기준선을 사용합니다.
• 90: 극단적 상단 모멘텀 압력
• 85: 상단 압력 구간
• 50: 중립 압력 기준선
• 15: 하단 압력 구간
• 10: 극단적 하단 모멘텀 압력
빨간선은 정규화된 MACD 히스토그램을 평활화한 값입니다. 개별 히스토그램 막대보다 넓은 모멘텀 압력 곡선을 읽는 데 도움을 줍니다.
────────────────────
이 스크립트가 보여주는 것
────────────────────
이 스크립트는 다음 요소를 표시할 수 있습니다.
• 정규화된 MACD 히스토그램 막대
• 평활화된 MACD 압력선
• 90 및 85 상단 압력 기준선
• 50 중립 압력 기준선
• 15 및 10 하단 압력 기준선
• 상단 및 하단 구간 배경 강조
• 히스토그램 확장 또는 수축 상태
• 현재 압력 구간
• 모멘텀 heating 또는 cooling 상태
• positive 또는 negative 압력 방향
• 상단 또는 하단 압력 구간 체류 봉 수
• 선택 가능한 상태 패널
이 요소들은 MACD 히스토그램 압력이 확장, 회복, 둔화, 확장 지속, 또는 중립 회귀 중 어디에 가까운지 확인하는 데 도움을 줍니다.
────────────────────
작동 방식
────────────────────
1. 선택한 fast EMA와 slow EMA 길이를 사용해 MACD 라인을 계산합니다.
2. MACD 라인에서 시그널 라인을 계산합니다.
3. MACD에서 시그널을 뺀 값으로 MACD 히스토그램을 계산합니다.
4. 선택한 lookback 구간에서 히스토그램을 정규화합니다.
5. 정규화된 값을 0~100 오실레이터 범위로 변환합니다.
6. 정규화 오실레이터에서 평활화된 빨간 압력선을 계산합니다.
7. 압력선을 90, 85, 50, 15, 10 기준선과 비교합니다.
8. 압력선이 상단 또는 하단 압력 구간에 진입하면 배경이 강조됩니다.
9. 히스토그램 막대는 확장 또는 수축 여부에 따라 다르게 표시됩니다.
10. 상태 패널은 현재 압력, 구간, 모멘텀 상태, 방향성, 구간 체류 시간, 히스토그램 상태를 요약합니다.
이 구조는 MACD 히스토그램 행동을 더 깔끔한 구간 기반 모멘텀 압력 맵으로 변환합니다.
────────────────────
입력값 및 설정
────────────────────
사용자는 다음 항목을 조정할 수 있습니다.
• MACD fast length
• MACD slow length
• MACD signal length
• source price
• normalization lookback
• red line smoothing length
• 0 to 100 clamping
• extreme upper pressure level
• upper pressure level
• neutral pressure level
• lower pressure level
• extreme lower pressure level
• zone background visibility
• histogram visibility
• red line visibility
• status panel visibility
• panel position
• panel text size
• histogram colors
• red line color
• reference level color
• panel background color
기본 기준선은 90 / 85 / 50 / 15 / 10 압력 구간 구조를 중심으로 설계되어 있습니다.
────────────────────
시각 요소
────────────────────
이 스크립트는 다음 시각 요소를 포함합니다.
• 정규화 히스토그램 막대
• 평활화된 빨간 압력선
• 수평 기준선
• 상단 압력 배경
• 하단 압력 배경
• 상태 패널
히스토그램 막대는 정규화된 MACD 히스토그램 값을 보여줍니다.
빨간선은 정규화된 히스토그램을 평활화하여 압력 사이클을 더 쉽게 읽게 해줍니다.
50선은 중립 압력 기준선 역할을 합니다.
85와 90은 상단 모멘텀 압력 구간을 표시합니다.
15와 10은 하단 모멘텀 압력 구간을 표시합니다.
패널은 차트에 방향성 매매 라벨을 추가하지 않고도 현재 상태를 요약합니다.
────────────────────
참고 상태
────────────────────
Extreme Upper Pressure:
평활화된 압력선이 상단 극단 기준선 이상에 있는 상태입니다.
Upper Pressure:
평활화된 압력선이 상단 압력 구간에 있는 상태입니다.
Positive Pressure:
압력선이 중립 기준선 위에 있지만 상단 압력 구간 아래에 있는 상태입니다.
Neutral Pressure:
압력선이 중립 기준선 부근에 있는 상태입니다.
Negative Pressure:
압력선이 중립 기준선 아래에 있지만 하단 압력 구간 위에 있는 상태입니다.
Lower Pressure:
평활화된 압력선이 하단 압력 구간에 있는 상태입니다.
Extreme Lower Pressure:
평활화된 압력선이 하단 극단 기준선 이하에 있는 상태입니다.
Heating:
평활화된 압력선이 상승 중인 상태입니다.
Cooling:
평활화된 압력선이 하락 중인 상태입니다.
Expanding:
정규화된 히스토그램이 직전 봉보다 증가하는 상태입니다.
Contracting:
정규화된 히스토그램이 직전 봉보다 감소하는 상태입니다.
이 상태들은 정보 제공용이며, 매매 지시로 해석해서는 안 됩니다.
────────────────────
사용 방법
────────────────────
이 스크립트는 MACD 히스토그램 압력 및 모멘텀 구간 확인 도구로 사용하는 것이 적절합니다.
일반적인 해석 예시는 다음과 같습니다.
• 빨간선이 85 위에 있으면 MACD 히스토그램 압력이 상단 확장 구간에 있는 상태로 볼 수 있습니다.
• 빨간선이 90 위에 있으면 더 극단적인 상단 압력 상태로 볼 수 있습니다.
• 빨간선이 상단 압력 구간에서 하락하면 모멘텀 압력이 cooling 되는 과정일 수 있습니다.
• 빨간선이 50 부근에 있으면 MACD 히스토그램 압력이 중립에 가까운 상태입니다.
• 빨간선이 15 아래에 있으면 MACD 히스토그램 압력이 하단 확장 구간에 있는 상태로 볼 수 있습니다.
• 빨간선이 10 아래에 있으면 더 극단적인 하단 압력 상태로 볼 수 있습니다.
• 빨간선이 하단 압력 구간에서 상승하면 모멘텀 압력이 heating 되는 과정일 수 있습니다.
• Zone Bars는 압력선이 상단 또는 하단 압력 구간에 얼마나 오래 머물렀는지 확인하는 데 사용할 수 있습니다.
• Histogram expansion은 압력 강화, contraction은 압력 둔화를 보여줄 수 있습니다.
이 스크립트는 가격 행동, 추세 구조, 변동성, 지지와 저항, 상위 시간대 컨텍스트와 함께 검토하는 것이 좋습니다.
────────────────────
확인봉 및 리페인트 안내
────────────────────
이 스크립트는 사용 가능한 차트 데이터를 기준으로 MACD, 히스토그램, 정규화 범위, 평활화된 압력선을 계산합니다.
실시간 캔들에서는 MACD 히스토그램과 정규화 값이 봉 마감 전까지 변경될 수 있으므로 값이 변할 수 있습니다.
보다 보수적인 분석을 원한다면 봉 마감 이후 오실레이터를 검토하는 것이 적절합니다.
이 스크립트는 미래 가격 데이터를 사용해 시장 방향을 예측하지 않습니다.
────────────────────
한계
────────────────────
이 스크립트는 미래 가격 움직임을 예측하지 않습니다.
진입 또는 청산 추천을 제공하지 않습니다.
높은 압력 수치가 반전을 보장하지 않습니다.
낮은 압력 수치가 반등을 보장하지 않습니다.
강한 추세에서는 MACD 히스토그램 압력이 오랜 시간 확장 구간에 머무를 수 있습니다.
정규화 값은 선택한 lookback period에 따라 달라질 수 있습니다.
종목과 시간대에 따라 적절한 설정값이 달라질 수 있습니다.
이 스크립트를 단독 매매 시스템으로 사용해서는 안 됩니다.
────────────────────
중요 고지
────────────────────
본 게시물은 교육 및 정보 제공 목적의 차트 분석 자료입니다.
투자 자문, 특정 금융상품 거래 권유, 또는 수익 보장을 의미하지 않습니다.
모든 투자 판단과 그 결과에 대한 책임은 이용자 본인에게 있습니다.
Indicator

Explainable Quant Scorecard [TradeDots]Explainable Quant Scorecard
Summary
This indicator computes a composite 0 to 100 evidence score by combining seven independent normalized sub-scores: Trend, Momentum, Volatility Regime, Participation, Relative Strength, Exhaustion Risk, and Multi-Timeframe Alignment. The composite is regime-dependent: when ADX indicates a trending regime, the trend and momentum weights are boosted; when ADX indicates a range regime, the exhaustion-risk weight is boosted instead. All factor weights are exposed as inputs so the model is fully auditable and tunable. A flagship dashboard panel displays every sub-score, the composite, the active regime, and a one-line interpretation.
The intent is to give traders a transparent multi-factor reading on every bar rather than another single-indicator signal. The composite is an evidence score, not a probability or prediction.
What is original here
Composite indicators that mash several oscillators together exist in the public library. This script's contributions are:
Honest factor separation. Each sub-score measures a different dimension (trend, momentum, volatility, participation, relative strength, exhaustion, multi-timeframe). Many composites silently combine correlated readings (such as two momentum oscillators) and present the result as if it were multi-factor confirmation. This script's seven factors are deliberately chosen to be diverse.
Regime-dependent weighting. The composite is not a fixed weighted average. When the market is trending, trend and momentum factors carry more weight; when ranging, exhaustion-risk carries more. This addresses the well-known problem that trend-following inputs and mean-reversion inputs should not be weighted equally in all conditions.
Sub-score divergence detection. The script tracks the maximum deviation of any sub-score from the composite. A large deviation triggers a "sub-score divergence" alert, warning the trader that the factors disagree even when the composite looks clean.
Full transparency. All weights, all thresholds, and the regime trigger levels are user inputs. No black-box.
How it works
Each bar, seven sub-scores are computed.
1. Trend score. EMA slope over a configurable lookback, normalized to 0 to 100 via min-max over a percentile window.
2. Momentum score. Rate-of-change of close over a configurable length, min-max normalized.
3. Volatility regime score. Bollinger Bandwidth percentile mapped to a discrete numeric: compressed BBW (below the lower threshold) maps to 30, expanding BBW (above the upper threshold) maps to 70, normal BBW maps to 50. A label ("Compressed", "Normal", "Expanding") is generated alongside the numeric.
4. Participation score. Volume percentile multiplied by a close-location alignment factor. For a bullish-direction reading, a close near the bar's high earns full alignment; for a bearish-direction reading, a close near the bar's low. The result is a 0 to 100 score that rewards volume and direction-consistent closes.
5. Relative strength score. The asset's return over a configurable horizon, minus the benchmark's return over the same horizon, divided by the asset's own volatility. The result is percentile-ranked over a longer lookback (default 252 bars) to produce a 0 to 100 reading. The benchmark symbol is a user input.
6. Exhaustion risk score. Distance from the trend EMA in ATR units, mapped inversely to 0 to 100 (high exhaustion gives a low exhaustion-score, which is consistent with the convention that high scores are "good" for the composite). The dashboard inverts the label so users see "Exhaustion: High" rather than "Exhaustion: 20".
7. Multi-timeframe alignment score. The trend direction (EMA-fast vs EMA-slow) is fetched at three user-configurable higher timeframes. Each HTF's agreement with the chart-timeframe direction contributes 100, 50, or 0 to the alignment score. The final factor is the average across three timeframes.
The composite is the weighted average. When regime_weighting is enabled and ADX indicates a trending regime (above the user threshold), the trend and momentum weights are multiplied by 1.5 and the exhaustion-risk weight by 0.5. When ADX indicates a range regime (below the lower threshold), the trend and momentum weights are multiplied by 0.5 and the exhaustion-risk weight by 1.5. In a "Mixed" regime, weights are unchanged.
A four-line interpretation is assigned by composite range:
75 or higher : "Constructive, multi-factor agreement"
60 to 74 : "Mixed but constructive"
40 to 59 : "Mixed — wait for alignment"
below 40 : "Bearish or unclear"
Repainting and data integrity
All sub-scores are computed on confirmed bar values. Alerts are gated by barstate.isconfirmed. The benchmark and the three multi-timeframe trend references are fetched with request.security() using prior-bar sources together with barmerge.lookahead_on — the standard non-repainting idiom that returns the last confirmed value from the requested context. These calls do not access future data.
How to read the chart
The composite is plotted as a line in the indicator pane, color-shifted on a red-to-green gradient based on the score.
Horizontal reference lines at 25, 50, and 75 demarcate bearish, midpoint, and bullish zones.
Sub-score plots are available but off by default to keep the pane clean. They can be enabled via input toggle.
The dashboard panel shows the direction in the header, then a row for each of the seven sub-scores (numeric or labelled), then a divider, then the composite score, then the interpretation line and the active regime.
Inputs
Inputs are grouped into seven sections.
Core Settings : trend EMA lengths and norm lookback, momentum ROC length, generic norm lookback, BB length and multiplier, ATR length, ADX length.
Relative Strength : benchmark symbol, RS return horizon, RS volatility length, RS percentile lookback.
Multi-Timeframe : three HTF inputs (default 60-minute, 240-minute, daily).
Factor Weights : a 0 to N weight for each of the seven sub-scores.
Regime Modulation : regime-weighting enable toggle, trend ADX threshold, range ADX threshold.
Visual Settings : dashboard toggle, panel position, panel size, panel background color, composite-plot toggle, sub-score-plot toggle.
Any Alert() function call conditions : per-alert toggles.
Alerts
Four alert conditions are provided:
Score ≥ 75 Bullish (composite at or above 75 with trend direction up)
Score ≥ 75 Bearish (composite at or above 75 with trend direction down)
Score Regime Flipped (composite crossed the 50 midpoint in either direction)
Sub-Score Divergence (any sub-score moves more than 30 points from the composite — a warning that factors disagree)
Each is declared via alertcondition() and fired programmatically through alert() when the corresponding input toggle is enabled, with alert.freq_once_per_bar_close. Alert messages include {{ticker}}, {{interval}}, and {{close}} placeholders.
How to use this script
Read this indicator as your master "is the evidence stack constructive" check, not as an entry trigger.
A composite of 75 or higher with trend direction up is the suite's highest-conviction long setup; the inverse for shorts.
Read the regime cell. In a trending regime, weight your decision toward the trend and momentum sub-scores. In a range regime, weight toward exhaustion risk and relative strength.
If the dashboard shows a high composite but the "Sub-Score Divergence" alert is firing, the agreement is shallow — investigate which factor disagrees before sizing up.
Pair with a setup-specific indicator (sweep, breakout, zone) for entry timing. This script does not give entries.
Limitations and honest caveats
The composite is a weighted heuristic combination of normalized factors, not a calibrated probability. A composite of 80 does not imply an 80% probability of any outcome.
Regime detection uses ADX, which is lagging. The regime label will not reflect a fresh regime change on the first bar.
The Relative Strength benchmark is a single symbol chosen by the user. Choosing an inappropriate benchmark (for example, comparing a small-cap stock to a crypto-currency benchmark) will produce noisy RS readings.
The three MTF references add request.security() calls. On instruments without history at those timeframes, the MTF score may be incomplete on early bars.
Composite values pin to one tail when factor weights are mis-configured. The default weights are reasonable starting values; users are expected to tune for their instrument and timeframe.
The script makes no claim about which direction price will move; it scores the evidence stack currently visible.
Disclaimer
This script is published for informational and educational purposes. It is not investment advice and is not a recommendation to buy or sell any instrument. Composite evidence scores are descriptive, not predictive. Users are solely responsible for their own trading decisions and risk management.
Indicator

CDC Action Zone+TrueMarket Mean (BTC Focus) By Beckte## Overview
This indicator is a macro-focused trend following and cyclical value tracking tool, specifically designed for Bitcoin (BTC) long-term investors. It combines the momentum logic of the well-known **CDC Action Zone** with a mathematical simulation of the On-Chain **Realized Price** model.
The main purpose of this script is to identify high-probability, macro-generational accumulation zones while filtering out early or false bottom signals during aggressive downtrends.
---
## Key Components
### 1. CDC Action Zone (Trend & Momentum)
Based on the classic EMA 12 and EMA 26 crossover logic, this component colors the candlesticks to reflect the market's current momentum:
- 🟢 **Bright Green:** Strong Bullish Momentum (Hold / Trend is up)
- 🔵 **Blue:** Early Bullish Sign / Potential Reversal (Watch closely or start accumulation)
- 🔴 **Bright Red:** Strong Bearish Momentum (Stay in cash / Wait)
- 🟠 **Orange:** Early Bearish Sign / Technical Rebound in Bear Market
### 2. Realized Price Proxy (The Cyclical Floor)
In on-chain analysis, the **Realized Price** represents the average cost basis of all aggregate Bitcoin supply moving on-network, without omitting lost or dormant coins.
Since native on-chain data requires external API subscriptions on PulseWire, this script utilizes a specialized long-term statistical proxy (**730-day SMA with custom logarithmic offsets**) to simulate this ultimate cyclical floor. Historically, major bear market bottoms (2015, 2018, 2022) have strictly formed near or slightly below this baseline.
---
## How it Works & Entry Strategy (The Anti-Doi Mechanism)
To avoid catching falling knives during a capitulation event, this script enforces a strict double-confirmation rule:
1. **Value Zone Check:** The current market price must correct down to within **10% of the Realized Price Proxy** (the light blue line). This ensures you are buying Bitcoin at an extreme discount relative to historical network value.
2. **Momentum Trigger:** Once inside the Value Zone, the script waits for the **CDC Action Zone to flip from Red/Orange to Blue or Green**.
When both conditions are met, a **"REALIZED BUY"** label will plot beneath the candlestick, signaling a safe, low-risk entry spot with a highly compressed downside.
---
## Disclaimer & Credits
- **Credits:** The trend-following logic is inspired by the legendary "CDC Action Zone" concept popularized by Piriya Sambandaraksa. The valuation floor is based on the Realized Price on-chain metric conceptualized by the crypto-asset research community.
- **Disclaimer:** This indicator is designed for high-timeframe spot accumulation (recommended: 1D or 4H charts). It is not a financial advisory tool or a guarantee of future profits. Past performance does not indicate future results. Always practice proper risk management. Indicator

MACD Dive [TTM Squeeze | Dual Lock %R]Disclaimer : This indicator is not financial advice and is strictly for educational and informational purposes only. The metrics and signals provided herein (including momentum crosses, trend saturation state icons, and squeeze markers) are calculated based on historical market data and do not guarantee future performance. Trading stocks and commodities involves significant risk of loss. The user assumes full responsibility for all trading decisions and should always perform their own due diligence before executing trades.
MACD Dive is a multi-state momentum and volatility context engine. By layering momentum oscillation (MACD/PPO/MACD-V) with market stalemates (volatility squeeze) and trend exhaustion (Dual %R saturation), this suite transforms a standard MACD into a multi-dimensional 'No-Go' gatekeeper. This synergy is what gives the engine its edge: it actively blocks the trader from whipsawing in sideways chop or buying into a dying trend, highlighting high-probability market turns where momentum, volatility, and trend capacity perfectly align.
Standard oscillators have a scaling problem. This script lets you choose your engine:
MACD (Classic): Measures momentum in absolute dollars. Great for visual reactivity, but a "2.0" reading means something different on a $5 stock versus a $500 stock.
PPO (Percentage): Measures momentum in percentages. Standardizes the reading across all assets, making it ideal for fixed-rule algorithmic trading.
MACD-V (Volatility Normalized): This divides the MACD by the Average True Range (ATR). It measures momentum in "Units of Volatility," mathematically adapting to market chaos so that signals remain consistent across both different assets and shifting volatility regimes (quiet markets vs chaotic markets).
This suite includes a fully optimized divergence detection engine:
Regular Divergence (Solid Lines): Identifies Trend Reversals. Price pushes to a new extreme, but momentum fails to follow, signaling exhaustion.
Hidden Divergence (Dashed Lines): Identifies Trend Continuations (Slingshots). Price pulls back, but momentum fully resets, signaling a high-probability entry in the direction of the dominant trend.
Located in your chosen corner, the HUD provides an instant visual readout with hover tooltips for active Engine Mode, %R Fatigue state, Oscillator crossover validation, and Squeeze environment. Vertical background highlights in green or red represent filter-passed momentum crossovers, like the MACD bullish cross. Use the extensive inline tooltips in the indicator's settings panel for a comprehensive breakdown of every tunable parameter.
Adaptive Time-Frames & RSI Gatekeeper
Think of this as an automated gear shifter. When looking at lower timeframes (below a user-defined boundary, e.g. 1 hour), the engine automatically scales down to tight, agile lookback periods. When viewing high timeframes, it dials up to filter out noise.
Buying a bullish MACD cross when the RSI is already at 85 increases risk of buying the top when the tank is empty. The optional RSI Safety Filter acts as a strict ceiling/floor blocker. If momentum crosses upward but the asset is mathematically overbought, the indicator suppresses the background highlight. It prevents signals on MACD crosses that have no fuel left.
VOLATILITY ENGINE: BB-KC Squeeze Radar
Building on John Carter’s TTM Squeeze by mapping the contraction of Bollinger Bands inside Keltner Channels to identify market stalemates. The implementation here color codes between a Loose Squeeze (BB inside 1.5 KC) and a hyper-compressed Tight Squeeze (BB inside 1.0 KC) to show the staged intensity of the coiled spring.
While the market coils sideways, a 20-period Linear Regression calculates the trajectory of price deviation inside the bands. The directional bias is shown by customizable markers on the zero line (default ⌃ or ⌄). This reveals hidden institutional accumulation or distribution before the trigger is pulled. To bypass "dead money" risk, the script tracks the first clean candle close or intraday pierce outside the Keltner bounds following a squeeze, catching the expansion phase exactly as it starts.
Furthermore, it accounts for the "Disappearing Mark" phenomenon. Bollinger Bands expand instantly when price moves, causing standard squeeze signals to vanish 1-3 bars before the real breakout candle. This script uses a memory state to remember recent compression, firing a "squeeze release" marker (default ❖) the exact moment price closes outside the Keltner bounds. Trade the release, not the waiting room.
Note: While MACD Dive tracks this compression mathematically on its zero-line, you can see the actual physical boundaries of the breakout by pairing it with my companion Swing Data suite . Plotting its Keltner Channel at 1.5 multiplier over your price chart allows you to visually verify the exact moment the squeeze release mark is ignited.
SATURATION ENGINE: Dual-Lock %R and Momentum Rot
This suite tracks sustained trend maturity using a fast/slow dual Williams %R setup. The conceptual pairing of a fast and slow %R to identify overbought/oversold exhaustion is credited to upslidedown's excellent Trend Exhaustion indicator . I highly recommend applying their script to your chart if you want to visually learn how the two %R lines interact.
While upslidedown’s implementation offers multiple display modes to paint visual boxes and exhaustion zones directly over price action, the focus here is on the discrete icons for trend status at the top and bottom of the MACD pane: Ignition (·), Saturation (□), and Fatigue (×). This suite adapts native ta.wpr() math assuming the trader is already familiar with Dual %R mechanics. Specific "Sprint" and "Marathon" tuning guidance is provided in the tooltips: heavily smoothing the fast line to ignore intraday noise, while lightly smoothing the macro slow line to preserve its reach into extreme zones.
It also features one major addition: the Stall. While Dual %R tracks Price Location (confirming price is structurally pinned at the highs), it doesn't track Velocity (confirming energy is sustained). To solve this, a Stoch RSI "Rot" detector runs quietly inside the saturation state. If price continues to float at the highs but internal velocity drops below a critical threshold, the script overlays a Stall marker (•). Designed as a "one-shot" early warning, it fires only on the first detection per trend saturation leg to prevent chart clutter. This differentiates a strong trend lock from a rotting lock, warning us that the move is running on fumes: giving us the exact cue to tighten stops, trim into parabolic strength, and strictly avoid adding new size.
BACKTESTER READY
Out-of-the-box compatibility with a comprehensive built-in README guide is available directly inside the settings menu. For traders who prefer a "Diamond Hands" approach, the indicator fully maps to Jason5480's TTS Framework convention, outputting strict integer states (1, -1, 2, -2) to hold full position size until the trailing macro baseline completely fractures. My personal backtester, Cosmos Signal Commander (which may be released to the public in the future), broadcasts a composite float signal capable of managing active trade positioning. It tracks entries, hard stops, and partial take-profits (swapping the trailing stop from tight to a wide "runner" buffer upon hitting extended ATR targets).
PERFORMANCE OPTIMIZATION
O(1) Memory States: Replaced lag-heavy ta.barssince() and 50-bar for loops in the Divergence engine with O(1) var state trackers.
String Caching: HUD table strings are built once in the global var scope to prevent constant memory allocation and garbage collection lag.
UI Mutation: The HUD uses table.cell_set_* to alter data dynamically, bypassing the stutter caused by destroying and redrawing tables on every tick.
Native C++ Backend: Replaced custom highest/lowest math arrays with native ta.wpr() functions for the %R engine to maximize computation speed.
Ghost State Resets: When switching the backtester logic to "Long Only" mode, the engine actively hunts and kills lingering short-memory variables so they don't inadvertently suppress valid long signals.
Indicator

Indicator

Order Block Detector ProOrder Block Detector Pro — FVG + Volume + Breaker Blocks
━━━━━━━━━━━━━━━━━━━━
CREDIT & OPEN-SOURCE STATEMENT
━━━━━━━━━━━━━━━━━━━━
Zone detection concept inspired by "Market Structure Break & Orderblock" by EmreKb (PulseWire open-source). The codebase has been fully rewritten with significant original additions: Fair Value Gap overlap detection, volume confirmation filter, Breaker Block conversion logic, anti-clustering system, unrespected zone cancellation, and FVG-tagged labels. Published open-source in compliance with PulseWire reuse rules.
━━━━━━━━━━━━━━━━━━━━
WHY THESE COMPONENTS WORK TOGETHER
━━━━━━━━━━━━━━━━━━━━
Order blocks identify WHERE institutional orders were placed. Volume confirms WHETHER those orders had genuine institutional size. Fair Value Gaps identify WHETHER an imbalance exists inside the zone that price is likely to return and fill. None of these three factors alone is sufficient — an order block without volume may be retail noise; volume without structure has no location context; FVGs without a structural anchor have no directional bias. Combined, they produce a filtered, high-probability zone with multiple layers of institutional confirmation.
━━━━━━━━━━━━━━━━━━━━
WHAT THIS INDICATOR DOES
━━━━━━━━━━━━━━━━━━━━
Detects four zone types based on market structure breaks:
- Bu OB — Bullish Order Block (demand)
- Be OB — Bearish Order Block (supply)
- Bu BB — Bullish Breaker Block (former supply flipped to demand)
- Be BB — Bearish Breaker Block (former demand flipped to supply)
Each zone is volume-confirmed, FVG-tagged when applicable, anti-clustered, and auto-mitigated when price returns.
━━━━━━━━━━━━━━━━━━━━
MARKET STRUCTURE — SWING PIVOTS + BOS
━━━━━━━━━━━━━━━━━━━━
Swing highs and lows detected using ta.pivothigh() and ta.pivotlow() with a configurable pivot length (default 5 bars each side).
Break of Structure (BOS) is confirmed when:
- BOS Up: close crosses above a previously unbroken swing high
- BOS Down: close crosses below a previously unbroken swing low
Each swing point is tracked in a typed array (Swing type: price, bar, broken flag). Once broken, the swing is marked and triggers order block search.
━━━━━━━━━━━━━━━━━━━━
ORDER BLOCK DETECTION
━━━━━━━━━━━━━━━━━━━━
On BOS Up: script searches backwards up to N bars (default 25) for the most recent bearish candle (close < open). That candle is the Bullish Order Block — the last point where sellers were active before institutional buyers took control.
On BOS Down: searches backwards for the most recent bullish candle (close > open). That candle is the Bearish Order Block.
Zone boundaries:
- Full Range mode: top = high, bottom = low of OB candle
- Body Only mode: top = max(open, close), bottom = min(open, close)
━━━━━━━━━━━━━━━━━━━━
VOLUME CONFIRMATION
━━━━━━━━━━━━━━━━━━━━
When enabled, an order block only forms if:
- volume > SMA(volume, 20) × multiplier (default 1.5×)
This filters out low-participation structural moves that are more likely to fail on retest. The volume is read at the OB candle's bar offset, not the current bar.
━━━━━━━━━━━━━━━━━━━━
FAIR VALUE GAP (FVG) DETECTION
━━━━━━━━━━━━━━━━━━━━
After an order block is identified, the script checks for a Fair Value Gap within the zone's price range.
Bullish FVG condition (within OB range):
- low > high — gap between candle m−1's low and candle m+1's high
- Both gap boundaries fall within the OB top/bottom range
Bearish FVG: inverse — high < low .
When a FVG is detected inside the zone, a ★ symbol is appended to the zone label. These zones represent compounded institutional imbalances — price is statistically more likely to react at them.
━━━━━━━━━━━━━━━━━━━━
ANTI-CLUSTERING SYSTEM
━━━━━━━━━━━━━━━━━━━━
Prevents redundant overlapping zones using two filters:
Spacing filter:
- New zone rejected if midpoint is within ATR(14) × spacing multiplier of any existing active zone of the same type
Max active cap:
- Each zone type (Bu OB, Be OB, Bu BB, Be BB) capped at N active zones (default 5)
- When exceeded, oldest zone of that type is removed first
━━━━━━━━━━━━━━━━━━━━
MITIGATION LOGIC
━━━━━━━━━━━━━━━━━━━━
Two mitigation modes:
Body Close (default):
- Bu OB mitigated when close < zone bottom
- Be OB mitigated when close > zone top
Wick Touch:
- Bu OB mitigated when low < zone bottom
- Be OB mitigated when high > zone top
━━━━━━━━━━━━━━━━━━━━
BREAKER BLOCK CONVERSION
━━━━━━━━━━━━━━━━━━━━
When a mitigated zone was previously touched (price entered the zone at least once before violation):
- Bu OB violated → converts to Be BB (Bearish Breaker Block)
- Be OB violated → converts to Bu BB (Bullish Breaker Block)
Breaker Blocks represent zones where institutional orders have been fully absorbed — price is expected to use them as opposition on return.
Unrespected zone cancellation: if a zone is violated without ever being touched (price skipped through it), it is removed entirely rather than converted. This avoids phantom breaker blocks from low-quality structural moves.
━━━━━━━━━━━━━━━━━━━━
ZONE RENDERING
━━━━━━━━━━━━━━━━━━━━
Each zone is drawn as a box extending N bars to the right (default 50, updated each bar via box.set_right). Zone type visual identifiers:
- Bu OB — teal fill, solid border
- Be OB — red fill, solid border
- Bu BB — blue fill, dashed border
- Be BB — orange fill, dashed border
Volume of the OB candle is displayed inside the box (formatted as K/M/B). Labels show zone type and FVG tag (★) when applicable.
━━━━━━━━━━━━━━━━━━━━
HOW TO USE
━━━━━━━━━━━━━━━━━━━━
1. Wait for a fresh Bu OB or Be OB to form after a BOS
2. Prioritize zones marked with ★ (FVG overlap = stronger imbalance)
3. Enter when price returns to the zone on lower timeframe confirmation
4. Bu BB and Be BB are counter-trend zones — treat as resistance/support levels after a failed OB
5. Mitigated zones auto-remove — no manual cleanup needed
Entry logic suggestion:
- Long: price enters Bu OB zone → bullish rejection candle → entry above that candle
- Short: price enters Be OB zone → bearish rejection candle → entry below that candle
Stop loss: opposite side of the zone box
Target: next opposing zone or structural high/low
━━━━━━━━━━━━━━━━━━━━
RECOMMENDED SETTINGS
━━━━━━━━━━━━━━━━━━━━
- Scalping (1m–5m): Swing Length 3, OB Search 15, Volume ON 1.5×
- Intraday (15m–1H): Swing Length 5, OB Search 25, Volume ON 1.5×
- Swing (4H–Daily): Swing Length 7, OB Search 40, Volume OFF
- Forex/Gold: Volume OFF (broker tick volume unreliable)
- Stocks/Crypto/Futures: Volume ON
━━━━━━━━━━━━━━━━━━━━
No repainting. Pivot detection is inherently offset by pivot length bars by design. All zone creation and mitigation runs on confirmed price data only. Indicator

ADF Stationarity Pulse [forexobroker]ADF Stationarity Pulse runs the Augmented Dickey-Fuller test live on price and gates mean-reversion entries by whether the test currently rejects the unit-root null. The ADF test is the standard econometric tool for asking "is this series mean-reverting or does it have a random-walk component?". When ADF says mean-reverting AND the price z-score says price is stretched away from its rolling mean, the script trades the reversion. Built for crypto pairs, where statistical regimes flip between trending and choppy mean-reversion frequently.
🔶 ALGORITHM
1. Over the ADF window (default N=40 closes), the regression Dp_t = a + g * p_{t-1} + b * Dp_{t-1} + e is fit via closed-form OLS using cross-sum accumulation (single loop, no nested O(N^2)).
2. The variables are centered to absorb the intercept, then a 2x2 system solves for gamma (the unit-root coefficient) and beta (the lag-differenced coefficient).
3. Residual sum of squares is used to compute sigma^2 and the standard error of gamma.
4. ADF statistic = gamma / SE(gamma). Compared to the 5% critical value of -2.86 (approximate, for AR(1)-with-drift).
5. Z-score = (close - SMA(N)) / stdev(N) measures how far price is from its mean.
6. Buy fires when ADF rejects the unit root (mean-reverting) AND z-score is stretched below -threshold. Sell mirrors above +threshold.
🔶 SIGNAL LOGIC
- Buy: ADF stat < critical value AND z-score < -threshold AND session filter passes AND position is not already long AND cooldown bars elapsed AND barstate.isconfirmed.
- Sell: ADF stat < critical value AND z-score > +threshold AND session filter passes AND position is not already short AND cooldown bars elapsed AND barstate.isconfirmed.
Both conditions are required — being stretched in a trending regime is not enough, the test has to first confirm mean-reversion.
🔶 INPUTS
- Calculation group: ADF window N (default 40), 5% critical value (default -2.86), warning line (default -1.5).
- Signal Logic group: z-score threshold (default 1.0), cooldown bars (default 15).
- Filters group: session restriction (default 0000-2400).
- Visual group: z-score plot, dashboard, 3-layer glow, colors.
🔶 ALERTS
ADF Buy, ADF Sell, ADF Any Signal, ADF Regime On, ADF Regime Off, ADF Warning Cross, ADF Z Stretched Down, ADF Z Stretched Up, ADF Z Mean Reclaim, ADF Webhook JSON.
🔶 LIMITATIONS
- The 5% critical value is approximate; published tables vary slightly with sample size and specification. -2.86 is the conventional reference for AR(1)-with-drift at N around 50.
- ADF assumes a specific lag structure (one differenced lag); on higher-order autocorrelated series the test may misclassify regimes.
- The regression uses a fixed window of N closes; very early chart history has insufficient data and the test returns near zero.
- Mean-reversion entries can fight strong trends if the ADF window happens to span a flat patch inside the larger trend — use higher timeframes or a longer N to suppress this.
- Crypto pairs with frequent gap behavior (weekend lulls, exchange halts) violate the i.i.d. residual assumption ADF rests on.
Indicator

Pro Scanner Multi-Symbol Trend & Momentum Scanner
OVERVIEW
This indicator scans up to 15 user-defined symbols and presents them in a
single color-coded dashboard on your chart. Instead of flipping between charts,
you get a consolidated view of price, change, trend bias, RSI and a combined
signal for every symbol in your watchlist.
HOW IT WORKS
For each symbol, the script requests data on a timeframe you choose and computes:
- LTP: the latest close.
- Chg%: percentage change vs the previous bar of the selected timeframe
(set the Scanner Timeframe to "D" for daily change).
- Trend: bullish (up) when price is above its EMA, bearish (down) when below.
EMA length is adjustable.
- RSI: standard Relative Strength Index with adjustable length; cells are shaded
for overbought (above 70) and oversold (below 30).
- Signal: a combined read from trend direction and RSI — BUY when trend is up
and RSI is firm, SELL when trend is down and RSI is weak, neutral otherwise.
The table can be sorted by percentage change so the strongest movers rise to the top.
HOW TO USE
1. Add the indicator to any chart.
2. In settings, enter your symbols in EXCHANGE:TICKER form (e.g. NSE:RELIANCE).
3. Set the scanner timeframe, EMA length and RSI length to match your style.
4. Use the dashboard to see which symbols share the same trend and momentum bias.
It is meant as a quick filter to shortlist symbols for closer analysis on
their own charts.
SETTINGS
- Scanner Timeframe, Trend EMA Length, RSI Length
- Sort by % change (on/off)
- Table position and text size
- 15 editable symbols
NOTES
This tool is for analysis and education only. It does not predict future prices
and is not financial advice. Reliable results require a valid data feed for each
symbol. Always do your own research and manage risk. Indicator

Indicator

Smart Stochastic Prosmart stochastic pro is a momentum oscillator built to read stochastic structure, buying and selling pressure, and multi-timeframe bias in one clean panel.
the script is designed for traders who want a visual way to track when the market is stretched, when pressure starts to shift, and when a reversal setup becomes more interesting. it does not predict price and it should not be used alone. it is meant to support analysis together with price action, market structure, support and resistance, volume, and risk management.
what the script does
smart stochastic pro uses a smoothed stochastic engine to create rounded %k and %d curves. the goal is to reduce visual noise while keeping the oscillator responsive enough for intraday and swing analysis.
the script includes:
* a smoothed stochastic %k and %d
* extreme overbought and oversold zones
* buying and selling pressure based on candle position and volume
* optional mtf calculation modes
* reversal detection after extreme zones
* optional candle coloring
* a compact dashboard
* visual pressure zones and signal labels
how to use it
add the script to a normal candlestick chart. for the clearest reading, start with the default settings and use a liquid market such as major crypto pairs, forex pairs, indices, or large-cap stocks.
the oscillator moves between 0 and 100.
basic reading:
* above 80 means price is in an overbought area
* below 20 means price is in an oversold area
* above 90 means extreme overbought
* below 10 means extreme oversold
* the 50 line is the neutral zone
* %k above %d shows bullish momentum
* %k below %d shows bearish momentum
the script works best when you do not take every cross. the main idea is to wait for a strong area first, then look for a confirmed shift.
beginner workflow
1. start on the chart mode
use:
calculation / visual mode: chart
this uses the current chart timeframe and is the easiest mode to understand.
2. wait for an extreme zone
for bullish setups, watch for %k to move into the extreme oversold area.
for bearish setups, watch for %k to move into the extreme overbought area.
this arms the setup. it does not mean enter immediately.
3. wait for confirmation
a bullish reversal becomes more interesting when:
* %k crosses above %d
* the oscillator starts rising
* buying pressure improves
* the signal appears after an oversold expansion
a bearish reversal becomes more interesting when:
* %k crosses below %d
* the oscillator starts falling
* selling pressure improves
* the signal appears after an overbought expansion
4. check the pressure
the pressure background and ribbons help show whether buyers or sellers are gaining control.
green pressure means buying is stronger.
red pressure means selling is stronger.
neutral pressure means the market may still be undecided.
5. use the dashboard
the dashboard summarizes:
* active mode
* current bias
* mtf bias
* slope
* oscillator zone
* buying or selling pressure
* %k and %d values
* signal strength
* armed state
for beginners, the most useful dashboard rows are state, zone, pressure, and armed.
recommended settings
for beginners:
* calculation / visual mode: chart
* require explosion first: true
* minimum confluence strength: 2
* hide mid-range noise: true
* show pressure: true
* show dashboard: true
* candle color: off at first
for cleaner signals:
* require explosion first: true
* minimum confluence strength: 3
* hide mid-range noise: true
* mtf bias filters signals: true
for faster signals:
* require explosion first: false
* minimum confluence strength: 2
* hide mid-range noise: true
for multi-timeframe use:
mtf strict shows the oscillator calculated directly from the selected higher timeframe.
mtf bias keeps the chart oscillator smoother while using the higher timeframe as a directional filter.
a simple setup is:
* chart timeframe: 5m or 15m
* mtf timeframe: 1h
* mtf bias filters signals: true
where to use it
the script can be used on:
* crypto
* forex
* indices
* stocks
* futures
it is usually cleaner on markets with good liquidity and enough volume. low-volume markets can create noisy pressure readings and weaker signal quality.
timeframes
for scalping, try 1m to 5m, but expect more noise.
for intraday trading, 5m to 30m is usually easier to read.
for swing trading, 1h to 4h gives slower but cleaner signals.
how not to use it
do not buy only because the oscillator is oversold.
do not sell only because the oscillator is overbought.
do not use one signal without checking market structure.
do not use it as a guaranteed entry system.
do not ignore risk management.
best practice
use the script as a timing and confirmation tool.
a stronger bullish setup usually has:
* price near support or after a liquidity sweep
* %k coming from oversold or extreme oversold
* buying pressure improving
* bullish signal strength at least 2 or 3
* mtf bias not fighting the trade
a stronger bearish setup usually has:
* price near resistance or after a failed breakout
* %k coming from overbought or extreme overbought
* selling pressure improving
* bearish signal strength at least 2 or 3
* mtf bias not fighting the trade
alerts
alerts are available for:
* bullish reversal after extreme oversold
* bearish reversal after extreme overbought
* extreme oversold
* extreme overbought
* pressure flip bullish
* pressure flip bearish
use alerts as reminders to check the chart, not as automatic trade entries.
notes
this script is an analysis tool. it does not guarantee results. all signals should be reviewed with price action, trend context, volatility, and personal risk rules before making a trade decision.
Indicator

Supply Demand Pro - VWAP + Liquidity ConfluenceSupply Demand Pro — Liquidity + VWAP Confluence
by ApexFlow
━━━━━━━━━━━━━━━━━━━━
INSPIRATION & CREDIT
━━━━━━━━━━━━━━━━━━━━
Credit: Zone base detection concept inspired by "Market Structure Break & Orderblock" by EmreKb (PulseWire open-source). All code has been rewritten with significant original additions: quantitative grading system (A+/A/B/C), VWAP confluence scoring, liquidity sweep detection, multi-timeframe overlay, and live backtest panel.
━━━━━━━━━━━━━━━━━━━━
WHAT THIS INDICATOR DOES
━━━━━━━━━━━━━━━━━━━━
Detects institutional supply and demand zones using a three-layer confluence model:
1. Zone formation: explosive impulsive move + consolidation base
2. Zone scoring: quantitative grade based on move strength, volume, VWAP proximity, HTF overlap
3. Signal generation: price returns to zone with rejection confirmation + sweep detection
The combination of these three layers separates this from standard S&D indicators that draw zones without qualification.
━━━━━━━━━━━━━━━━━━━━
ZONE DETECTION METHODOLOGY
━━━━━━━━━━━━━━━━━━━━
A zone forms when a confirmed bar (barstate.isconfirmed) meets all of:
- Bar range > ATR(14) × Move Multiplier — confirms volatility expansion
- Candle body > 55% of total range — filters wicky, indecisive bars
- Optional: Volume > SMA(20) × multiplier — confirms participation
ATR uses ta.atr(14). Body percentage = |close − open| / (high − low).
The base of the zone is built from preceding candle(s) where:
- |close − open| < ATR × 0.5 (small-bodied consolidation)
- Bar is not itself explosive
Base high and low define the zone boundaries:
- Supply zone: base candle(s) before bearish explosive move
→ Top = base high, Bottom = min(base low, explosive open)
- Demand zone: base candle(s) before bullish explosive move
→ Top = max(base high, explosive open), Bottom = base low
All detection references bar and bar on confirmed bars only. No repainting, no lookahead.
━━━━━━━━━━━━━━━━━━━━
ZONE GRADING SYSTEM (A+ / A / B / C)
━━━━━━━━━━━━━━━━━━━━
Each zone receives a score from 0–100 at creation using four measurable factors:
Move strength (max 30 pts):
- score += min((range / ATR ) × 18, 30)
Volume strength (max 20 pts):
- score += min((volume / volAvg ) × 13, 20)
- If volume confirmation disabled: default 10 pts
VWAP confluence (25 pts):
- +25 if session VWAP falls within zone ± (ATR × tolerance)
- Uses ta.vwap (session-anchored)
HTF zone overlap (20 pts):
- +20 if zone price range overlaps a detected higher-timeframe zone
- HTF data pulled via request.security() with lookahead=barmerge.lookahead_off
Freshness bonus (5 pts):
- +5 at creation
Grade thresholds:
- A+ ≥ 80 | A ≥ 65 | B ≥ 50 | C < 50
Grade displayed as badge inside each zone. Signals filterable by minimum grade.
━━━━━━━━━━━━━━━━━━━━
VWAP CONFLUENCE
━━━━━━━━━━━━━━━━━━━━
Session VWAP (ta.vwap) compared to each new zone at creation:
vwapInZone = VWAP ≥ (zoneBottom − ATR × tolerance)
AND VWAP ≤ (zoneTop + ATR × tolerance)
When true, zone receives +25 score and ⊕V tag on label.
━━━━━━━━━━━━━━━━━━━━
MULTI-TIMEFRAME ZONE OVERLAY
━━━━━━━━━━━━━━━━━━━━
Same detection logic runs on a higher timeframe via:
request.security(syminfo.tickerid, htfRes, f_htfDetect(), lookahead=barmerge.lookahead_off)
HTF zones drawn with dashed blue borders. When LTF zone overlaps active HTF zone it receives +20 confluence bonus and ⊕H label tag. HTF zones auto-mitigated when price closes through them.
━━━━━━━━━━━━━━━━━━━━
LIQUIDITY SWEEP DETECTION
━━━━━━━━━━━━━━━━━━━━
A liquidity sweep is defined as:
For demand zones (⚡BUY):
- bar low < zone bottom — wick pierced below
- bar close > zone bottom — body reclaimed inside zone
- Sweep depth = (zoneBottom − low ) / close ≥ minimum threshold
- Current bar confirms bullish (close > open)
For supply zones (⚡SELL): inverse conditions apply.
This represents institutional stop hunting — retail stops below a structural low are triggered, price immediately reverses. These are marked as ⚡BUY / ⚡SELL, visually distinct from regular signals.
━━━━━━━━━━━━━━━━━━━━
SIGNAL LOGIC
━━━━━━━━━━━━━━━━━━━━
Regular BUY signal fires when all confirmed on closed bar:
- Price taps active demand zone (low ≤ zone top)
- Close back above zone top — bullish body
- Lower wick ≥ 50% of candle range — rejection confirmation
- Trend filter: close > EMA(50) — directional bias
- Zone grade meets minimum requirement
- Zone not yet used (one-signal-per-zone mode)
- Cooldown bars passed since last signal
Inverse for SELL at supply zones.
━━━━━━━━━━━━━━━━━━━━
ZONE MITIGATION
━━━━━━━━━━━━━━━━━━━━
Two modes:
- Body Close: zone removed when candle body closes through zone boundary
- Wick Touch: zone removed when any wick touches zone boundary
Mitigated zones are deleted from chart automatically. All related labels and badges deleted simultaneously via parallel array management.
━━━━━━━━━━━━━━━━━━━━
LIVE BACKTEST PANEL
━━━━━━━━━━━━━━━━━━━━
Every fired signal is logged with: entry price, ATR at entry, direction, bar index. On subsequent bars the script evaluates:
- Win: price reaches entry ± (ATR × targetMultiplier) in signal direction
- Loss: price reaches entry ∓ (ATR × stopMultiplier) against signal direction
First level hit determines outcome. Panel displays:
- Total signals tracked (configurable max, default 50)
- Wins / Losses / Open
- Win rate %
- Average R-multiple = (wins × targetMult − losses × stopMult) / closed signals
This is a logic-level simulation using OHLC data. Not slippage or fee adjusted.
━━━━━━━━━━━━━━━━━━━━
WHAT IS ORIGINAL
━━━━━━━━━━━━━━━━━━━━
- Quantitative zone grading (0–100 score → A+/A/B/C) based on four measurable confluences
- Liquidity sweep detection as a separate premium signal class
- VWAP proximity as a scored confluence factor (not just an overlay)
- HTF zone overlap as a scored confluence factor
- Live backtest panel tracking actual signal outcomes with R-multiple
- Adaptive zone extension — boxes track current bar instead of extending infinitely
- All filters stackable independently: grade, trend, wick size, cooldown, session, freshness
━━━━━━━━━━━━━━━━━━━━
HOW TO USE
━━━━━━━━━━━━━━━━━━━━
- Green boxes = demand zones | Red boxes = supply zones
- Dashed blue boxes = higher timeframe zones
- Grade badge inside each zone: A+ (yellow) / A (orange) / B (gray) / C (faded)
- ⊕V = VWAP confluence | ⊕H = HTF confluence
- Triangle up = BUY signal | Triangle down = SELL signal
- ⚡BUY / ⚡SELL = liquidity sweep signals (highest probability)
Recommended workflow:
1. Identify A or A+ graded zones with ⊕V or ⊕H tags
2. Wait for price to return to zone
3. Enter on BUY/SELL signal — wick rejection + bullish/bearish close
4. Prioritize ⚡ sweep signals when available
5. Monitor backtest panel to confirm positive expectancy on your asset
━━━━━━━━━━━━━━━━━━━━
RECOMMENDED SETTINGS
━━━━━━━━━━━━━━━━━━━━
- Forex / Gold (XAUUSD): Volume confirmation OFF
- Stocks / Crypto / Futures: Volume confirmation ON
- Scalping: 5m–15m chart, HTF = 1H
- Intraday: 15m–1H chart, HTF = 4H
- Conservative: Min Grade = A, Cooldown = 10
- Aggressive: Min Grade = B, Cooldown = 5
━━━━━━━━━━━━━━━━━━━━
No repainting. No lookahead bias. All signals fire on barstate.isconfirmed only.
Detection uses bar and bar historical references exclusively.
WHY THESE COMPONENTS WORK TOGETHER
Supply and demand zones identify WHERE price is likely to react. VWAP identifies WHERE fair value sits. Neither alone confirms institutional intent. When a zone aligns with VWAP and a higher-timeframe zone simultaneously, the probability of a genuine institutional reaction increases measurably. The liquidity sweep signal adds a third layer — detecting when stops are hunted before reversal. These three components cannot produce the same edge independently; the confluence scoring model is what ties them into one system. Indicator

VWAP SD2 Reversion (Long)A patient, momentum-confirmed dip buyer that fades stretches below the session VWAP and targets a return to the mean.
The idea
Intraday price tends to oscillate around its volume-weighted average price (VWAP). When price extends a full two standard deviations below the session VWAP, it is statistically stretched and often springs back toward the average. This strategy is built to capture that snap-back, but it deliberately does not buy the dip blindly. A stretched market can keep falling, so the strategy waits for two independent momentum tools to confirm that the down-move has actually turned before it commits.
The result is a sequential, time-boxed setup: a volatility filter, a price stretch, and then two momentum confirmations that must all line up within a short window. If they do not, the setup is discarded and the strategy stays flat.
How a trade is built
Each long requires the following to occur in order, with every step happening at or after the initial dip and within the confirmation window:
Volatility filter: the lower 2-SD band must sit at least a minimum distance from VWAP (default 10 pips). This skips quiet, low-range conditions where there is little room to revert and the costs would dominate.
Step 1, the stretch: price closes below the lower 2-SD band.
Step 2, RSI confirms: RSI recovers back above its level (default 30), confirming the oversold push is fading.
Step 3, MACD confirms: the MACD line turns bullish over its signal line (or over zero, if you prefer), confirming momentum has flipped up.
Entry: a market long is taken on the bar that completes Step 3.
Why a state machine
Real momentum turns are messy. RSI and MACD often flip within a bar or two of each other, and sometimes on the very same bar. A naive rule that demands three separate single-bar crossovers in strict order misses most of these clusters. This strategy instead tracks the setup through a small state machine that:
anchors both confirmations to the first dip bar, so a momentum cross that happened before the dip cannot be borrowed to validate the trade;
accepts confirmations that arrive in either order or on the same bar, as long as both are recent and post-dip;
keeps the setup alive while price continues to hug the band, and expires it cleanly once the confirmation window passes without a trigger.
A Strict toggle is provided for those who want the original behaviour, where each step must be a fresh crossover on a later bar.
How the exit works
Because the thesis is reversion to the mean, the natural profit target is the mean itself. By default the take-profit is the live VWAP, re-evaluated every bar so it tracks the line as it moves, set a small buffer in front so the order fills on the approach rather than waiting for an exact touch. A minimum-profit floor prevents a falling VWAP from dragging the target back through the entry.
A fixed-pip take-profit mode is available as an alternative. The stop-loss is a fixed pip distance below entry in both modes. Targeting the mean rather than a fixed number of pips tends to produce variable, often larger winners, which also dilutes the impact of fixed spread costs.
Settings
Setup
SD band multiplier — standard-deviation width of the bands (default 2.0).
Min VWAP to SD2 distance — the volatility filter, in pips (default 10).
Confirmation window — how many bars each step has to confirm (default 5).
Strict cross — require a fresh crossover on a bar after the prior step.
RSI and MACD
Standard RSI length and cross level.
Standard MACD fast, slow and signal lengths, with an optional zero-line cross instead of a signal-line cross.
Risk and pips
TP at VWAP, with a front-run buffer and a minimum-profit floor, or a fixed-pip take-profit.
Stop loss in pips.
Auto pip size (mintick × 10), which resolves correctly for 5-decimal FX and 3-decimal JPY pairs, plus a manual override.
Reading the chart
Orange line: session VWAP (the reversion target).
Red and green lines: the lower and upper 2-SD bands.
Markers: 1 marks a close below the band, 2 marks the RSI confirmation, and the triangle marks the MACD confirmation and entry trigger.
Intended use
This is an intraday strategy, developed and tuned on 5-minute FX majors, with a daily VWAP anchor that resets each session. In the author's testing it has behaved most consistently on AUDUSD, and it is also designed for pairs such as EURUSD and USDJPY. As always, behaviour varies by pair, broker feed and period, so test it on your own data before relying on it.
On backtest settings: tight intraday targets are sensitive to execution costs. Before drawing conclusions from the Strategy Tester, set a commission and slippage that match your broker, and choose a position size that reflects the risk you would actually take. Results shown with unrealistic costs can look far better than anything achievable live.
This script is published for educational and research purposes only and is not financial advice or a recommendation to trade. Backtested and hypothetical results do not guarantee future performance, and trading leveraged instruments such as FX carries substantial risk of loss. You are responsible for your own testing, risk management and decisions. Strategy

Generalized Fisher Transform [LB] Concept
The Generalized Fisher Transform extends John F. Ehlers' classic Fisher Transform (2002) by introducing an adjustable shape parameter that controls the sensitivity profile of the transformation. While the original Fisher Transform maps any normalized input to a near‑Gaussian output to highlight statistical extremes, this generalized version allows traders to emphasize central regions (shape < 1) or extreme tails (shape > 1) depending on their strategy.
Mathematical Foundation
The indicator first normalizes price to a bounded range using a rolling min‑max window of length N :
x = 2 × (P - L_min) / (H_max - L_min) - 1
A signed power is then applied with a shape factor p :
x_p = sign(x) × |x|^p
The generalized Fisher Transform is computed as :
F = 0.5 × ln( (1 + x_p) / (1 - x_p) )
When p = 1 , the formula reduces to the classic Fisher Transform. Values of p < 1 amplify sensitivity near zero (central price region), while p > 1 amplify sensitivity near the edges (extreme price region). The result is smoothed by an EMA for noise reduction.
What Problem Does It Solve ?
Classic oscillators such as RSI or Stochastic use fixed non‑linear mappings that cannot adapt to different market regimes or trader preferences. The classic Fisher Transform offers a single sensitivity profile. The Generalized Fisher Transform solves this by exposing the shape parameter p , giving traders direct control over where the indicator is most responsive — near the mean or near the extremes — without changing the underlying logic or introducing additional indicators.
How To Interpret
The indicator operates in two selectable modes :
Extremes Mode – the background turns red when Fisher exceeds the upper threshold (statistically overbought), and green when it drops below the lower threshold (statistically oversold). These zones suggest potential mean‑reversion.
Direction Mode – the background turns cyan when Fisher is above zero (bullish bias) and orange when below zero (bearish bias). This mode is suited for trend‑following or directional confirmation.
In both modes, the Fisher line crossing zero indicates a shift in the price distribution relative to its recent range.
Parameters
Source – price data used for the calculation (default: close).
Normalization Period – number of bars used to compute the rolling min‑max for the normalization.
Shape Factor – exponent applied to the normalized price before the Fisher transform. 1 = classic Fisher, < 1 = center‑sensitive, > 1 = tail‑sensitive.
Smoothing Period – EMA length applied to the raw Fisher output.
Coloration Mode – switches between "Extremes" (overbought/oversold highlighting) and "Direction" (bullish/bearish highlighting).
Upper Threshold – Fisher level above which the background turns red in Extremes mode.
Lower Threshold – Fisher level below which the background turns green in Extremes mode.
Reference
Ehlers J.F., "Using the Fisher Transform", Technical Analysis of Stocks & Commodities, Vol. 20, No. 11, pp. 40‑45, November 2002.
Ehlers J.F., "Cybernetic Analysis for Stocks and Futures", Chapter 4 – The Fisher Transform, John Wiley & Sons, 2004. Indicator

Relative Volume (RVOL) Surge Dashboard Overview
The **Relative Volume (RVOL) Surge Dashboard** is a utility script designed to visually isolate institutional activity and anomalies in volume. In financial markets, sudden volume spikes that double the recent average often signal institutional presence, news-driven breakouts, or potential trend exhaustion points.
This indicator keeps your main chart clean while feeding you live volume metrics via an on-chart HUD (Heads-Up Display).
Key Features
* **Live Relative Volume Multiplier: ** Instantly displays exactly how many times the current bar's volume is exceeding its standard historical moving average (e.g., 1.54x, 3.10x).
* **Smart UI Dashboard: ** A customizable, clean panel that switches colors (Green/Red) immediately depending on whether a 2x volume surge is active or normal.
* **On-Chart Signals: ** Draws a clean yellow cross at the bottom of the price bar whenever a volume anomaly occurs.
* **Built-in Alert Engine: ** Supports native Trading View alert conditions so you can receive push notifications, email, or webhook alerts the exact second a volume anomaly prints.
How to Use It
1. **Trend Breakout Confirmation: ** Look for the dashboard to trigger a green "2x ALERT: ACTIVE" during a consolidation breakout. High volume confirms validity.
2. **Climactic Reversals: ** If a stock has been in an extended downtrend/uptrend and suddenly prints a massive 2x+ volume spike without making significant price progress, look for a potential reversal.
3. **Customization: ** Use the settings panel to change the lookback period (default is 20 bars) or move the dashboard to any corner of your screen to prevent overlapping other indicators.
DISCLAIMER:
This script is created for educational, informational, and utility purposes only. It does not constitute financial, investment, or trading advice. Past performance of any volume metrics or technical signals is not indicative of future results. Financial markets involve substantial risk of loss, and individual traders are entirely responsible for their own capital allocation and risk management. Always perform your own due diligence before entering any trade. Indicator

Strategy

Crypto Swing buy and sell indicatorCrypto Swing Buy and Sell Indicator is a trend-following swing indicator designed for crypto markets. It combines a 200-period EMA trend filter with MACD histogram momentum shifts, RSI recovery/cooling zones, and MFI volume-flow confirmation to highlight potential buy and sell opportunities.
The indicator plots a dynamic EMA 200 line that changes colour depending on whether price is trading above or below the trend filter. A BUY signal appears when price is above the EMA 200, MACD momentum turns bullish, RSI is recovering from lower levels, and MFI confirms that the move is not yet overextended. A SELL signal appears when price is below the EMA 200, MACD momentum turns bearish, RSI is cooling from higher levels, and MFI confirms weakening buying pressure.
This indicator is intended for swing trading and trend confirmation, especially on higher timeframes such as 4H or daily charts. It can be used to identify possible long and short setups, but should be combined with risk management, support/resistance analysis, and broader market context.
Signals:
BUY: Price above EMA 200 + MACD bullish flip + RSI recovering + MFI below 50.
SELL: Price below EMA 200 + MACD bearish flip + RSI cooling + MFI above 50.
Recommended use: crypto swing trading, trend confirmation, momentum-based entries, and alert-based trade monitoring. Indicator

Strategy

Indicator

Advanced Fear & Greed Cycle (Quant Model)## Overview
The **Advanced Fear & Greed Cycle (Quant Model) v6** is a pure quantitative oscillator designed to decode market sentiment by measuring the architectural divergence between smart money accumulation and retail distribution. Fully upgraded to Pine Script v6, this script addresses standard oscillator limitations by implementing dynamic time-frequency normalization ($0-100$ fixed scale).
Unlike standard sentiment proxies, this model filters out price-action noise by isolating volume flows, directional volatility, and mean-reversion extensions simultaneously.
---
## Mathematical Architecture & Core Engines
### 1. Directional Volatility Engine
Standard models treat volatility expansions as pure panic. This algorithm isolates **Directional Volatility**:
- A 14-period Average True Range (ATR) is mathematically normalized over a dynamic 90-day rolling quarter (`lookback`).
- **Trend Filter:** Volatility is converted into the `vol_fear` metric **only** if the closing price is below its 14-period Simple Moving Average (`is_descending`). Upside expansions (bullish breakouts) are correctly filtered out to prevent false panic readings.
### 2. Normalized Volume & Flow Sentiment
Liquidity and order-flow tracking are computed via a three-layered matrix:
- Normalized Volume spikes relative to the quarterly window.
- Inside-candle Selling Pressure ( AMEX:HIGH - Close$ versus the overall candle range).
- A normalized On-Balance Volume (OBV) structure to track mathematical capital inflows and outflows.
### 3. Boundary-Proof Macro Extension (Mayer Proxy)
To track cyclical overextensions, the script calculates the asset's percentage distance from its long-term moving average (SMA 200 on Daily, SMA 40 on Weekly charts).
To solve the scale break-out issue (where different assets experience wildly different percentage extensions), a **MinMax Normalization** is applied. This compresses the structural extension into a bound $0-100\%$ scale (`extension_norm`) based on the rolling quarter's extremes.
---
## The Greed Score Synthesizer
The final plotting line is the **Greed Score**, a mathematically symmetric index calculated as:
$$\text{Greed Score} = \frac{(100 - \text{Fear Index}) + \text{Extension Norm}}{2}$$
This creates a fixed-bound oscillator ($0$ to $100$) that charts three distinct market phases:
- 🟢 **INSTITUTIONAL ACCUMULATION (Green Zone / < 20):** High systemic fear combined with compressed macro price extensions (< 25%). Smart money absorbs panicking retail order flow near historical value areas.
- ⚪ **NEUTRAL REGIME (Gray Line):** Symmetrical equilibrium where supply and demand are balanced.
- 🔴 **RETAIL FOMO / BUBBLE (Red Zone / > 80):** Zero systemic fear combined with extreme quarterly price overextensions. Retail traders buying the top driven by euphoria, highlighting distribution blocks.
---
## Display Dashboard & Custom Parameters
The top-right informational panel provides real-time diagnostic outputs of the quantitative data (Current Cycle State, Exact Greed Score, and Normalized Extension %). Traders can adjust the `Soglia Bolla Normalizzata` input to calibrate the macro-exhaustion scanner to specific asset classes (Equities, Forex, or Cryptocurrencies).
---
Disclaimer: This tool calculates mathematical probabilities based on normalized historical structures. It does not provide definitive buy/sell signals or financial advice. Always integrate sound risk management protocols. Indicator

Hurst Exponent Strategy [Fast + Weekly]## Overview
The **Hurst Exponent Strategy ** is an advanced quantitative tool that calculates the Hurst Exponent ($H$) using the Rescaled Range ($R/S$) analysis. Instead of tracking directional momentum or price overlays, this indicator measures the **statistical memory** and fractal dimension of financial time series to detect market regimes.
It helps traders identify whether an asset is trending, mean-reverting, or trapped in a state of pure noise (chaos).
---
## The Mathematics of Market Regimes
The indicator evaluates the price action and plots values between 0 and 1, anchored to a theoretical center line of **0.5 (Random Walk)**:
- **$H > 0.60$ (Trend / Persistent):** The market possesses long-term memory. Price movements tend to be followed by movements in the same direction. Ideal for trend-following strategies.
- **$H < 0.45$ (Elastic / Anti-Persistent):** The market behaves like a rubber band (Mean Reversion). Price movements are consistently followed by reversals. Ideal for grid, mean-reversion, or range-bound strategies.
- **$0.45 \le H \le 0.60$ (Chaos / Random Walk):** The price action mimics a Brownian motion. Movements are random, noise is high, and directional edge is minimal.
---
## Dual Timeframe Framework
To avoid fighting macro market structures, this script calculates two separate Hurst metrics simultaneously:
1. **Fast Hurst (Cyan Line):** Calculated on the current chart timeframe. It responds quickly to micro-regime shifts, pinpointing when a consolidation is breaking into a trend or expanding into chaos.
2. **Macro Hurst (Orange Line):** Multi-timeframe execution locked exclusively to the **Weekly ("W") chart**. It acts as a structural filter, keeping you aligned with the true macro nature of the asset.
Both exponents feature an optional built-in **Smoothing filter (SMA)** to remove high-frequency mathematical noise without heavily lagging the structural reading.
---
## Real-Time Informative Legend
The top-right dashboard monitors the live mathematical output of both exponents:
- Displays exact numerical values down to 4 decimal places.
- Dynamically classifies the market state into **TREND** (Green), **ELASTICO** (Red), or **CAOS** (Gray) for instant visual confirmation.
---
Disclaimer: This tool calculates mathematical probabilities based on historical fractal dimensions. It does not provide entry/exit arrows or guarantee profits. Use it as a regime filter alongside your preferred execution strategy. Indicator

Artemis Squeeze Momentum🟦 Artemis Squeeze Momentum collapses an entire momentum-and-volatility workflow into a single oscillator pane. Eight analytical layers — Squeeze Momentum core, Directional Flux, three-tier compression detection with a release tracker, dual confluence gauges, dual anchor Regular + Hidden divergence with a Smart AI Filter, a composite Trend Strength Score (0–100), a four-timeframe MTF Confluence panel with alignment / divergence detection, and a theme-adaptive PRO dashboard — operate as one integrated system, all driven by a single theme dropdown across 12 cohesive palettes.
Most squeeze indicators ship as a strip of black-and-red dots with a lone momentum histogram, then require a separate ADX, a separate divergence tool and a separate confluence gauge to complete the read. Artemis Squeeze Momentum closes that gap: every compression tier, every directional cross, every divergence, every higher-timeframe bias reads from the same pane in the same colour language — no inline colour pickers, no palette drift, no pane-hopping. The result is a complete momentum workbench where compressions, breakouts, regime flips, divergences and multi-TF bias are all readable at a glance.
🟦 HOW THE CORE ENGINE WORKS
**Squeeze Momentum Engine**
Each bar, the engine builds three anchors over the Momentum Length window:
1. **Channel midpoint** — `(highest(high, len) + lowest(low, len)) / 2`
2. **Smoothed midline** — `SMA(HL2, len)`
3. **Channel ATR** — channel range plus the gap-to-prior-close component (matches Pine v5 `tr(true)` on the synthetic channel bar)
The raw momentum is then computed as:
mom_raw = (close − avg(channelMid, smaMid)) / channelATR × 100
This produces a channel-aware, ATR-normalized residual scaled to roughly the ±100 range. The result is then passed through `ta.linreg(mom_raw, len, 0)` to produce the visible momentum line — a linear-regression smoothing that gives the curve its characteristic forward-leaning shape. An SMA of length Signal Length builds the trigger line. Crossovers between momentum and signal mark momentum regime changes — the same convention used by classical MACD.
**Directional Flux**
A custom ADX-style oscillator running in parallel. Each bar, the engine measures positive high-changes vs. negative low-changes, each RMA-smoothed and ATR-normalized:
up = RMA(max(change(high), 0), len) / ATR(len)
dn = RMA(max(−change(low), 0), len) / ATR(len)
ratio = (up − dn) / (up + dn)
flux = RMA(ratio, len / 2) × 100
The result is a directional bias oscillator bounded to ±100. An overflow branch (values past ±25 — where the directional pressure becomes structurally significant) renders as a separate, brighter fill so traders read both raw direction and acceleration in one glance.
**Heiken Ashi Bias (Optional)**
When `Use Heiken Ashi Bias` is enabled, the Flux engine reads from a Heiken Ashi bar stream instead of raw OHLC. HA bars smooth body / wick noise and emphasise trend continuation — useful on lower timeframes where raw OHLC is noisy.
🟦 SQUEEZE DETECTION
A three-tier Bollinger-vs-ATR compression detector running on the same Length as the Momentum Core (so compression and momentum stay perfectly aligned):
| Tier | Condition | Visual |
|---|---|---|
| Tight | stdev < ATR × 0.5 | Deepest, most saturated theme tone |
| Mid | stdev < ATR × 0.75 | Middle-intensity theme tone |
| Loose | stdev < ATR × 1.0 | Lightest tier — broadest detection |
Tiers nest — tight implies mid implies loose. The bottom-of-pane squeeze column lights up whenever any tier is active and the colour escalates as compression tightens, using a theme-native ramp drawn from each palette's own colour family (so the column reads as part of the theme rather than an imported generic warning).
The standard deviation is computed via a single-pass Welford algorithm — numerically stable on long histories where naive sum-of-squares accumulators drift.
**♦ Squeeze Release Marker**
The signature feature of the engine. The bar after the loosest active tier (stdev < ATR × 1.0) finally drops off, a tiny ♦ diamond paints at the midline in the theme's vivid release accent — one step brighter and more saturated than the tight tier so the climax moment reads as the most luminous point in the squeeze cycle.
This is the canonical "spring uncoiled" moment: compression has fully ended, volatility expansion begins, breakout direction is about to reveal itself. Historically the highest-conviction breakout setup the squeeze model produces. Hovering on the marker surfaces:
- Current bar state (compression ended this bar)
- Meaning (volatility expansion incoming)
- Next steps (watch the next 1–5 bars, confirm with Momentum slope, cross-check Flux, prioritise MTF-aligned setups)
🟦 CONFLUENCE GAUGES
Two horizontal strips render at the top (Bull side, +70 to +75) and bottom (Bear side, −70 to −75) of the pane. Each strip lights up when momentum and flux agree on direction, with brightness reflecting the confluence tier:
| State | Condition | Opacity |
|---|---|---|
| Strong Bull | mom > 0 AND flux > 0 | Full |
| Weak Bull | mom > 0 OR flux > 0 | Half |
| Strong Bear | mom < 0 AND flux < 0 | Full |
| Weak Bear | mom < 0 OR flux < 0 | Half |
| Neutral | Neither side dominates | Transparent |
The display mode (Both / Bull / Bear / None) lets traders mute one half if they only trade one direction.
**Confluence Buy / Sell Triangles**
A separate signal layer rides outside the gauges. The detector fires only when momentum crosses its signal line WHILE in the opposite zone past the Signal Threshold AND with flux in the opposite direction (classic mean-reversion logic):
- **Buy ▲** (below bear gauge at −90) — `xMomUp AND momVal < −threshold AND fluxVal < 0`
- **Sell ▼** (above bull gauge at +85) — `xMomDn AND momVal > +threshold AND fluxVal > 0`
Each triangle pairs with an invisible label carrying a tooltip that lists current mom, signal, flux, the active threshold, and a one-line interpretation of the trigger. The Signal Threshold (default 40) is independent of the Divergence Sensitivity setting — the two engines need different thresholds (divergence wants permissive at 25 for pivot detection, confluence wants strict at 40 for deep mean-reversion triggers).
🟦 DIVERGENCE DETECTION
A cross-confirmed, dual-anchor detector that fires on signal-line crossovers (NOT on Pine pivots). Regular divergences signal exhaustion reversals, Hidden divergences signal trend continuation.
**Four divergence types:**
| Type | Price | Momentum | Signal |
|---|---|---|---|
| Regular Bull (D▲) | Lower Low | Higher Low | Potential reversal up |
| Regular Bear (D▼) | Higher High | Lower High | Potential reversal down |
| Hidden Bull (H▲) | Higher Low | Lower Low | Uptrend continuation |
| Hidden Bear (H▼) | Lower High | Higher High | Downtrend continuation |
Regular divergence uses solid lines; Hidden uses dashed lines — visually quieter to match the continuation signal's lower conviction tier. Labels (D▲ / D▼ / H▲ / H▼) each carry a tooltip-rich hover with price + momentum + meaning context.
**Dual-Anchor Logic**
The key engineering choice. Regular and Hidden divergences each maintain their own separate anchor pair:
- **Regular anchors** — stored only at extreme-zone crosses (|mom| > Sensitivity). Catches classical exhaustion reversals at deep extremes.
- **Hidden anchors** — stored at ANY signal-line cross, regardless of zone. Shallow pullbacks inside an established trend rarely push momentum past ±Sensitivity, so the Hidden detector must accept every cross to capture the classical "price HL + mom LL" / "price LH + mom HH" continuation pattern.
A detected divergence consumes its anchor (resets to na) so the next setup starts fresh.
**Smart Divergence Filter (AI)**
Optional pre-filter that rejects low-quality divergences before they render. Three independent gates:
1. **Min Momentum Swing** — minimum |momentum| difference between the two pivot momentum values (default: 10 units). Drops noise-level differences.
2. **Min Price Swing (%)** — minimum price swing between pivots as a percentage of the recent `Momentum Length × 4` high-low range (default: 0.3%). Drops divergences where price barely moved relative to recent volatility.
3. **Require Flux Confirmation** — Flux must agree with the divergence direction at the moment of detection (Bull div needs Flux > 0, Bear div needs Flux < 0). Filters out divergences that fire counter to the broader directional bias.
When the master toggle is OFF (default), all detected divergences render. When ON, only divergences that clear all three gates survive. The filter applies identically to chart rendering and alert conditions — no mismatch between visual and alert signals.
🟦 COMPOSITE TS SCORE (0–100)
A weighted blend of every analytical layer into a single RSI-style 0–100 reading. 50 is neutral, > 50 leans bull, < 50 leans bear.
| Component | Weight | Mapping |
|---|---|---|
| Momentum | 30% | mom value mapped from −100..+100 → 0..100 |
| Flux | 30% | flux value mapped the same way |
| Mom × Signal | 15% | 70 if mom > sig, else 30 (slope direction confirmation) |
| Confluence | 25% | 90 strong-bull / 65 weak-bull / 50 neutral / 35 weak-bear / 10 strong-bear |
The score is rounded to the nearest integer and labelled into five tiers in the dashboard: STRONG BULL (≥75) / BULL (≥60) / NEUTRAL (40–59) / BEAR (≥25) / STRONG BEAR (<25), each prefixed with a directional glyph (▲ ▼ ■). The tier label gives traders an executive summary at a glance — one row in the dashboard tells you what every other row collectively says.
🟦 MULTI-TIMEFRAME CONFLUENCE
A separate PRO panel that runs the full Momentum + Flux + Confluence stack on four higher timeframes simultaneously via `request.security()` and surfaces the overall alignment state. All MTF calls use `lookahead = barmerge.lookahead_off` — fully repaint-safe on every closed bar.
**Six Presets**
Pre-tuned four-timeframe packs matched to common trader profiles:
| Preset | TF 1 | TF 2 | TF 3 | TF 4 | Use case |
|---|---|---|---|---|---|
| Scalp | 1m | 5m | 15m | 1h | Fast scalper |
| Intraday | 5m | 15m | 1h | 4h | Day trader |
| Swing | 15m | 1h | 4h | 1D | Default — swing trader |
| Position | 1h | 4h | 1D | 1W | Position trader |
| Crypto | 5m | 15m | 1h | 4h | 24/7 markets |
| Forex | 15m | 1h | 4h | 1D | Session-based markets |
**Alignment Detection**
Each TF returns a bias tag (▲ STRONG / ▲ WEAK / ▼ STRONG / ▼ WEAK / ◈ NEUTRAL) and a direction code (+1 / 0 / −1). The header rolls up the four codes into one of three states:
- **▲▲▲▲ ALIGNED** — all four TFs bullish (highest-conviction long setup)
- **▼▼▼▼ ALIGNED** — all four TFs bearish (highest-conviction short setup)
- **◈ MIXED** — TFs disagree (no clean direction)
**Divergence Detection**
When the current chart's bias contradicts ≥ 3 of the 4 HTF biases (e.g., chart bullish but 3+ HTFs bearish), an MTF Divergence flag fires — a contrarian / counter-trend warning. Treat as a "current move may be a bull / bear trap" signal.
**Panel Style**
Direction is conveyed purely by the ▲ / ▼ glyphs in each row's tag — never by cell colour. Every cell uses a uniform `thBull` text colour matching the main Dashboard, so the two panels feel like one product across all twelve themes, light and dark alike.
🟦 BAR COLORING
Five mutually exclusive modes apply an oscillator-driven colour to every price bar on the chart:
| Mode | Behavior |
|---|---|
| None | Leave bars untouched (default) |
| Momentum | Bull when mom > 0, bear when mom < 0 |
| Flux | Bull when flux > 0, bear when flux < 0 |
| Squeeze | Theme-native ramp when compressed, neutral otherwise |
| Confluence | Strong / Weak / Neutral tiers via mom + flux agreement |
| Slope | Bull when mom > signal, bear when mom < signal |
Colours are pulled from the active theme — no per-mode color picker needed.
🟦 DASHBOARD
A compact 2-column, 8-row data panel renders on the last bar when enabled. Every value derives from variables already computed upstream, so the dashboard adds zero overhead until the final bar.
| Row | Left | Right |
|---|---|---|
| Header | Artemis Squeeze | ▲ STRONG BULL / ▲ WEAK BULL / ■ NEUTRAL / ▼ WEAK BEAR / ▼ STRONG BEAR |
| TS Score | TS Score | 0–100 composite + tier label (STRONG BULL / BULL / NEUTRAL / BEAR / STRONG BEAR) |
| Momentum | Momentum | Current value + trend arrow (▲ ▼ ■) |
| Flux | Flux | Current value + trend arrow (▲ ▼ ■) |
| Squeeze | Squeeze | TIGHT / MID / LOOSE / — |
| Confluence | Confluence | STRONG BULL / WEAK BULL / NONE / WEAK BEAR / STRONG BEAR |
| Div | Div | Most recent divergence within last 50 bars (▲ REG / ▼ REG / ▲ HID / ▼ HID / —) |
| Slope | Slope | ▲ UP / ▼ DOWN / ■ FLAT |
**Theme-Adaptive Chrome**
The dashboard auto-inverts its layout based on the active theme:
- **Dark themes** (Tropic, Amber, Pastel, Cyber, Helios, Electric, Candy, Bloomberg, Solar, Royal): header and footer use a faint `thBull` tint, middle rows stay solid dark, text uses full-saturation `thBull`. Border uses `thBull` at 20% transparency for strong theme presence.
- **Light themes** (Midnight, Graphite): backgrounds flip to white, text stays `thBull` (which is itself dark on these themes), border uses `thBull` at 40% transparency.
This guarantees text legibility against every palette without per-theme manual tuning. The MTF Confluence panel uses identical chrome rules so the two panels feel like one product.
**Position & Size**
Six anchor slots (Top / Middle / Bottom × Left / Right) and four text sizes (Tiny / Small / Normal / Large). The Dashboard defaults to Bottom Right and the MTF panel to Top Right — vertically opposite so the two never overlap.
🟦 COLOR THEMES
Twelve cohesive palettes, each resolving to four axis colours plus a four-step squeeze ramp:
| Theme | Character | Bull | Bear |
|---|---|---|---|
| Tropic | Cyan steel + deep orange | #00bcd4 | #ff6d00 |
| Amber | Warm amber + ember red | #ff9800 | #e53935 |
| Pastel | Sky blue + soft lavender | #4fc3f7 | #9575cd |
| Cyber | Neon lime + hot crimson | #00e676 | #ff1744 |
| Helios | Bright gold + scarlet | #ffd600 | #ef5350 |
| Electric | Electric aqua + magenta | #00e5ff | #e040fb |
| Candy | Neon green + hot pink | #69F0AE | #FF4081 |
| Bloomberg | Terminal orange + cyan | #ff8c00 | #00b0ff |
| Solar | Solarized olive + crimson | #859900 | #dc322f |
| Royal | Imperial gold + deep purple | #ffd700 | #6a0dad |
| Midnight | Deep navy + dark crimson | #0d47a1 | #b71c1c |
| Graphite | Near-black + silver grey | #1a1a1a | #757575 |
Beyond the four axis colours (bull / bear / neutral / signal), each theme also defines its own four-step squeeze ramp (tight / mid / loose / release) drawn from its own colour family — so the squeeze column and the ♦ release marker harmonise with the active theme rather than imposing a generic warning hue. Nothing below the theme resolver block references a raw hex literal, so a single dropdown selection drives every plot, fill, gauge, divergence line, dashboard cell, MTF panel and bar colour.
🟦 ALERT SYSTEM
Twenty-two alert conditions, all using `alert.freq_once_per_bar_close`. Each alert is gated by its own toggle in the Alerts group — hiding a feature on the chart silences its alerts automatically.
| Alert | Condition |
|---|---|
| Confluence Buy | Mom crossed UP through signal while below −Threshold AND Flux bearish |
| Confluence Sell | Mom crossed DOWN through signal while above +Threshold AND Flux bullish |
| Momentum Cross Up | Mom crossed above zero |
| Momentum Cross Down | Mom crossed below zero |
| Flux Cross Up | Flux crossed above zero |
| Flux Cross Down | Flux crossed below zero |
| Bullish Swing | Mom × signal upward cross (any zone) |
| Bearish Swing | Mom × signal downward cross (any zone) |
| Strong Bull Confluence | Mom AND flux both turned bullish |
| Strong Bear Confluence | Mom AND flux both turned bearish |
| Weak Bull Confluence | Mom OR flux turned bullish |
| Weak Bear Confluence | Mom OR flux turned bearish |
| Tight Squeeze | stdev < ATR × 0.5 |
| Mid Squeeze | stdev < ATR × 0.75 |
| Loose Squeeze | stdev < ATR × 1.0 |
| Regular Divergence | D▲ or D▼ detected (respects Smart Filter) |
| Hidden Divergence | H▲ or H▼ detected (respects Smart Filter) |
| Squeeze Release ♦ | stdev re-expanded above ATR × 1.0 |
| MTF Aligned | All four MTF timeframes agree on direction |
| MTF Divergence | Current chart bias contradicts ≥ 3 of 4 HTF biases |
Each alert fires through `alert()` so the message body carries live context — direction, current values, the trigger condition, and a one-line interpretation. Divergence alerts respect the Smart Filter — if the filter is ON and a divergence is rejected visually, the alert will also not fire.
🟦 SETTINGS REFERENCE
**Visual**
- Theme — 12 cohesive palettes. Default: Tropic
**Bar Coloring**
- Bar Color Mode — None / Momentum / Flux / Squeeze / Confluence / Slope. Default: None
**Momentum Core**
- Length — Lookback for both the Momentum engine and the Squeeze window. Range 7–50. Default: 20
- Signal Length — SMA smoothing for the signal line. Range 2–7. Default: 3
- Show Momentum — Toggle. Default: ON
**Directional Flux**
- Length — Lookback for the Flux engine. Range 7–50. Default: 30
- Use Heiken Ashi Bias — Toggle. Default: OFF
- Show Flux — Toggle. Default: ON
**Squeeze Engine**
- Show Squeeze — Toggle. Default: ON
- Show Squeeze Release — Toggle for the ♦ marker. Default: ON
**Confluence Gauges**
- Display Mode — Both / Bull / Bear / None. Default: Both
- Signal Threshold — |momentum| floor for Buy ▲ / Sell ▼ arrows. Range 10–80. Default: 40
**Divergence**
- Sensitivity — |momentum| floor for Regular div detection. Range 10–50. Default: 25
- Regular Divergence — Toggle. Default: ON
- Hidden Divergence — Toggle. Default: ON
- Show Divergence Lines — Toggle. Default: ON
- Show Divergence Labels — Toggle. Default: ON
- Label Size — Tiny / Small / Normal / Large. Default: Tiny
- Smart Divergence Filter (AI) — Master toggle. Default: OFF
- Min Momentum Swing — Default: 10.0
- Min Price Swing (%) — Default: 0.3%
- Require Flux Confirmation — Default: ON
**Multi-Timeframe**
- Show MTF Panel — Toggle. Default: ON
- Timeframe Preset — Scalp / Intraday / Swing / Position / Crypto / Forex. Default: Swing
- Panel Position — 6 anchor slots. Default: Top Right
- Panel Text Size — Tiny / Small / Normal / Large. Default: Small
**Dashboard**
- Show Dashboard — Toggle. Default: ON
- Panel Position — 6 anchor slots. Default: Bottom Right
- Panel Text Size — Tiny / Small / Normal / Large. Default: Small
**Alerts**
- 20 toggles covering all 22 alert conditions (Regular and Hidden divergence each drive two alerts — bull + bear — from one toggle).
- Defaults ON: Confluence Buy/Sell, Mom Cross Up/Dn, Flux Cross Up/Dn, Strong Bull/Bear Confluence, Tight Squeeze, Regular Divergence, Squeeze Release, MTF Aligned.
- Defaults OFF: Swings, Weak Confluences, Mid/Loose Squeeze, Hidden Divergence, MTF Divergence.
🟦 COMPATIBILITY
Works on all asset classes and all timeframes in PulseWire Pine Script v6.
- Crypto: Spot, futures, perpetual contracts
- Forex: All pairs
- Equities: Stocks, ETFs, indices
- Commodities: Metals, energy, agriculture
- Timeframes: 1m through Monthly
The channel-aware ATR normalization in the Momentum engine, the ATR-normalized Flux ratio, and the stdev / ATR squeeze tests make every layer volatility-agnostic. The same default settings work on a 1m BTC chart and a weekly index chart without retuning. The MTF presets cover the common scalp / intraday / swing / position profiles plus dedicated Crypto and Forex packs.
🟦 DISCLAIMER
This indicator is provided for educational and informational purposes only. It does not constitute financial advice. Past performance does not guarantee future results. Always conduct your own analysis and apply proper risk management. Indicator

Indicator
