OPEN-SOURCE SCRIPT

Smooths HTF Mini Chart

614
Overview
The Smooths HTF Mini Chart is a technical utility designed for traders who require constant high-timeframe (HTF) context without sacrificing screen real estate or deal with the "drifting" issues associated with standard drawing objects. By leveraging the Pine Script Table API, this script creates a live candlestick "monitor" that is anchored to the UI layer of the chart, ensuring it stays perfectly positioned in the corner regardless of how a user drags or scales the primary price action.

The Technical Concept (Why it is Original)
Most HTF indicators overlay candles directly onto the main price chart. This presents two problems:

They clutter the primary timeframe's candles.

They are tied to bar indexes; when a user scrolls back in time, the HTF context disappears off-screen.

This script solves this by utilizing Unicode String Rendering. Instead of using box.new or line.new (which are anchored to the time/price axis), this indicator maps price data into a vertical string of characters (█ and ┆) and renders them inside a table.cell. Because tables are part of the chart's fixed UI layer (the "Glass Layer"), the monitor functions like a native dashboard widget that never moves.

Calculations & Underlying Logic
Data Aggregation: The script uses request.security to pull OHLC data from the user-defined HTF.

Dynamic Normalization: Since the widget has a fixed vertical height (Resolution), the script dynamically normalizes the HTF price range within the array to fit the vertical space of the table cell.

Monospace Alignment: By forcing a font.family_monospace, the script ensures that the "wicks" and "bodies" of the Unicode candles stay mathematically centered and symmetrical.

Usefulness for Traders
Scalping Context: A 1-minute trader can monitor the 15-minute or 1-hour trend without switching tabs or cluttering their workspace.

Persistent Visibility: Essential for traders who zoom in and out frequently; the HTF trend is always visible in the top-right corner.

Customizable UI: Users can adjust the "Vertical Resolution" to change the widget's height and toggle "Horizontal Spacing" to fit their specific screen layout.

Instructions for Use
HTF Timeframe: Choose the timeframe you wish to monitor.

Vertical Resolution: Increase for more detail in the candles, decrease for a more compact widget.

Position: Use the inputs to move the widget to any of the four corners of your screen.

免责声明

这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。