PROTECTED SOURCE SCRIPT
已更新 Alert on Price Close Above/Below

Overview
This indicator sends alerts when a candle closes above or below a user-defined price level on a chosen timeframe. Unlike standard price alerts that can trigger mid-candle, this script confirms on bar close, making it more reliable for breakout/breakdown use cases.
How it works
- Select the evaluation timeframe (e.g., 15m, 1H, 4H).
- Set a Primary Level and choose the direction (Above or Below).
- Optionally enable a Secondary Level with its own direction.
- The alert triggers only when the chosen timeframe’s candle closes beyond your level(s).
- Dynamic alert messages include the timeframe and can optionally include the exact closing price.
Alert message style
1. Dynamic alerts (when you choose “Any alert() function call”) use this format:
2. With “Show exact close price” enabled, messages append the actual close:
Setup steps
1. Add the indicator to your chart on the symbol/timeframe you want to monitor.
2. Open the settings:
- Set “Evaluate On Timeframe” (this is the timeframe used to confirm closes).
- Choose “Primary Direction” (Above/Below) and enter the “Primary Level.”
- Optional: enable and configure the Secondary Level (direction + price).
3. Create a TradingView alert:
- Click the Alert button in the top toolbar.
- In “Condition,” pick this indicator and select “Any alert() function call” to receive dynamic messages.
- In “Interval,” select the timeframe same as the indicator.
- Optional: rename the alert for clarity.
4. Save. You’ll receive alerts when conditions are met.
Examples
This indicator sends alerts when a candle closes above or below a user-defined price level on a chosen timeframe. Unlike standard price alerts that can trigger mid-candle, this script confirms on bar close, making it more reliable for breakout/breakdown use cases.
How it works
- Select the evaluation timeframe (e.g., 15m, 1H, 4H).
- Set a Primary Level and choose the direction (Above or Below).
- Optionally enable a Secondary Level with its own direction.
- The alert triggers only when the chosen timeframe’s candle closes beyond your level(s).
- Dynamic alert messages include the timeframe and can optionally include the exact closing price.
Alert message style
1. Dynamic alerts (when you choose “Any alert() function call”) use this format:
{TF} {TICKER} Close Above {Price}
{TF} {TICKER} Close Below {Price}
2. With “Show exact close price” enabled, messages append the actual close:
{TF} {TICKER} Close Above {Price} (Close={ActualClose})
Setup steps
1. Add the indicator to your chart on the symbol/timeframe you want to monitor.
2. Open the settings:
- Set “Evaluate On Timeframe” (this is the timeframe used to confirm closes).
- Choose “Primary Direction” (Above/Below) and enter the “Primary Level.”
- Optional: enable and configure the Secondary Level (direction + price).
3. Create a TradingView alert:
- Click the Alert button in the top toolbar.
- In “Condition,” pick this indicator and select “Any alert() function call” to receive dynamic messages.
- In “Interval,” select the timeframe same as the indicator.
- Optional: rename the alert for clarity.
4. Save. You’ll receive alerts when conditions are met.
Examples
4H BTCUSDT Close Above 100000
1H ETHUSDT Close Below 4000 (Close=3900)
發行說明
OverviewThis indicator sends alerts when a candle closes above or below a user-defined price level on a chosen timeframe. Unlike standard price alerts that can trigger mid-candle, this script confirms on bar close, making it more reliable for breakout/breakdown use cases.
How it works
- Select the evaluation timeframe (e.g., 15m, 1H, 4H).
- Set a Primary Level and choose the direction (Above or Below).
- Optionally enable a Secondary Level with its own direction.
- The alert triggers only when the chosen timeframe’s candle closes beyond your level(s).
- Dynamic alert messages include the timeframe and can optionally include the exact closing price.
Alert message style
1. Dynamic alerts (when you choose “Any alert() function call”) use this format:
{TF} {TICKER} Close Above {Price}
{TF} {TICKER} Close Below {Price}
2. With “Show exact close price” enabled, messages append the actual close:
{TF} {TICKER} Close Above {Price} (Close={ActualClose})
Setup steps
1. Add the indicator to your chart on the symbol/timeframe you want to monitor.
2. Open the settings:
- Set “Evaluate On Timeframe” (this is the timeframe used to confirm closes).
- Choose “Primary Direction” (Above/Below) and enter the “Primary Level.”
- Optional: enable and configure the Secondary Level (direction + price).
3. Create a TradingView alert:
- Click the Alert button in the top toolbar.
- In “Condition,” pick this indicator and select “Any alert() function call” to receive dynamic messages.
- In “Interval,” select the timeframe same as the indicator.
- Optional: rename the alert for clarity.
4. Save. You’ll receive alerts when conditions are met.
Examples
4H BTCUSDT Close Above 100000
1H ETHUSDT Close Below 4000 (Close=3900)
發行說明
Open+Close Confirmation ModeAdded a new option: Open+Close mode.
In this mode, an alert will only trigger if both the opening price and the closing price of the candle are above/below your chosen level.
This provides a stronger breakout confirmation by filtering out candles that only “wick” above or below but fail to sustain the move.
Example
Close Only mode:
4H BTCUSDT opens at 99,000, closes at 101,000, level = 100,000
✅ Alert triggers (close above 100,000)
Open+Close mode:
4H BTCUSDT opens at 99,000, closes at 101,000, level = 100,000
❌ No alert (open was below 100,000)
✅ Alert only triggers if both open ≥ 100,000 and close ≥ 100,000
Alert Messages
Close Only → 4H BTCUSDT Close Above 100,000 (Close=101,000)
Open+Close → 4H BTCUSDT Open+Close Above 100,000 (Close=101,000)
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由且不受任何限制地使用它 — 在此處了解更多資訊。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由且不受任何限制地使用它 — 在此處了解更多資訊。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。