OPEN-SOURCE SCRIPT
Aggiornato Precision Price Gamma [PGamma]

Here's the full updated description with all the fixes — car analogy corrected, image captions added, ready to copy:
Precision Price Gamma (PGamma) is a second-derivative momentum indicator that measures the acceleration of momentum, not momentum itself.
━━━━━━━━━━━━━━━━━━━━━━━━━━
WHY PGAMMA IS DIFFERENT
━━━━━━━━━━━━━━━━━━━━━━━━━━
Most momentum indicators tell you how strong a move is. PGamma tells you whether that strength is increasing or fading — going one step further by measuring whether momentum is strengthening or weakening. This allows PGamma to identify changes in market pressure before many trend-following indicators respond.
━━━━━━━━━━━━━━━━━━━━━━━━━━
THE FOUR STATES
━━━━━━━━━━━━━━━━━━━━━━━━━━
Γ↑ Accelerating — Bullish momentum is positive and still strengthening.
Γ⌃ Bull Weakening — Bullish momentum remains positive, but buying pressure is beginning to fade.
Γ↓ Bear Pressure — Bearish momentum is dominant and selling pressure continues to strengthen.
Γ⌄ Bear Exhaustion — Bearish momentum remains negative, but selling pressure is beginning to weaken.
━━━━━━━━━━━━━━━━━━━━━━━━━━
HOW IT WORKS
━━━━━━━━━━━━━━━━━━━━━━━━━━
PGamma smooths the source series, then computes the slope of that smoothed series — the first derivative, or Momentum. It then smooths Momentum and computes its slope — the second derivative, or Price Gamma. The four states are determined by the sign of both values simultaneously.
Momentum determines the current direction of market pressure. Gamma determines whether that pressure is strengthening or weakening. They often disagree near turning points — and those disagreements are often the most informative signals PGamma produces.
Think of it like driving a car. Momentum is your speed. Gamma is whether you are pressing the gas or the brake. You can be moving backward while pressing the brake — still moving backward, but slowing. That is negative momentum with positive gamma. In market terms, price may still be making lower lows, but each push down is losing force. That often precedes consolidation, a bounce, or a reversal.
Two examples of this disagreement are illustrated in the first two snapshots — a red candle during a green Gamma Timeline, and a green candle during an amber Gamma Timeline. The third snapshot illustrates when Momentum and Gamma align, showing a green candle with a green Gamma Timeline during Accelerating state.



