OPEN-SOURCE SCRIPT
Atualizado Internal Market Structure

Internal Market Structure Indicator (Based on Bearish/Bullish Candle Patterns)
This custom market structure indicator is designed to help traders identify key shifts in market pressure based on bullish and bearish candle patterns. The indicator tracks consecutive bullish and bearish candles and identifies significant points where the price action suggests a potential reversal or continuation of the current market trend.
Key Features:
1. Bullish & Bearish Candle Recognition: The indicator monitors individual candles to determine if they are bullish (close > open) or bearish (close < open), and uses this information to track price direction over consecutive candles.
2. Consecutive Candle Tracking: It tracks consecutive bullish and bearish candles, giving insight into the strength of the prevailing trend. The number of consecutive candles can be adjusted to refine the analysis based on market conditions.
3. Engulfing Candle Detection: The indicator identifies Bullish and Bearish Engulfing signals when a reversal pattern is detected. These are plotted as triangle shapes on the chart:
-Bullish Engulfing: Indicates a potential reversal or continuation of an upward move, where a bullish candle fully engulfs the previous bearish candle.
-Bearish Engulfing: Indicates a potential reversal or continuation of a downward move, where a bearish candle fully engulfs the previous bullish candle.
4. Internal Shifts: The indicator also tracks Internal Shifts, which occur when the price closes beyond the highest or lowest levels of previous bullish or bearish sequences, signaling a potential trend change:
-Bullish Internal Shift: A shift indicating the market may be turning bullish.
-Bearish Internal Shift: A shift indicating the market may be turning bearish.
5. Alerts: Custom alerts are included to notify traders when any of the above conditions are met:
-Bullish Pressure Change Alert
-Bearish Pressure Change Alert
-Bullish Internal Shift Alert
-Bearish Internal Shift Alert
Plotting:
The indicator visually marks these key price levels with shapes on the chart:
-Green Triangle Up: Bullish Engulfment
-Red Triangle Down: Bearish Engulfment
-Blue Triangle Down: Bearish Internal Shift
-Orange Triangle Up: Bullish Internal Shift
Usage:
This indicator can be used to spot potential reversals, continuation patterns, and shifts in market sentiment. Traders can combine these signals with other technical indicators to form a more robust trading strategy.
By focusing on candle patterns and market structure, this indicator offers a clear, actionable framework for understanding market behavior and making more informed trading decisions.
*NOTE*
The polyline and horizontal trend lines drawn are not included in this indicator, but are there to show how this indicator can be used to illustrate the internal market structure of the given timeframe.
This custom market structure indicator is designed to help traders identify key shifts in market pressure based on bullish and bearish candle patterns. The indicator tracks consecutive bullish and bearish candles and identifies significant points where the price action suggests a potential reversal or continuation of the current market trend.
Key Features:
1. Bullish & Bearish Candle Recognition: The indicator monitors individual candles to determine if they are bullish (close > open) or bearish (close < open), and uses this information to track price direction over consecutive candles.
2. Consecutive Candle Tracking: It tracks consecutive bullish and bearish candles, giving insight into the strength of the prevailing trend. The number of consecutive candles can be adjusted to refine the analysis based on market conditions.
3. Engulfing Candle Detection: The indicator identifies Bullish and Bearish Engulfing signals when a reversal pattern is detected. These are plotted as triangle shapes on the chart:
-Bullish Engulfing: Indicates a potential reversal or continuation of an upward move, where a bullish candle fully engulfs the previous bearish candle.
-Bearish Engulfing: Indicates a potential reversal or continuation of a downward move, where a bearish candle fully engulfs the previous bullish candle.
4. Internal Shifts: The indicator also tracks Internal Shifts, which occur when the price closes beyond the highest or lowest levels of previous bullish or bearish sequences, signaling a potential trend change:
-Bullish Internal Shift: A shift indicating the market may be turning bullish.
-Bearish Internal Shift: A shift indicating the market may be turning bearish.
5. Alerts: Custom alerts are included to notify traders when any of the above conditions are met:
-Bullish Pressure Change Alert
-Bearish Pressure Change Alert
-Bullish Internal Shift Alert
-Bearish Internal Shift Alert
Plotting:
The indicator visually marks these key price levels with shapes on the chart:
-Green Triangle Up: Bullish Engulfment
-Red Triangle Down: Bearish Engulfment
-Blue Triangle Down: Bearish Internal Shift
-Orange Triangle Up: Bullish Internal Shift
Usage:
This indicator can be used to spot potential reversals, continuation patterns, and shifts in market sentiment. Traders can combine these signals with other technical indicators to form a more robust trading strategy.
By focusing on candle patterns and market structure, this indicator offers a clear, actionable framework for understanding market behavior and making more informed trading decisions.
*NOTE*
The polyline and horizontal trend lines drawn are not included in this indicator, but are there to show how this indicator can be used to illustrate the internal market structure of the given timeframe.
Notas de Lançamento
-Logic updated from engulfing high/low values to engulfing candle open values. -Visual illustration updated
Notas de Lançamento
Alarm notification text has been updated.Notas de Lançamento
Update: New input added — use aggregated 1-minute data to spot engulfing signals while watching any chart timeframe.Notas de Lançamento
update to engulfmentsNotas de Lançamento
Update: Automatic order blocks available.Notas de Lançamento
Final edit- change of functionality📈 Internal Market Structure – by The_Forex_Steward
The Internal Market Structure indicator is designed to help traders identify and visualize structural shifts within price action that often precede trend changes, order block formations, and key break of structure (BOS) events. This tool is especially useful for traders applying Smart Money Concepts (SMC), price action strategies, or market structure analysis.
🔧 How It Works
The indicator automatically tracks internal shifts in market structure and break of structure (BOS) points using key candle behaviors. It distinguishes between bullish and bearish momentum using a combination of:
Candlestick body orientation (bullish or bearish)
Previous swing highs and lows
Internal shift points
BOS confirmations
🧠 Key Concepts Used
Internal Shift (IS):
A bullish internal shift occurs when price closes above the high of the most recent bearish candle.
A bearish internal shift occurs when price closes below the low of the most recent bullish candle.
Break of Structure (BOS):
A BOS happens when price breaks a significant swing high (bullish BOS) or swing low (bearish BOS), confirming a potential trend continuation or reversal.
Swing Points & Zigzag Structure:
The script plots a visual zigzag structure by connecting major swing highs and lows, marking Higher Highs (HH), Higher Lows (HL), Lower Highs (LH), and Lower Lows (LL) based on internal shifts.
📌 Visual Elements on the Chart
Green dotted line: Bullish BOS level
Red dotted line: Bearish BOS level
Blue zigzag lines: Connect confirmed swing points (e.g., HL, HH, LH, LL)
Shift markers: Plotted at the moment of internal market shifts, acting as potential reversal or continuation zones
🔔 Alerts Included
✅ Bullish Engulfment / Order Block
✅ Bearish Engulfment / Order Block
✅ Bullish Break of Structure
✅ Bearish Break of Structure
These alerts help you react in real time to key market structure changes.
📊 How to Use It
Entry Confirmation:
Use internal shifts as early signals of potential trend reversals or continuations. A bullish shift after a bearish move could indicate an upcoming rally.
Break of Structure (BOS):
Wait for BOS to confirm structural change. A bullish BOS (price breaking a recent swing high) confirms upward momentum.
Zigzag Context:
Visualize the evolving structure through plotted swing highs/lows and internal shifts. Use these to identify trend direction, potential pullbacks, or liquidity levels.
Smart Money Concepts:
Align this indicator with concepts like liquidity grabs, mitigation blocks, and order blocks to enhance your trade precision.
⚙️ Best Timeframes & Assets
Works on all timeframes (scalp to swing)
Suitable for Forex, Crypto, Stocks, Indices
✅ Tip: Combine with SMC Tools
This indicator becomes even more powerful when used with other SMC-based tools such as:
Liquidity zone indicators
Order block indicators
Institutional candles
Script de código aberto
No verdadeiro espirito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam entendê-lo e verificá-lo. Parabéns ao autor Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações e regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
Script de código aberto
No verdadeiro espirito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam entendê-lo e verificá-lo. Parabéns ao autor Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações e regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.