OPEN-SOURCE SCRIPT
Price Gravity Research Engine [Effort & Displacement]

Price Gravity Research Engine (PG-RE) is a market-state research indicator designed to measure how much normalized market effort is being consumed relative to the amount and efficiency of price movement that effort produces.
The core idea is simple:
Price becomes mechanically “heavy” when substantial effort produces little or inefficient displacement, and “light” when price travels efficiently with comparatively little resistance.
Rather than generating traditional buy/sell signals, PG-RE is built to describe the current movement environment.
Who it is for: PG-RE is especially suited to discretionary intraday, price-action, and market-structure traders who want a regime/context layer for distinguishing clean repricing from inefficient, effort-heavy travel.
What the engine measures
PG-RE evaluates three primary components:
1) Effort
Market activity is normalized relative to its expected baseline.
2) Displacement
Net price movement over the Gravity Window is measured using log returns and normalized against recent volatility.
This asks:
Has price actually traveled a meaningful distance relative to what volatility would normally imply?
3) Path Efficiency
PG-RE compares net displacement with the total path traveled over the same window.
The Gravity model
PG-RE combines normalized effort, volatility-adjusted displacement, and path efficiency into one mechanical measure called Price Gravity.
In practical terms:
Gravity is then interpreted relative to its own recent distribution, making PG-RE a regime tool, not a fixed-value oscillator.
It is designed to answer:
“How difficult is it for price to move right now, and is that difficulty changing?”
not:
“Should I buy or sell this bar?”
What is different about PG-RE
Rather than evaluating activity, volatility, or directional movement independently, PG-RE treats their relationship as the object of measurement.
Its primary output is therefore not momentum or volume itself, but the changing amount of normalized effort associated with efficient versus inefficient price travel.
Mechanical states
PG-RE classifies the current environment into several descriptive states:
PRESSURE
Elevated effort is producing unusually weak displacement while travel remains inefficient and gravity is building. Elevated activity is producing little clean progress.
VACUUM ↑ / ↓
Price is producing unusually strong and efficient displacement with comparatively low effort. Movement is encountering relatively little resistance.
ACTIVE REPRICING ↑ / ↓
Both effort and displacement are elevated while travel remains efficient. Price is moving materially and activity is substantial.
DRAG ↑ / ↓
A directional move remains underway, but gravity is increasing while path efficiency remains below the high-efficiency threshold. Progress is becoming mechanically heavier.
LIGHT TRAVEL ↑ / ↓
Displacement is strong and efficient while overall gravity is unusually low.
DEAD ROTATION
Effort and displacement are subdued while travel remains inefficient, producing little directional progress.
RELEASE ↑ / ↓
A recent high-gravity environment is followed by sharply easing gravity while path efficiency improves. Resistance that had previously constrained movement is dissipating.
NEUTRAL
No stronger mechanical condition currently dominates.
Reading the dashboard
PRICE GRAVITY
Current mechanical state.
WEIGHT
Whether gravity is currently HEAVY, NORMAL, or LIGHT relative to its recent distribution.
CHANGE
Whether gravity is BUILDING, STABLE, or EASING.
TRAVEL
Whether price movement is DIRECT, MIXED, or ROTATIONAL.
EFFORT
Whether normalized activity is HIGH, NORMAL, or LOW.
BALANCE
A directional asymmetry proxy combining close-location-weighted effort with cumulative upward versus downward path travel.
Important:
UPSIDE HEAVIER is not a bullish label, and DOWNSIDE HEAVIER is not a bearish label.
BALANCE should be interpreted as a relative resistance proxy, not as a direct measurement of buying/selling pressure or order flow.
Direction and gravity should therefore be interpreted separately.
How I use it
PG-RE works best as a market-structure context layer.
I primarily look for transitions between conditions such as:
Practical notes
Quick Use Guide
The core idea is simple:
Price becomes mechanically “heavy” when substantial effort produces little or inefficient displacement, and “light” when price travels efficiently with comparatively little resistance.
Rather than generating traditional buy/sell signals, PG-RE is built to describe the current movement environment.
Who it is for: PG-RE is especially suited to discretionary intraday, price-action, and market-structure traders who want a regime/context layer for distinguishing clean repricing from inefficient, effort-heavy travel.
What the engine measures
PG-RE evaluates three primary components:
1) Effort
Market activity is normalized relative to its expected baseline.
- When usable volume is available, volume is used as the primary effort source.
- A range-based activity proxy can be used as an alternative.
- On intraday charts, PG-RE can normalize effort by time of day, helping prevent the open or close from being classified as abnormal simply because raw activity is naturally higher during those periods.
2) Displacement
Net price movement over the Gravity Window is measured using log returns and normalized against recent volatility.
This asks:
Has price actually traveled a meaningful distance relative to what volatility would normally imply?
3) Path Efficiency
PG-RE compares net displacement with the total path traveled over the same window.
- A direct move has high path efficiency.
- A back-and-forth move with little net progress has low path efficiency.
The Gravity model
PG-RE combines normalized effort, volatility-adjusted displacement, and path efficiency into one mechanical measure called Price Gravity.
In practical terms:
- more effort with less progress tends to increase gravity
- inefficient, rotational travel tends to increase gravity
- strong, efficient displacement tends to reduce gravity
- efficient movement achieved with relatively little effort represents lighter travel
Gravity is then interpreted relative to its own recent distribution, making PG-RE a regime tool, not a fixed-value oscillator.
It is designed to answer:
“How difficult is it for price to move right now, and is that difficulty changing?”
not:
“Should I buy or sell this bar?”
What is different about PG-RE
Rather than evaluating activity, volatility, or directional movement independently, PG-RE treats their relationship as the object of measurement.
Its primary output is therefore not momentum or volume itself, but the changing amount of normalized effort associated with efficient versus inefficient price travel.
Mechanical states
PG-RE classifies the current environment into several descriptive states:
PRESSURE
Elevated effort is producing unusually weak displacement while travel remains inefficient and gravity is building. Elevated activity is producing little clean progress.
VACUUM ↑ / ↓
Price is producing unusually strong and efficient displacement with comparatively low effort. Movement is encountering relatively little resistance.
ACTIVE REPRICING ↑ / ↓
Both effort and displacement are elevated while travel remains efficient. Price is moving materially and activity is substantial.
DRAG ↑ / ↓
A directional move remains underway, but gravity is increasing while path efficiency remains below the high-efficiency threshold. Progress is becoming mechanically heavier.
LIGHT TRAVEL ↑ / ↓
Displacement is strong and efficient while overall gravity is unusually low.
DEAD ROTATION
Effort and displacement are subdued while travel remains inefficient, producing little directional progress.
RELEASE ↑ / ↓
A recent high-gravity environment is followed by sharply easing gravity while path efficiency improves. Resistance that had previously constrained movement is dissipating.
NEUTRAL
No stronger mechanical condition currently dominates.
Reading the dashboard
PRICE GRAVITY
Current mechanical state.
WEIGHT
Whether gravity is currently HEAVY, NORMAL, or LIGHT relative to its recent distribution.
CHANGE
Whether gravity is BUILDING, STABLE, or EASING.
TRAVEL
Whether price movement is DIRECT, MIXED, or ROTATIONAL.
EFFORT
Whether normalized activity is HIGH, NORMAL, or LOW.
BALANCE
A directional asymmetry proxy combining close-location-weighted effort with cumulative upward versus downward path travel.
Important:
UPSIDE HEAVIER is not a bullish label, and DOWNSIDE HEAVIER is not a bearish label.
- UPSIDE HEAVIER means the upward-side gravity proxy is relatively heavier than the downward-side proxy.
- DOWNSIDE HEAVIER means the downward-side gravity proxy is relatively heavier than the upward-side proxy.
BALANCE should be interpreted as a relative resistance proxy, not as a direct measurement of buying/selling pressure or order flow.
Direction and gravity should therefore be interpreted separately.
How I use it
PG-RE works best as a market-structure context layer.
I primarily look for transitions between conditions such as:
- HEAVY + BUILDING + ROTATIONAL
effort is being consumed without clean travel - LIGHT + DIRECT ↑/↓
price is traveling efficiently with relatively low gravity - PRESSURE → RELEASE
a previously constrained auction begins converting effort into cleaner movement - ACTIVE REPRICING → DRAG
a strong move remains active, but its mechanical efficiency is deteriorating - VACUUM → rising gravity
a low-resistance move begins encountering more opposition
Practical notes
- PG-RE is adaptive and distribution-relative, so a “high” reading in one market or timeframe does not need to equal a “high” reading somewhere else in raw-value terms.
- The current live bar can evolve as price, range, and volume develop.
- The indicator contains no buy/sell labels and makes no forecast claim.
- PG-RE measures model-implied movement difficulty from price, volatility, and volume/range data. It does not directly measure order-book liquidity, executed aggressor flow, or physical market resistance.
- A warm-up period is required before distribution-relative states become available.
- Its purpose is to structure the relationship between effort, displacement, path efficiency, and changing market resistance within one coherent framework.
Quick Use Guide
- Start with PRICE GRAVITY and WEIGHT to judge whether the market is mechanically heavy, normal, or light.
- Check CHANGE to see whether gravity is building, stable, or easing.
- Use TRAVEL to separate direct movement from churn.
- Use EFFORT to judge how much participation is present behind the move.
- Use BALANCE to identify directional asymmetry in relative resistance.
- Treat states as context, not trade arrows.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.