PROTECTED SOURCE SCRIPT
已更新 Sharp Pullback/Profit Taking Detector (ATH)

SP_ATH Alert: Early Warning for Gold Pullbacks
Tired of being caught by sharp profit-taking when Gold hits a new All-Time High?
The Sharp Pullback / Profit Taking Detector (SP_ATH Alert) is a powerful Pine Script V5 indicator designed to give you an early warning signal before a rapid market reversal (pullback or significant profit-taking) occurs. It specifically focuses on identifying the critical confluence of weak buying momentum and aggressive selling pressure near recent price peaks.
How the Code Works: A Triple-Filter System
This indicator combines three primary technical analysis categories to filter out noise and generate high-confidence signals:
1. Candlestick Confirmation (The First Clues)
This section detects immediate bearish intent on the chart:
Bearish Pin Bar (Shooting Star): Checks for a long Upper Wick (seller rejection) and a small body, signaling that buyers attempted to push the price up but were immediately overwhelmed by sellers.
Bearish Engulfing: Identifies a large red candle whose body completely engulfs the preceding green candle's body. This represents a clear, aggressive shift in momentum from buying to selling dominance.
2. Price Action & Context Filter (The Warning Signs)
The indicator ensures the pattern occurs in a high-risk, high-reward environment:
Near All-Time High (isNearATH): The signal is only valid if the price is trading near a recent price peak (defined by the athLookback period), where profit-taking is most likely to be severe.
Large Red Bar: Confirms the signal by looking for an aggressive bearish bar whose total range is significantly larger than the average market movement (using ATR).
Weak Higher High (isWeakHH): Detects Exhaustion by identifying a new high with a disproportionately small candle body relative to its upper wick, indicating buyers are losing conviction.
3. Momentum & Indicator Signals (The Undercurrent)
The script uses the RSI (Relative Strength Index) to confirm weakening momentum:
RSI Bearish Divergence: Compares recent price pivots (Higher Highs) with RSI pivots (Lower Highs). This classic signal confirms that the buying momentum is fading, even though the price is still ticking higher.
RSI Breakdown: Triggers when the RSI was previously in the Overbought Zone (above 70) and now breaks down below the 70 level and crosses below its own Exponential Moving Average (EMA), confirming the start of bearish momentum.
Invitation to Use
By requiring a combination of these factors, the SP_ATH Alert provides a robust, multi-layered alert system. Add this indicator to your Gold (XAUUSD) chart on a lower timeframe (e.g., 10-minute or 15-minute) to proactively manage risk and identify potential short entry points during periods of extreme bullish euphoria.
Tired of being caught by sharp profit-taking when Gold hits a new All-Time High?
The Sharp Pullback / Profit Taking Detector (SP_ATH Alert) is a powerful Pine Script V5 indicator designed to give you an early warning signal before a rapid market reversal (pullback or significant profit-taking) occurs. It specifically focuses on identifying the critical confluence of weak buying momentum and aggressive selling pressure near recent price peaks.
How the Code Works: A Triple-Filter System
This indicator combines three primary technical analysis categories to filter out noise and generate high-confidence signals:
1. Candlestick Confirmation (The First Clues)
This section detects immediate bearish intent on the chart:
Bearish Pin Bar (Shooting Star): Checks for a long Upper Wick (seller rejection) and a small body, signaling that buyers attempted to push the price up but were immediately overwhelmed by sellers.
Bearish Engulfing: Identifies a large red candle whose body completely engulfs the preceding green candle's body. This represents a clear, aggressive shift in momentum from buying to selling dominance.
2. Price Action & Context Filter (The Warning Signs)
The indicator ensures the pattern occurs in a high-risk, high-reward environment:
Near All-Time High (isNearATH): The signal is only valid if the price is trading near a recent price peak (defined by the athLookback period), where profit-taking is most likely to be severe.
Large Red Bar: Confirms the signal by looking for an aggressive bearish bar whose total range is significantly larger than the average market movement (using ATR).
Weak Higher High (isWeakHH): Detects Exhaustion by identifying a new high with a disproportionately small candle body relative to its upper wick, indicating buyers are losing conviction.
3. Momentum & Indicator Signals (The Undercurrent)
The script uses the RSI (Relative Strength Index) to confirm weakening momentum:
RSI Bearish Divergence: Compares recent price pivots (Higher Highs) with RSI pivots (Lower Highs). This classic signal confirms that the buying momentum is fading, even though the price is still ticking higher.
RSI Breakdown: Triggers when the RSI was previously in the Overbought Zone (above 70) and now breaks down below the 70 level and crosses below its own Exponential Moving Average (EMA), confirming the start of bearish momentum.
Invitation to Use
By requiring a combination of these factors, the SP_ATH Alert provides a robust, multi-layered alert system. Add this indicator to your Gold (XAUUSD) chart on a lower timeframe (e.g., 10-minute or 15-minute) to proactively manage risk and identify potential short entry points during periods of extreme bullish euphoria.
發行說明
Change iCon Size發行說明
The core modification addresses the condition for identifying the price context, changing it from a strict All-Time High (ATH) match to a flexible Percentage Range from ATH. This allows the indicator to trigger signals not just at the absolute peak, but also during the crucial phase when the price is near the peak and profit-taking is imminent.受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由且不受任何限制地使用它 — 在此處了解更多資訊。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由且不受任何限制地使用它 — 在此處了解更多資訊。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。