━━━━━━━━━━━━━━━━━━━━━━━━━━
THE STATE MATRIX
━━━━━━━━━━━━━━━━━━━━━━━━━━
Momentum | Gamma | State
+ | + | Accelerating
+ | - | Bull Weakening
- | - | Bear Pressure
- | + | Bear Exhaustion
Momentum and Gamma often disagree near turning points. A positive Gamma reading while Momentum remains negative does not mean the market is bullish — it means bearish momentum is losing acceleration. Those disagreements are where PGamma is most useful.
━━━━━━━━━━━━━━━━━━━━━━━━━━
UNDERSTANDING THE DASHBOARD
━━━━━━━━━━━━━━━━━━━━━━━━━━
State — Combines Momentum and Price Gamma into one of the four market conditions above. Read the State row first.
Momentum — The first derivative of price. Positive = bullish momentum dominates. Negative = bearish momentum dominates.
Gamma — The second derivative of momentum. Above Zero = momentum is accelerating. Below Zero = momentum is decelerating. Gamma often changes direction before Momentum, making it useful for identifying transitions in market pressure.
Bias — A simplified interpretation combining Momentum and Gamma into a single directional context label.
━━━━━━━━━━━━━━━━━━━━━━━━━━
GAMMA TIMELINE
━━━━━━━━━━━━━━━━━━━━━━━━━━
The Gamma Timeline displays the historical sequence of Price Gamma states as a continuous color band along the bottom of the chart. Each colored segment represents one bar, allowing traders to quickly identify transitions between acceleration, weakening, pressure, and exhaustion without obscuring price action. Green for Accelerating, amber for Bull Weakening, red for Bear Pressure, sky blue for Bear Exhaustion. Toggle on or off in Display settings.
━━━━━━━━━━━━━━━━━━━━━━━━━━
GETTING STARTED
━━━━━━━━━━━━━━━━━━━━━━━━━━
1. Add PGamma to any chart. It works on all instruments and timeframes.
2. In Settings → Display, choose your panel position and size.
3. In Settings → Calculation, adjust Momentum Smoothing, Momentum Length, and Gamma Length to suit your timeframe. Default values are calibrated for intraday 1m–60m charts.
4. Read the State row first. Then use Momentum and Gamma to understand why the state is what it is.
5. Use Bias as a quick at-a-glance directional context.
6. Use the Gamma Timeline to read state history across the session at a glance.
━━━━━━━━━━━━━━━━━━━━━━━━━━
HOW TO USE IT
━━━━━━━━━━━━━━━━━━━━━━━━━━
PGamma is not a buy or sell signal. Think of PGamma as a market condition indicator rather than a trade signal. Use it as a confirmation layer alongside your existing methodology. Typical applications:
• Confirming trend continuation when State shows Accelerating.
• Identifying weakening rallies before reversals when State shows Bull Weakening.
• Recognizing building pressure before visible breakdowns when State shows Bear Pressure.
• Spotting exhaustion during extended trends when State shows Bear Exhaustion.
When used alongside a GEX level tool, price approaching a Call Wall with Γ⌃ Bull Weakening is a different setup than price approaching the same level with Γ↑ Accelerating. PGamma makes that distinction visible.
Because PGamma analyzes smoothed momentum rather than candle color, bullish candles can appear during Bear Pressure and bearish candles can appear during Bull Weakening. This reflects underlying momentum conditions rather than individual price bars — and is often an early warning of what is developing beneath the surface.
━━━━━━━━━━━━━━━━━━━━━━━━━━
WORKS WELL ALONGSIDE
━━━━━━━━━━━━━━━━━━━━━━━━━━
PGamma complements indicators that identify where important price levels exist.
• Trend indicators
• Moving averages
• Volume Profile
• VWAP
• Options Gamma Exposure (GEX)
• Support and Resistance
• Market Structure
These tools identify where price may react. PGamma helps evaluate how price is behaving as it approaches those levels.
━━━━━━━━━━━━━━━━━━━━━━━━━━
WHAT THIS TOOL IS NOT
━━━━━━━━━━━━━━━━━━━━━━━━━━
PGamma measures changes in momentum. It does not predict future prices or guarantee reversals. Use it as analytical context alongside your existing trading methodology.
━━━━━━━━━━━━━━━━━━━━━━━━━━
SETTINGS OVERVIEW
━━━━━━━━━━━━━━━━━━━━━━━━━━
Calculation: Source, Momentum Smoothing, Momentum Length, Gamma Length
Display: Show Dashboard, Panel Position (6 locations), Panel Size (Small / Normal / Large), Show Gamma Timeline
Precision Price Gamma (PGamma) is a second-derivative momentum indicator that measures the acceleration of momentum, not momentum itself.
━━━━━━━━━━━━━━━━━━━━━━━━━━
WHY PGAMMA IS DIFFERENT
━━━━━━━━━━━━━━━━━━━━━━━━━━
Most momentum indicators tell you how strong a move is. PGamma tells you whether that strength is increasing or fading — going one step further by measuring whether momentum is strengthening or weakening. This allows PGamma to identify changes in market pressure before many trend-following indicators respond.
━━━━━━━━━━━━━━━━━━━━━━━━━━
THE FOUR STATES
━━━━━━━━━━━━━━━━━━━━━━━━━━
Γ↑ Accelerating — Bullish momentum is positive and still strengthening.
Γ⌃ Bull Weakening — Bullish momentum remains positive, but buying pressure is beginning to fade.
Γ↓ Bear Pressure — Bearish momentum is dominant and selling pressure continues to strengthen.
Γ⌄ Bear Exhaustion — Bearish momentum remains negative, but selling pressure is beginning to weaken.
━━━━━━━━━━━━━━━━━━━━━━━━━━
HOW IT WORKS
━━━━━━━━━━━━━━━━━━━━━━━━━━
PGamma smooths the source series, then computes the slope of that smoothed series — the first derivative, or Momentum. It then smooths Momentum and computes its slope — the second derivative, or Price Gamma. The four states are determined by the sign of both values simultaneously.
Momentum determines the current direction of market pressure. Gamma determines whether that pressure is strengthening or weakening. They often disagree near turning points — and those disagreements are often the most informative signals PGamma produces.
Think of it like driving a car. Momentum is your speed. Gamma is whether you are pressing the gas or the brake. You can be moving backward while pressing the brake — still moving backward, but slowing. That is negative momentum with positive gamma. In market terms, price may still be making lower lows, but each push down is losing force. That often precedes consolidation, a bounce, or a reversal.
Two examples of this disagreement are illustrated in the first two snapshots — a red candle during a green Gamma Timeline, and a green candle during an amber Gamma Timeline. The third snapshot illustrates when Momentum and Gamma align, showing a green candle with a green Gamma Timeline during Accelerating state.
━━━━━━━━━━━━━━━━━━━━━━━━━━
THE STATE MATRIX
━━━━━━━━━━━━━━━━━━━━━━━━━━
Momentum | Gamma | State
+ | + | Accelerating
+ | - | Bull Weakening
- | - | Bear Pressure
- | + | Bear Exhaustion
Momentum and Gamma often disagree near turning points. A positive Gamma reading while Momentum remains negative does not mean the market is bullish — it means bearish momentum is losing acceleration. Those disagreements are where PGamma is most useful.
━━━━━━━━━━━━━━━━━━━━━━━━━━
UNDERSTANDING THE DASHBOARD
━━━━━━━━━━━━━━━━━━━━━━━━━━
State — Combines Momentum and Price Gamma into one of the four market conditions above. Read the State row first.
Momentum — The first derivative of price. Positive = bullish momentum dominates. Negative = bearish momentum dominates.
Gamma — The second derivative of momentum. Above Zero = momentum is accelerating. Below Zero = momentum is decelerating. Gamma often changes direction before Momentum, making it useful for identifying transitions in market pressure.
Bias — A simplified interpretation combining Momentum and Gamma into a single directional context label.
━━━━━━━━━━━━━━━━━━━━━━━━━━
GAMMA TIMELINE
━━━━━━━━━━━━━━━━━━━━━━━━━━
The Gamma Timeline displays the historical sequence of Price Gamma states as a continuous color band along the bottom of the chart. Each colored segment represents one bar, allowing traders to quickly identify transitions between acceleration, weakening, pressure, and exhaustion without obscuring price action. Green for Accelerating, amber for Bull Weakening, red for Bear Pressure, sky blue for Bear Exhaustion. Toggle on or off in Display settings.
━━━━━━━━━━━━━━━━━━━━━━━━━━
GETTING STARTED
━━━━━━━━━━━━━━━━━━━━━━━━━━
1. Add PGamma to any chart. It works on all instruments and timeframes.
2. In Settings → Display, choose your panel position and size.
3. In Settings → Calculation, adjust Momentum Smoothing, Momentum Length, and Gamma Length to suit your timeframe. Default values are calibrated for intraday 1m–60m charts.
4. Read the State row first. Then use Momentum and Gamma to understand why the state is what it is.
5. Use Bias as a quick at-a-glance directional context.
6. Use the Gamma Timeline to read state history across the session at a glance.
━━━━━━━━━━━━━━━━━━━━━━━━━━
HOW TO USE IT
━━━━━━━━━━━━━━━━━━━━━━━━━━
PGamma is not a buy or sell signal. Think of PGamma as a market condition indicator rather than a trade signal. Use it as a confirmation layer alongside your existing methodology. Typical applications:
• Confirming trend continuation when State shows Accelerating.
• Identifying weakening rallies before reversals when State shows Bull Weakening.
• Recognizing building pressure before visible breakdowns when State shows Bear Pressure.
• Spotting exhaustion during extended trends when State shows Bear Exhaustion.
When used alongside a GEX level tool, price approaching a Call Wall with Γ⌃ Bull Weakening is a different setup than price approaching the same level with Γ↑ Accelerating. PGamma makes that distinction visible.
Because PGamma analyzes smoothed momentum rather than candle color, bullish candles can appear during Bear Pressure and bearish candles can appear during Bull Weakening. This reflects underlying momentum conditions rather than individual price bars — and is often an early warning of what is developing beneath the surface.
━━━━━━━━━━━━━━━━━━━━━━━━━━
WORKS WELL ALONGSIDE
━━━━━━━━━━━━━━━━━━━━━━━━━━
PGamma complements indicators that identify where important price levels exist.
• Trend indicators
• Moving averages
• Volume Profile
• VWAP
• Options Gamma Exposure (GEX)
• Support and Resistance
• Market Structure
These tools identify where price may react. PGamma helps evaluate how price is behaving as it approaches those levels.
━━━━━━━━━━━━━━━━━━━━━━━━━━
WHAT THIS TOOL IS NOT
━━━━━━━━━━━━━━━━━━━━━━━━━━
PGamma measures changes in momentum. It does not predict future prices or guarantee reversals. Use it as analytical context alongside your existing trading methodology.
━━━━━━━━━━━━━━━━━━━━━━━━━━
SETTINGS OVERVIEW
━━━━━━━━━━━━━━━━━━━━━━━━━━
Calculation: Source, Momentum Smoothing, Momentum Length, Gamma Length
Display: Show Dashboard, Panel Position (6 locations), Panel Size (Small / Normal / Large), Show Gamma Timeline
Note di rilascio
Release Notesv1.1— June 2026
Optional candle painting added. Now recolors bars by Gamma State using
the same colors as the State Ribbon.
Candle painting and the state ribbon can be used independently or together.
Note di rilascio
v1.2 — June 2026Added Zero Buffer % option to reduce state flicker around the zero line.
Uses adaptive hysteresis based on recent momentum and gamma magnitude.
Helps prevent rapid state changes during low-conviction market conditions while preserving overall responsiveness.
Note di rilascio
v1.3 — July 2026• Gamma Timeline can now float above the chart bottom, anchored below the session's opening range instead of glued to the pane floor. Input adjustable allows for additional bottom labels to render without Timeline visual interference.
• Added Ribbon Style toggle (Floating vs. Classic bottom-anchored).
• Added Sessions to Show to limit the ribbon to the N most recent sessions instead of drawing across full history. Input adjustable reducing chart clutter and also prevents visual interference with other chart labels.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
@MohaveTrader
Context First — Signals Second
Precision Trading Tools
Structure • Flow • Momentum
Context First — Signals Second
Precision Trading Tools
Structure • Flow • Momentum
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
@MohaveTrader
Context First — Signals Second
Precision Trading Tools
Structure • Flow • Momentum
Context First — Signals Second
Precision Trading Tools
Structure • Flow • Momentum
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.