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.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。