PROTECTED SOURCE SCRIPT
Daily SMA Gate (Bullish) + IHS(15m & 1H RS) + Daily Lower BB

Daily SMA Bull Gate + IHS (15m/1H) – Early Signal + Daily Lower BB
Purpose: a “buy the dip / buy the pullback” scanner/indicator that looks for early right-shoulder completion of an Inverse Head & Shoulders (IHS) on intraday charts (15m & 1H), but only when the daily context is bullish. Optional Daily Lower Bollinger proximity helps focus on pullbacks toward support.
How it works
1) Daily Bull Gate (trend filter)
Evaluated on the Daily timeframe.
Gate is true when:
Price is above the Daily SMA(50), and
Price is within X% of the Daily SMA(20) (configurable).
You can choose to use only the prior completed daily bar to avoid intraday bleed-through.
2) IHS right-shoulder detector (early) on intraday
Runs on 15m and 1H via request.security.
Detects an Inverse Head & Shoulders using swing pivots:
Ordered pivot lows L1 (left shoulder), L2 lower low (head), L3 (right shoulder).
Right shoulder must be a higher low than the head and near L1 (ATR- or %-based tolerance).
Requires a neckline: the highest swing-high strictly between L1 and L3.
Minimum bar separation between shoulders/head is configurable.
Signals fire as the right-shoulder pivot confirms (on the bar that completes R bars to the right of the pivot).
3) Daily Lower Bollinger filter (optional)
Daily basis = SMA(20); lower band = SMA(20) − k·σ (k default 1.0).
Prints 1 when Daily Close is within Y% of the lower band.
Good for isolating constructive pullbacks inside an uptrend.
Plots / Screener columns
Combined Signal (15m OR 1H RS) – blue (1 when Bull Gate is true and either TF confirms IHS RS).
RS(15m Early) – green.
RS(1H Early) – purple.
Daily SMA Gate Only – orange (1 when above SMA50 and near SMA20).
Daily Lower Bollinger (within %) – teal (1 when within your % threshold of the lower band).
(Each line outputs 1/0 so it works seamlessly in the Pine Screener.)
Inputs
Daily
Daily SMA(50), Daily SMA(20)
Within % of Daily SMA(20)
Use prior completed Daily bar only
Bollinger
Daily BB stdev (below SMA20) (k)
Within % of Daily Lower BB
Pattern (IHS)
IHS Pivot L, IHS Pivot R (pivot window left/right)
Min sep bars L1–L2 & L2–L3
Tolerance: ATR × mult or % of L1
How to use
Screen your watchlist with:
Daily SMA Gate Only = 1, and optionally
Daily Lower Bollinger (within %) = 1, and/or
Combined Signal (15m OR 1H RS) = 1 for setups.
Open the chart to validate structure:
Uptrend context (above Daily 50-SMA).
Clear IHS: head lower than L1, RS near L1 and higher than head, neckline between L1–L3.
Plan execution:
Many traders use the neckline / RS low for risk and look for confirmation on neckline reclaim/break with volume.
Notes & limitations
Pivot-based signals confirm only after R bars (by design); potential pivots can disappear before confirmation.
Multi-timeframe logic: Daily filters + intraday patterns (15m & 1H). Tune L/R, separations, and tolerances per instrument/volatility.
This is a tool, not advice—combine with your risk management and other confluence (levels, volume, catalysts).
Purpose: a “buy the dip / buy the pullback” scanner/indicator that looks for early right-shoulder completion of an Inverse Head & Shoulders (IHS) on intraday charts (15m & 1H), but only when the daily context is bullish. Optional Daily Lower Bollinger proximity helps focus on pullbacks toward support.
How it works
1) Daily Bull Gate (trend filter)
Evaluated on the Daily timeframe.
Gate is true when:
Price is above the Daily SMA(50), and
Price is within X% of the Daily SMA(20) (configurable).
You can choose to use only the prior completed daily bar to avoid intraday bleed-through.
2) IHS right-shoulder detector (early) on intraday
Runs on 15m and 1H via request.security.
Detects an Inverse Head & Shoulders using swing pivots:
Ordered pivot lows L1 (left shoulder), L2 lower low (head), L3 (right shoulder).
Right shoulder must be a higher low than the head and near L1 (ATR- or %-based tolerance).
Requires a neckline: the highest swing-high strictly between L1 and L3.
Minimum bar separation between shoulders/head is configurable.
Signals fire as the right-shoulder pivot confirms (on the bar that completes R bars to the right of the pivot).
3) Daily Lower Bollinger filter (optional)
Daily basis = SMA(20); lower band = SMA(20) − k·σ (k default 1.0).
Prints 1 when Daily Close is within Y% of the lower band.
Good for isolating constructive pullbacks inside an uptrend.
Plots / Screener columns
Combined Signal (15m OR 1H RS) – blue (1 when Bull Gate is true and either TF confirms IHS RS).
RS(15m Early) – green.
RS(1H Early) – purple.
Daily SMA Gate Only – orange (1 when above SMA50 and near SMA20).
Daily Lower Bollinger (within %) – teal (1 when within your % threshold of the lower band).
(Each line outputs 1/0 so it works seamlessly in the Pine Screener.)
Inputs
Daily
Daily SMA(50), Daily SMA(20)
Within % of Daily SMA(20)
Use prior completed Daily bar only
Bollinger
Daily BB stdev (below SMA20) (k)
Within % of Daily Lower BB
Pattern (IHS)
IHS Pivot L, IHS Pivot R (pivot window left/right)
Min sep bars L1–L2 & L2–L3
Tolerance: ATR × mult or % of L1
How to use
Screen your watchlist with:
Daily SMA Gate Only = 1, and optionally
Daily Lower Bollinger (within %) = 1, and/or
Combined Signal (15m OR 1H RS) = 1 for setups.
Open the chart to validate structure:
Uptrend context (above Daily 50-SMA).
Clear IHS: head lower than L1, RS near L1 and higher than head, neckline between L1–L3.
Plan execution:
Many traders use the neckline / RS low for risk and look for confirmation on neckline reclaim/break with volume.
Notes & limitations
Pivot-based signals confirm only after R bars (by design); potential pivots can disappear before confirmation.
Multi-timeframe logic: Daily filters + intraday patterns (15m & 1H). Tune L/R, separations, and tolerances per instrument/volatility.
This is a tool, not advice—combine with your risk management and other confluence (levels, volume, catalysts).
Script protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarlo liberamente e senza alcuna limitazione – per saperne di più clicca qui.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarlo liberamente e senza alcuna limitazione – per saperne di più clicca qui.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.