OPEN-SOURCE SCRIPT
Diupdate

PTHLC Previous Timeframe High, Low, and Close

351
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.
Catatan Rilis
*Update*

* Removed PTH/PTL retest logic for a simpler breach-based workflow.
* PTH and PTL now remain neutral until a confirmed closing breach.
* Breached levels automatically change to bullish or bearish colors.
* Increased the default label offset to 7 bars for improved chart readability.
Catatan Rilis
Automatic Higher Timeframe (HTF) Mode

A new Reference Timeframe Mode has been added, allowing you to choose between Auto HTF and Manual operation.

Auto HTF

Automatically selects the next higher timeframe based on the current chart timeframe.
Mapping:
1m → 5m
5m → 15m
15m → 1H
1H → 4H
4H → 1D
1D → 1W
1W → 1M
This provides higher-timeframe market structure without requiring manual timeframe changes.

Manual

Uses the Previous Candle Timeframe selected in the indicator settings.
Ideal for traders who want complete control over the reference timeframe.
PTC Label Enhancement

The PTC label now displays the active reference timeframe used to calculate the previous close.

Example:

PTC 4100 Bearish 1H

This ensures the label always reflects the timeframe that generated the displayed PTC level, whether using Auto HTF or Manual mode.
Catatan Rilis
Updated sweep detection to use actual market highs and lows, allowing wick breaches to remain marked after price retraces, including on Heikin Ashi charts. Reordered the table to display PTH → PTC → PTL.

Pernyataan Penyangkalan

Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.