Geometric Bias Oscillator [LuxAlgo]The Geometric Bias Oscillator indicator provides a normalized measure of market structure by comparing the cumulative magnitude of bullish and bearish segments derived from a simplified price path. It utilizes the Ramer-Douglas-Peucker (RDP) algorithm to filter out market noise, allowing traders to identify the underlying structural bias within a specific lookback window.
🔶 USAGE
The indicator oscillates between -100 and 100, where positive values indicate a dominant bullish structure and negative values indicate a dominant bearish structure. Unlike traditional oscillators that rely on raw price changes or moving averages, this tool focuses on the "weight" of simplified structural movements.
Traders can use the oscillator to:
Identify the prevailing trend bias based on structural significance rather than just closing prices.
Spot potential reversals when the oscillator crosses the zero line, signaling a shift in structural dominance.
Assess the strength of a trend; values near 100 or -100 suggest a highly directional market with very little structural retracement.
🔹 Visual Interpretation
The indicator features a dynamic gradient fill to provide better visual context. When the oscillator is above zero, a green gradient appears, with higher values showing increased intensity. Conversely, when below zero, a red gradient indicates bearish structural dominance. A hidden zero line serves as the central axis for these transitions.
🔶 DETAILS
The Geometric Bias Oscillator employs several advanced geometric concepts to determine market bias.
🔹 Ramer-Douglas-Peucker (RDP) Algorithm
The core of the calculation is the RDP algorithm, a line-simplification technique. It takes the price action over the defined "Window Size" and reduces it to a series of essential points. By eliminating minor price fluctuations (noise) that fall below a specific distance threshold, the algorithm reveals the primary "skeleton" of the market structure.
🔹 Coordinate Normalization
To ensure the simplification is consistent across different assets and volatility regimes, the script normalizes price coordinates using the Average True Range (ATR). Price values are divided by the ATR before the RDP distance calculations are performed. This ensures that the "ATR Multiplier" setting remains meaningful regardless of whether the asset is highly volatile or stable.
🔹 Structural Magnitude Calculation
Once the simplified structure is established, the script calculates the vertical distance (magnitude) of every segment in the path. These segments are categorized into bullish (upward) and bearish (downward) moves. The final oscillator value represents the percentage difference between the total bullish magnitude and the total bearish magnitude relative to the total structural movement.
🔶 SETTINGS
Window Size : The number of recent bars used to construct the structural path for the RDP algorithm.
ATR Multiplier : The sensitivity threshold for simplification. Higher values result in a more aggressive simplification, keeping only the most significant structural pivots.
ATR Length : The period used to calculate the ATR for price normalization.
Smoothing : Applies a Simple Moving Average to the final oscillator values to reduce jaggedness in the output.
Bullish Color : The color used for the oscillator and gradient when structural bias is positive.
Bearish Color : The color used for the oscillator and gradient when structural bias is negative.
Pine Script® göstergesi






















