OPEN-SOURCE SCRIPT
PTHLC Previous Timeframe High, Low, and Close

PTHLC — Previous Timeframe High, Low, and Close
PTHLC is a multi-timeframe market-structure indicator that displays the previous completed candle’s high, low, and close from a user-selected timeframe.
Unlike standard previous-day indicators, PTHLC can be applied to intraday or higher timeframes, making it useful for tracking levels from the previous 15-minute, 1-hour, 4-hour, daily, or other selected candle.
Major Features
Previous Timeframe Levels
The indicator plots:
PTH — Previous Timeframe High
PTL — Previous Timeframe Low
PTC — Previous Timeframe Close
The levels are based on the previous fully completed candle to provide stable, non-repainting reference points.
Automatic Timeframe Adjustment
When the selected reference timeframe is lower than the chart timeframe, the indicator automatically uses the chart timeframe instead of producing an error.
This allows the script to remain active as traders move between chart timeframes.
Confirmed Breach Detection
PTH and PTL are considered breached only after price closes beyond the level.
A close above PTH confirms a high breach.
A close below PTL confirms a low breach.
Breached levels are visually distinguished from active levels.
Bullish and Bearish Retest Logic
After a confirmed breach, PTHLC tracks the first return to the level.
A retest that closes above the level is classified as Retest Bullish.
A retest that closes below the level is classified as Retest Bearish.
The line, label, and table status update to reflect the retest direction.
Directional Previous Close
PTC provides immediate directional context:
Bullish when price is above PTC
Bearish when price is below PTC
Neutral when price is at PTC
PTC logic remains separate from the breach and retest logic used for PTH and PTL.
What Makes PTHLC Unique
Most previous-level indicators only plot static support and resistance lines.
PTHLC adds a complete level-state framework:
Active → Breached → Bullish or Bearish Retest
This helps traders quickly identify whether a previous timeframe level is untouched, broken, successfully held, or rejected after a retest.
PTHLC is designed for traders who use multi-timeframe structure, liquidity levels, breakout confirmation, support-and-resistance flips, and retest-based directional bias.
This indicator is intended as a market-analysis tool and does not provide guaranteed trade signals.
PTHLC is a multi-timeframe market-structure indicator that displays the previous completed candle’s high, low, and close from a user-selected timeframe.
Unlike standard previous-day indicators, PTHLC can be applied to intraday or higher timeframes, making it useful for tracking levels from the previous 15-minute, 1-hour, 4-hour, daily, or other selected candle.
Major Features
Previous Timeframe Levels
The indicator plots:
PTH — Previous Timeframe High
PTL — Previous Timeframe Low
PTC — Previous Timeframe Close
The levels are based on the previous fully completed candle to provide stable, non-repainting reference points.
Automatic Timeframe Adjustment
When the selected reference timeframe is lower than the chart timeframe, the indicator automatically uses the chart timeframe instead of producing an error.
This allows the script to remain active as traders move between chart timeframes.
Confirmed Breach Detection
PTH and PTL are considered breached only after price closes beyond the level.
A close above PTH confirms a high breach.
A close below PTL confirms a low breach.
Breached levels are visually distinguished from active levels.
Bullish and Bearish Retest Logic
After a confirmed breach, PTHLC tracks the first return to the level.
A retest that closes above the level is classified as Retest Bullish.
A retest that closes below the level is classified as Retest Bearish.
The line, label, and table status update to reflect the retest direction.
Directional Previous Close
PTC provides immediate directional context:
Bullish when price is above PTC
Bearish when price is below PTC
Neutral when price is at PTC
PTC logic remains separate from the breach and retest logic used for PTH and PTL.
What Makes PTHLC Unique
Most previous-level indicators only plot static support and resistance lines.
PTHLC adds a complete level-state framework:
Active → Breached → Bullish or Bearish Retest
This helps traders quickly identify whether a previous timeframe level is untouched, broken, successfully held, or rejected after a retest.
PTHLC is designed for traders who use multi-timeframe structure, liquidity levels, breakout confirmation, support-and-resistance flips, and retest-based directional bias.
This indicator is intended as a market-analysis tool and does not provide guaranteed trade signals.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.