OPEN-SOURCE SCRIPT
Gold Trap Hunter (Auto-Structure & Liquidity Sweeps)

The Concept: Stop Getting Trapped Have you ever bought a breakout, only to watch the price immediately reverse and hit your stop loss? This is called a Liquidity Trap (or "Sweep"). Institutional algorithms often push price slightly above a key High or below a key Low to trigger retail stop losses before moving the market in the real direction.
The Universal Trap Hunter is designed to visualize this market structure automatically. It helps you avoid "Fake Breakouts" and identifies high-probability Reversal points where the "Smart Money" is active.
How It Works (The Logic)
1. The Structure Boxes (The Battlefield) The indicator draws a shaded box representing the Higher Timeframe Structure.
Green Box: The market structure is Bullish (Making Higher Highs). We are looking for longs.
Red Box: The market structure is Bearish (Making Lower Lows). We are looking for shorts.
Feature: This is Universal. If you are on the 15-minute chart, it automatically calculates the 4-Hour structure for you. You are always trading with the bigger trend.
2. The "SWEEP" Signal (The Entry Trigger) A "Sweep" is the most powerful signal in this system.
What is it? Price breaks a previous structure High/Low but fails to close there. It grabs the liquidity and reverses.
⚔️ Green Sweep: Price broke the previous Low (trapping sellers), then closed back UP inside the range. This is a bullish reversal signal.
⚔️ Red Sweep: Price broke the previous High (trapping buyers), then closed back DOWN inside the range. This is a bearish reversal signal.
3. The Noise Filter (Gray Candles) Trading is about knowing when NOT to trade.
Gray Candles: These indicate "Noise." The price action is choppy or conflicting with the trend.
Colored Candles: The candles only turn Green or Red when the Trend, Momentum, and Structure all align. If you see color, the move is valid.
Settings & Customization
Structure Mode (Auto vs Manual):
Auto (Recommended): The script automatically selects the best Higher Timeframe for you.
Scalping 1m? → It looks at 1H Structure.
Trading 15m? → It looks at 4H Structure.
Manual: You can lock it to a specific timeframe (e.g., always show Daily structure).
Colors: Fully customizable to fit your dark/light theme.
How to Trade This Strategy
Identify the Trend: Look at the background Box color (Green = Bullish, Red = Bearish).
Wait for the Trap: Do not chase the price. Wait for price to challenge the edge of the box.
The Signal: Look for the "⚔️ SWEEP" label.
If the box is Green and you see a Green Sweep at the bottom: Strong Buy.
If the box is Red and you see a Red Sweep at the top: Strong Sell.
Disclaimer: This tool is for educational purposes and market analysis only. It helps visualize market structure and liquidity traps but does not guarantee future results. Always manage your risk.
The Universal Trap Hunter is designed to visualize this market structure automatically. It helps you avoid "Fake Breakouts" and identifies high-probability Reversal points where the "Smart Money" is active.
How It Works (The Logic)
1. The Structure Boxes (The Battlefield) The indicator draws a shaded box representing the Higher Timeframe Structure.
Green Box: The market structure is Bullish (Making Higher Highs). We are looking for longs.
Red Box: The market structure is Bearish (Making Lower Lows). We are looking for shorts.
Feature: This is Universal. If you are on the 15-minute chart, it automatically calculates the 4-Hour structure for you. You are always trading with the bigger trend.
2. The "SWEEP" Signal (The Entry Trigger) A "Sweep" is the most powerful signal in this system.
What is it? Price breaks a previous structure High/Low but fails to close there. It grabs the liquidity and reverses.
⚔️ Green Sweep: Price broke the previous Low (trapping sellers), then closed back UP inside the range. This is a bullish reversal signal.
⚔️ Red Sweep: Price broke the previous High (trapping buyers), then closed back DOWN inside the range. This is a bearish reversal signal.
3. The Noise Filter (Gray Candles) Trading is about knowing when NOT to trade.
Gray Candles: These indicate "Noise." The price action is choppy or conflicting with the trend.
Colored Candles: The candles only turn Green or Red when the Trend, Momentum, and Structure all align. If you see color, the move is valid.
Settings & Customization
Structure Mode (Auto vs Manual):
Auto (Recommended): The script automatically selects the best Higher Timeframe for you.
Scalping 1m? → It looks at 1H Structure.
Trading 15m? → It looks at 4H Structure.
Manual: You can lock it to a specific timeframe (e.g., always show Daily structure).
Colors: Fully customizable to fit your dark/light theme.
How to Trade This Strategy
Identify the Trend: Look at the background Box color (Green = Bullish, Red = Bearish).
Wait for the Trap: Do not chase the price. Wait for price to challenge the edge of the box.
The Signal: Look for the "⚔️ SWEEP" label.
If the box is Green and you see a Green Sweep at the bottom: Strong Buy.
If the box is Red and you see a Red Sweep at the top: Strong Sell.
Disclaimer: This tool is for educational purposes and market analysis only. It helps visualize market structure and liquidity traps but does not guarantee future results. Always manage your risk.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.