Custom Previous High/Low + Breakout Alerts
Feb 25, 2025

The Custom Previous High/Low + Breakout Alerts indicator plots the previous period's high and low levels and provides automated notifications when price breaks either level. It simplifies multi-timeframe analysis by allowing users to monitor key structural levels across different time horizons simultaneously.
Usage
The Usage section describes how to interact with the levels and configure the breakout logic.
- Plotting Levels: By default, the tool displays the previous high and low for a user-selected timeframe. This is used to identify support and resistance from the immediate prior candle of the chosen period (e.g., Daily, 4-Hour).
- Breakout Detection: You can choose between two detection methods:
- Instant: Alerts fire immediately as price touches or crosses the level.
- Wait for Close: Alerts fire only after a candle from a specific "Close Timeframe" closes beyond the level, filtering out minor wicks.
- Multi-Timeframe Monitoring: You can enable up to three additional timeframes for alerts only. While these won't plot lines to keep the chart clean, the indicator will track them in the background and notify you of breaks.
Details
The script uses request.security to fetch historical data from higher timeframes. To ensure accuracy and prevent "alert spam," the logic is designed to trigger only once per period for each level. If price hovers around a high or low, you will not receive duplicate alerts until a new period begins. The indicator also includes a custom getReadableTimeframe function to provide clear, human-readable text in alert messages, such as "1 hour" instead of "60".
Settings
General Settings
- Timeframe for High/Low: The primary timeframe used for both plotting lines and triggering alerts.
- Line Offset: Moves the end of the lines forward by a specific number of bars for better visibility.
- Breakout Detection: Selects between "Instant" or "Wait for Close" logic.
- Close Timeframe: If "Wait for Close" is selected, this determines the candle timeframe that must close past the level.
- Enable Alerts For TF1-TF3: Allows tracking of additional timeframes for background alerting.
High/Low Lines
- Show Previous High/Low Lines: Toggles the visibility of the primary levels.
- High/Low Color/Width/Style: Customizes the visual appearance of the resistance and support lines.
Labels
- Show Labels: Toggles text labels next to the levels.
- Text/Color: Customizes the naming convention (e.g., "Prev High" or "PH") and label colors.
FAQ
How do I set up a breakout alert? To set up an alert, use the TradingView Alert dialog (ALT+A), select "Custom Previous High/Low + Breakout Alerts" as the condition, and choose the "Any alert() function call" option.
Can I monitor more than one timeframe at once? Yes, you can enable up to three additional timeframes in the settings to receive alerts for their respective highs and lows without cluttering your chart with lines.
How do I get access to Custom Previous High/Low + Breakout Alerts? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.