Distance Oscillator - Support and Resistance
Jul 9, 2021

The Distance Oscillator - Support and Resistance indicator identifies potential future support and resistance levels by measuring price deviation from a moving average baseline.
Usage
The tool operates on the principle that significant price deviations from a moving average are often followed by a reversal or corrective movement. By calculating the distance between price and its baseline, the indicator identifies overbought and oversold extremes.
- Support Levels: When the oscillator falls below the lower deviation band (oversold), a support level is drawn at the recent price low. If the oscillator remains in this zone and price makes a new low, the level updates dynamically.
- Resistance Levels: When the oscillator rises above the upper deviation band (overbought), a resistance level is drawn at the recent price high. The level updates if price continues to push higher while the oscillator remains extended.
- Multi-Timeframe (MTF) Analysis: Users can enable HTF levels to see key institutional or macro-level supply and resistance zones plotted directly on their current chart.
- Stats Dashboard: A visual panel provides real-time information on the current oscillator state (Supply, Demand, or Neutral) and the specific percentage deviation for both the current and higher timeframes.
Details
The indicator uses a "Distance Oscillator" which is a centered oscillator similar to RSI but without fixed boundaries. To determine significant exhaustion points, the script applies Bollinger Band-style standard deviation thresholds to the oscillator values rather than the price itself. When the normalized distance between price and its SMA exceeds these calculated standard deviation bands, it triggers the creation of a horizontal support or resistance line.
Settings
Active Levels — Current TF
- Current TF S&R Levels: Toggles the display of support and resistance lines derived from the current timeframe.
- Support/Resistance Color: Customizes the visual appearance of the levels.
- Max Active Levels: Limits the number of lines displayed on the chart to maintain clarity.
Higher Timeframe Context
- HTF S&R Levels: Enables levels calculated from a different timeframe.
- HTF Timeframe: Sets the timeframe (e.g., Daily, Weekly) for macro level detection.
Core Engine — Oscillator
- Price Source: The price input used for calculations (default is Close).
- Baseline Length: The period of the SMA used as the central reference.
- Smooth Length: Applies smoothing to the oscillator to reduce market noise.
- Deviation Length/Multiplier: Controls the sensitivity and lookback period for the overbought/oversold bands.
FAQ
How do I interpret the horizontal lines? The lines represent historical price points where the oscillator reached a statistical extreme. These act as zones of interest where price may find future liquidity or rejection.
Can I use this for multiple timeframes? Yes, the indicator supports Multi-Timeframe (MTF) functionality, allowing you to plot Daily or Weekly levels on a 15-minute or 1-hour chart.
How can I access Distance Oscillator - Support and Resistance? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.
Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.
Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.
As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.
Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.
Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.
This does not represent our full Disclaimer. Please read our full disclaimer.
© 2026 LuxAlgo Global, LLC.

