OPEN-SOURCE SCRIPT
Price Displacement Efficiency [LB]

HI trader,
The Price Displacement Efficiency (PDE) is a momentum-oscillator designed to measure the "straightness" of price action. Based on the principles of market geometry and efficiency, it evaluates whether the market is moving with conviction in a specific direction or if it is merely "churning" with high volatility but little net progress.
The Problem It Solves:
Standard indicators often fail to distinguish between high-volatility noise and genuine trend displacement. A market can move 100 pips up and down (high movement) but end up exactly where it started (zero displacement). The PDE solves this by calculating the ratio between the net displacement and the total energy expended by price.
How It Works:
The indicator compares the absolute distance between the current price and the price n periods ago against the sum of every individual bar-to-bar move during that same window.High Efficiency (>75): Price is moving in a "straight line." This indicates a strong, healthy trend where every bit of volume is resulting in price progress.
Low Efficiency (<20): Price is oscillating heavily with no clear direction. This is typical of "Choppy" markets or accumulation/distribution phases.
Key Features:
Directional Histogram: Shows the efficiency value relative to the trend direction (Green for Bullish, Red for Bearish).
Smoothing Signal: An EMA line is applied to the raw efficiency data to help identify momentum shifts and trend transitions.
Compression Detection: The background highlights yellow when the market is in an "Inefficient" state (below 20%). This warns traders to stay out of the market or prepare for an imminent breakout.
Breakout Signals: Visual triangles appear when price exits a compression zone, signaling a potential surge in directional volatility.
How to Use It:
Trend Following: Look for values sustaining above 50/75 to stay in a trend.
Reversal Warning: If price is making new highs but the PDE is dropping sharply, it suggests the trend is becoming "inefficient" and may soon exhaust.
Volatility Contraction: Use the yellow highlighted zones to identify periods where the market is coiled, waiting for the next "Breakout" signal.
Disclaimer:
This indicator is a tool for analyzing market structure and efficiency. It does not constitute financial advice. Past performance is not indicative of future results.
The Problem It Solves:
Standard indicators often fail to distinguish between high-volatility noise and genuine trend displacement. A market can move 100 pips up and down (high movement) but end up exactly where it started (zero displacement). The PDE solves this by calculating the ratio between the net displacement and the total energy expended by price.
How It Works:
The indicator compares the absolute distance between the current price and the price n periods ago against the sum of every individual bar-to-bar move during that same window.High Efficiency (>75): Price is moving in a "straight line." This indicates a strong, healthy trend where every bit of volume is resulting in price progress.
Low Efficiency (<20): Price is oscillating heavily with no clear direction. This is typical of "Choppy" markets or accumulation/distribution phases.
Key Features:
Directional Histogram: Shows the efficiency value relative to the trend direction (Green for Bullish, Red for Bearish).
Smoothing Signal: An EMA line is applied to the raw efficiency data to help identify momentum shifts and trend transitions.
Compression Detection: The background highlights yellow when the market is in an "Inefficient" state (below 20%). This warns traders to stay out of the market or prepare for an imminent breakout.
Breakout Signals: Visual triangles appear when price exits a compression zone, signaling a potential surge in directional volatility.
How to Use It:
Trend Following: Look for values sustaining above 50/75 to stay in a trend.
Reversal Warning: If price is making new highs but the PDE is dropping sharply, it suggests the trend is becoming "inefficient" and may soon exhaust.
Volatility Contraction: Use the yellow highlighted zones to identify periods where the market is coiled, waiting for the next "Breakout" signal.
Disclaimer:
This indicator is a tool for analyzing market structure and efficiency. It does not constitute financial advice. Past performance is not indicative of future results.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.