OPEN-SOURCE SCRIPT

IB & Hammer at SMA(20,50|200)

IB & Hammer at SMA (20, 50, 200) Breakout/Breakdown Indicator

Overview:
The IB (Inside Bar) & Hammer at SMA Breakout/Breakdown Indicator is designed to identify breakout and breakdown opportunities using Inside Bars (IB) in combination with Simple Moving Averages (SMA 20, 50, 200) as key trend filters. This indicator is useful for traders looking to catch momentum moves after consolidation phases, confirming the trend direction with moving averages.

Indicator Logic:
Inside Bar (IB) Detection:

An Inside Bar is a candlestick that is completely within the range of the previous candle (i.e., lower high and higher low).
Inside Bars indicate consolidation, suggesting a potential breakout.
SMA Trend Confirmation:

The script uses three moving averages (SMA 20, 50, 200) to determine the trend direction.
Bullish trend: Price is above the 50 & 200 SMAs.
Bearish trend: Price is below the 50 & 200 SMAs.
The 20 SMA is used as a dynamic short-term momentum filter.
Breakout & Breakdown Conditions:

Breakout: When price breaks above the Inside Bar’s high, and the trend is bullish (above key SMAs).
Breakdown: When price breaks below the Inside Bar’s low, and the trend is bearish (below key SMAs).
Alerts can be set to notify traders of potential trade opportunities.
Features:
✅ Identifies Inside Bars (consolidation zones).
✅ Uses SMA (20, 50, 200) for trend confirmation.
✅ Breakout/Breakdown signals based on Inside Bar structure.
✅ Customizable Moving Averages & Alerts.
✅ Visual markers for easy trade identification.

How to Use:
Confirm Trend Direction:

If the price is above SMA 50 & 200, look for breakout trades.
If the price is below SMA 50 & 200, look for breakdown trades.
Watch for Inside Bars:

The script highlights Inside Bars with a specific color (configurable).
These bars indicate a low-volatility phase, preparing for a breakout.
Trade on Breakout/Breakdown:

Breakout: Enter long when the price breaks above the Inside Bar’s high (bullish trend).
Breakdown: Enter short when the price breaks below the Inside Bar’s low (bearish trend).

Aviso legal