Price Efficiency Ratio (PER) [SharpStrat]Price Efficiency Ratio (PER)
The Price Efficiency Ratio (PER) is built around a simple question: how efficiently is the market moving from its starting point to its current point?
Price often moves in indirect ways. Sometimes it travels cleanly in one direction with very little noise, and sometimes it spends more energy moving up and down than actually progressing. PER quantifies this behavior and turns it into a clear, readable number that identifies whether the market is behaving like a trend or a range.
To make the idea intuitive, imagine walking from point A to point B. If you walk straight, you arrive efficiently. If you zigzag, backtrack, or wander before reaching the same point, your total travel distance becomes much larger than the straight line distance. PER applies this exact idea to price movement.
How the Indicator Computes Efficiency
The indicator measures two distances over the selected lookback period:
Net Distance: This is the absolute distance between the closing price now and the closing price at the start of the lookback period. It represents how far the market has actually progressed.
Total Distance: This is the sum of every bar to bar price change within that same period. Every small rise, drop, spike, reversal, and retrace is included.
These two distances are then compared: PER = (Net Distance / Total Distance) × 100
The result is a 0-100% reading where:
HIGH values (above threshold) = Price moved efficiently in one direction = Trending
LOW values (below threshold) = Price zigzagged without net progress = Ranging
Understanding High PER vs Low PER
The easiest way to see what PER measures is by observing how price travels between two points. The image below shows a clean directional movement compared to a choppy, back and forth one.
On the left, the market moves steadily from point A to point B with only small interruptions. Most of the movement contributes directly toward the final destination. Because the total distance is close to the straight line distance, PER is high. This represents a trending environment where trend following tools typically perform well.
On the right, the market still reaches point B, but the path is filled with reversals. Price spends more time oscillating than progressing. Total distance becomes much larger than net distance, which produces a low PER. This represents a ranging or mean-reversion environment, where fading extremes and playing inside the range tends to be more appropriate.
In simple terms:
High PER means price is moving with intention and direction.
Low PER means price is moving inefficiently and indecisively.
How to Use PER
PER is not a signal generator by itself. It is a market regime classifier, and its strength lies in selecting the right strategy for the right environment.
When PER is above the threshold (Trending Environment)
Price is moving efficiently. Most bars contribute to the same directional bias. This is when trend following strategies excel. Examples include:
Breakouts
Pullback entries into trend direction
Moving average crossovers
In these situations, using mean-reversion is generally less effective.
When PER is below the threshold (Ranging / Mean-Reversion Environment)
Price is inefficient and oscillatory. The market wastes movement and fails to make directional progress. Examples include:
RSI overbought/oversold reversals
Bollinger Band bounces
Liquidity sweeps and reversals
Breakouts tend to fail more frequently in these conditions.
Example:
Below is a section of the S&P 500 on the daily timeframe showing both trending and ranging conditions, along with how PER responded to each.
This chart shows how PER naturally separates trending phases from ranging phases using objective efficiency rather than subjective chart reading. It demonstrates exactly how the indicator identifies regime changes and helps you understand what kind of behavior the market is currently showing.
Features & Settings
Dynamic vs Fixed Threshold
Threshold- Different markets and timeframes produce different typical PER values.
Fixed Threshold:
You choose the efficiency level manually. Useful if you trade the same instrument and know the PER levels that define a trend for it.
Dynamic Threshold:
The threshold is calculated from historical PER distribution.
This adapts automatically to each timeframe and each asset, aligning the threshold with what is normal for that chart. It reduces manual tuning and produces more consistent regime classification.
Smoothing Option
Raw PER can fluctuate rapidly on lower timeframes. Smoothing helps reveal the underlying efficiency trend more clearly.
Volume Weighted PER
A volume weighted mode is also included. When enabled, price movement occurring during high volume bars has more influence, making PER more meaningful on assets where volume impacts trend quality.
Information Box
The information box provides quick context, including the current PER value, the current regime (trending or ranging), and whether the threshold mode is fixed or dynamic. It is designed to make interpretation instant without additional settings or visual clutter.
Summary
PER will not tell you when to buy or sell. PER doesn't predict the future or generate signals. It simply tells you what kind of market you're in right now.
The value is in knowing when to apply trend strategies versus mean reversion strategies. A lot of traders already have good tools they just use them in the wrong conditions. PER helps you avoid that mistake. Use it as part of your overall analysis, not as a standalone system.
This indicator is open source and free. If you find it useful, a like or comment helps others discover it.
Risk Disclaimer: For educational purposes only. Trading involves risk. No indicator guarantees profits. Use proper risk management.
Pine Script® indicator






















