Market Structure Algo

The "Market Structure Algo" (MS Algo) is a comprehensive tool developed by OmegaTools. This advanced indicator is designed to analyze the market's structure through a combination of pivot highs and lows, creating a nuanced understanding of potential market movements.

Core Functionality:
- Internal and External Market Structure (MS): The MS Algo differentiates between internal and external market structures by analyzing pivot points over different periods. This dual analysis allows for a deeper understanding of short-term and long-term market trends.
- Zone Distance and Visualization: The indicator introduces a novel approach to visualizing potential areas of interest or 'zones' around pivot points, adjustable through the 'Zone Distance' setting. This feature enhances the visual representation of zone created on the chart that can be used as a support and resistance area.
- Dynamic Signal Generation: Utilizing a comprehensive algorithm, the MS Algo identifies potential signals for entering and exiting trades based on the internal market structure. These signals are visually represented on the chart, aiding in decision-making. These signals are based on the acceptance and confirmed breakout or the refusal of the pivot points by the price.

Operational Mechanism:
- The MS Algo calculates pivot highs and lows over specified periods (input by the user) to determine the market's current structure. It then evaluates the market's position relative to these pivot points to assign a market structure score, which can range from bullish to bearish extremes.
- Signals for long and short positions, as well as exits, are generated based on the interaction between the close price and these pivot points.
- Additionally, the indicator plots zones around the moving average, adjusted for the ATR and the specified 'Zone Distance,' providing a visual guide to areas where the market might find support or resistance.

Usage Guidelines:
- To apply the MS Algo to your TradingView charts, adjust the 'Internal MS' and 'External MS' settings to align with your analysis preferences. The 'Zone Distance' input allows for customization of the zone visualization feature.
- The color-coded signals and zone fillings serve as guides to understanding the current market structure and potential areas of interest. These should be interpreted within the context of a broader trading strategy and risk management framework.

Understanding the Indicator's Originality:
The MS Algo stands out due to its unique blend of pivot analysis and zone visualization, providing traders with a detailed view of the market's structure that goes beyond traditional indicators. Its originality lies in the methodological integration of these components to offer a tool that enhances market analysis.

Responsible Use Disclaimer:
The financial markets are unpredictable, and the MS Algo is designed to serve as an analytical tool within a trader's arsenal, not a standalone solution for trading decisions. Traders should use this tool judiciously, alongside comprehensive market analysis and sound risk management practices. It's important to understand that the MS Algo does not guarantee trading success nor does it claim to predict specific price movements. Trading involves risks, including the potential loss of capital.

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.


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.

Want to use this script on a chart?