OPEN-SOURCE SCRIPT
Overextension Oscillator [by DanielM]

The Overextension Oscillator is an indicator that detects when a market move has extended significantly beyond its typical range, signaling potential areas for a correction or reversal. Unlike traditional oscillators that rely on fixed overbought/oversold levels, this tool dynamically adjusts its thresholds based on historical swing high and swing low movements.
By analyzing all swing points on the chart, the indicator determines the expected range of price movements and identifies when the price extends beyond normal levels. Since every asset has different price behavior and volatility, swing lengths may vary from asset to asset, ensuring that overextension is measured relative to each market's historical price behavior.
How It Works
1️⃣ Swing Detection & Data Collection
2️⃣ Overextension Calculation
Using the stored swing data, the indicator calculates:
These values are used to create dynamic overextension thresholds that adjust based on historical data.
3️⃣ Price Distance & Overextension Measurement
The indicator calculates the distance between the current price and the closest historical swing point. If this distance exceeds the predefined threshold based on past swings, the move is considered overextended. The greater the deviation, the higher the probability of a pullback or short-term reversal.
4️⃣ Buy/Sell Signal Generation
These signals indicate that the price has reached a level where it historically tends to slow down or reverse.
By analyzing all swing points on the chart, the indicator determines the expected range of price movements and identifies when the price extends beyond normal levels. Since every asset has different price behavior and volatility, swing lengths may vary from asset to asset, ensuring that overextension is measured relative to each market's historical price behavior.
How It Works
1️⃣ Swing Detection & Data Collection
- The indicator scans all available swing highs and swing lows on the chart to gather a complete dataset of past price fluctuations.
- It records the percentage differences between swings to determine how much price typically moves in a given market.
2️⃣ Overextension Calculation
Using the stored swing data, the indicator calculates:
- Average Swing Difference – Measures the average percentage difference between swings.
- Average Move Percentage – Determines the typical magnitude of price moves within a trend cycle.
These values are used to create dynamic overextension thresholds that adjust based on historical data.
3️⃣ Price Distance & Overextension Measurement
The indicator calculates the distance between the current price and the closest historical swing point. If this distance exceeds the predefined threshold based on past swings, the move is considered overextended. The greater the deviation, the higher the probability of a pullback or short-term reversal.
4️⃣ Buy/Sell Signal Generation
- A Buy signal is generated when the price has dropped below an overextended threshold relative to a past swing low.
- A Sell signal is generated when the price has risen beyond an overextended threshold relative to a past swing high.
These signals indicate that the price has reached a level where it historically tends to slow down or reverse.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites — learn more here.
🟢 FREE Trading Signals: t.me/danielmtrading
🔥 Best BROKER - Get 20% Deposit BONUS - bit.ly/41UtANI
🔥 Best Crypto Exchange - Get 45% Deposit BONUS bit.ly/43MybTA
🔥 Best BROKER - Get 20% Deposit BONUS - bit.ly/41UtANI
🔥 Best Crypto Exchange - Get 45% Deposit BONUS bit.ly/43MybTA
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites — learn more here.
🟢 FREE Trading Signals: t.me/danielmtrading
🔥 Best BROKER - Get 20% Deposit BONUS - bit.ly/41UtANI
🔥 Best Crypto Exchange - Get 45% Deposit BONUS bit.ly/43MybTA
🔥 Best BROKER - Get 20% Deposit BONUS - bit.ly/41UtANI
🔥 Best Crypto Exchange - Get 45% Deposit BONUS bit.ly/43MybTA
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.