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
  • 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.

Clause de non-responsabilité