PROTECTED SOURCE SCRIPT
Cập nhật 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)
Phát hành các Ghi chú
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)
Phát hành các Ghi chú
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)
Mã được bảo vệ
Tập lệnh này được đăng dưới dạng mã nguồn đóng. Tuy nhiên, bạn có thể tự do sử dụng tập lệnh mà không có bất kỳ hạn chế nào – tìm hiểu thêm tại đây.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã được bảo vệ
Tập lệnh này được đăng dưới dạng mã nguồn đóng. Tuy nhiên, bạn có thể tự do sử dụng tập lệnh mà không có bất kỳ hạn chế nào – tìm hiểu thêm tại đây.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.