New AI Backtesting Assistant Launch!

Market Structure Oscillator

Aug 1, 2024
Static chart image
Price Action Based
Support and Resistance
Oscillators
Pivot Based (Retrospective)

Works on the Following Platforms

TradingView
For free use on the TradingView platform
NinjaTrader
For free use on the NinjaTrader platform
MetaTrader 4
For free use on the MetaTrader 4 platform
MetaTrader 5
For free use on the MetaTrader 5 platform
Thinkorswim
For free use on the Thinkorswim platform

The Market Structure Oscillator indicator analyzes and synthesizes short-term, intermediate-term, and long-term market structure shifts and breaks, visualizing the output as oscillators and graphical representations of real-time market structures on the main price chart.

The oscillator presentation of the detected market structures helps traders visualize trend momentum and strength, identifying potential trend reversals, and providing different perspectives to enhance the analysis of classic market structures.

USAGE

indicator image

A market structure shift signals a potential change in market sentiment or direction, while a break of structure indicates a continuation of the current trend. Detecting these events in real-time helps traders recognize both trend changes and continuations. The market structure oscillator translates these concepts visually, offering deeper insights into market momentum and strength. It aids traders in identifying overbought or oversold conditions, potential trend reversals, and confirming trend direction.

indicator image

Oscillators often generate signals based on crossing certain thresholds or diverging from price movements, providing cues for traders to enter or exit positions.

indicator image

The weights determine the influence of each period (short-term, intermediate-term, long-term) on the final oscillator value. By changing the weights, traders can emphasize or de-emphasize the importance of each period. Higher weights increase their respective market structure's influence on the oscillator value. For example, if the weight for the short-term period is set to 0, the final value of the oscillator will be calculated using only the intermediate-term and long-term market structures.

indicator image

The indicator features a Cycle Oscillator component, which uses the market structure oscillator values to generate a histogram and provide further insights into market cycles and potential signals. The Cycle Oscillator aids in timing by allowing traders to more easily see the median length of an oscillation around the average point, helping them identify both favorable prices and favorable moments for trading.

indicator image

Users can also display detected market structures on the price chart by enabling the corresponding market structure toggle from the "Market Structures on Chart" settings group.

DETAILS

The script initiates its analysis by detecting swing levels, which form the fundamental basis for its operations. It begins by identifying short-term swing points, automatically detected solely based on market movements without any reliance on user-defined input. Short-Term Swing Highs (STH) are peaks in price surrounded by lower highs on both sides, while Short-Term Swing Lows (STL) are troughs surrounded by higher lows.

To identify intermediate-term and long-term swing points, the script uses previously detected short-term swing points as reference points. It examines these points to determine intermediate-term swings and further analyzes intermediate-term swings to identify long-term swing points. This method ensures a thorough and unbiased evaluation of market dynamics, providing traders with reliable insights into market structures.

indicator image

Once swing levels are detected, the process continues with the analysis of Market Structure Shifts (MSS) and Breaks of Structure (BoS). A Market Structure Shift, also known as a Change of Character (CHoCH), is a critical event in price action analysis that suggests a potential shift in market sentiment or direction. It occurs when the price reverses from an established trend, indicating that the current trend may be losing momentum and a reversal could be imminent.

On the other hand, a Break of Structure signifies the continuation of the existing market trend. This event occurs when the price decisively moves beyond a previous swing high or low, confirming the strength and persistence of the prevailing trend.

The indicator analyzes price patterns using a pure price action approach and identifies market structures for short-term, intermediate-term, and long-term periods. The collected data is then normalized and combined using specified weights to calculate the final Market Structure Oscillator value.

indicator image

SETTINGS

The indicator incorporates user-defined settings, allowing users to tailor it according to their preferences and trading strategies.

Market Structure Oscillator

  • Market Structure Oscillator: Toggles the visibility of the market structures oscillator.
  • Short Term Weight: Defines the weight for the short-term market structure.
  • Intermediate Term Weight: Defines the weight for the intermediate-term market structure.
  • Long Term Weight: Defines the weight for the long-term market structure.
  • Oscillator Smoothing: Determines the smoothing factor for the oscillator.
  • Gradient Colors: Allows customization of bullish and bearish gradient colors.
  • Market Structure Oscillator Crosses: Provides signals based on market structure oscillator equilibrium level crosses.

Cycle Oscillator

  • Cycle Oscillator - Histogram: Toggles the visibility of the cycle oscillator.
  • Cycle Signal Length: Defines the length of the cycle signal.
  • Cycle Oscillator Crosses: Provides signals based on cycle oscillator crosses.

Market Structures on Chart

  • Market Structures: Allows plotting of market structures (short, intermediate, and long term) on the chart.
  • Line, Label, and Color: Options to display lines and labels for different market structures with customizable colors.

Oscillator Components

  • Oscillators: Separately plots short-term, intermediate-term, and long-term oscillators. Provides options to display these oscillators with customizable colors.

RELATED SCRIPTS

Market-Structures-(Intrabar)

Trading is risky and many will lose money in connection with trading 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 markets 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 for charting platforms, 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 or tool we provide.

Charts used on this site are by TradingView in which the majority of our tools 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.

This does not represent our full Disclaimer. Please read our full disclaimer.

© 2025 LuxAlgo Global, LLC.