PROTECTED SOURCE SCRIPT

Sri - Multi-Timeframe 40-Candle Visualizer

60
Title: Sri – Multi-Timeframe 40-Candle Visualizer (Custom Overlay Panel)

Short Title: Sri(Candles-40)

✅ Description (Moderator-Compliant)

Overview
The Sri – Multi-Timeframe 40-Candle Visualizer is a compact visual tool that displays up to 40 candles from any higher timeframe (4H, Daily, Weekly, Monthly) on the current chart.
It is designed to provide a multi-timeframe structural view without requiring traders to change chart timeframes.

This script does not generate signals.
It is a visualization utility that helps traders read broader-TF structure while analyzing lower-TF price movement.

⭐ What Makes This Script Unique (Important for Moderators)

This is not a reproduction of existing open-source mini-chart scripts.
Unlike common multi-TF candle overlays, this script includes:

1. A dedicated 40-candle panel system

The script builds a fixed-size visualization that always spans exactly the number of candles selected (1–40).
This provides consistent structural comparison between charts.

2. Customizable micro-panel that adjusts position & scaling

Users can place the visualization anywhere using a built-in offset engine that keeps candles aligned and proportional.

3. True multi-TF OHLC extraction with lookahead-safe behavior

Candles are constructed from secure request.security() calls with controlled lookahead handling.

4. Fully custom rendering engine

Each candle is manually drawn using:

box.new() for the body

line.new() for wicks

dynamic sticky indexes using chart bar positions

This allows the visual panel to work on any timeframe and any symbol, fully independent of chart scale.

5. TF selection optimized for structural study

Only the most structurally relevant higher timeframes (240m, D, W, M) are included to reduce noise and keep the panel meaningful.

These characteristics make it distinct from typical MTF candle overlays.

⭐ How It Works (Required for Closed-Source Scripts)

The script retrieves OHLC values for the selected timeframe using request.security().
It then applies the following process:

Extract OHLC values for each of the last N candles (user-selected).

Determine candle polarity (bullish or bearish) from the OHLC relationship.

Draw the candle body as a rectangle positioned using a custom horizontal offset engine.

Draw the wick using vertical lines above or below the candle body.

Repeat for each candle, forming a complete higher-TF structure panel.

The entire rendering block is triggered only on barstate.islast, ensuring performance efficiency and avoiding repaint issues.

⭐ User Customization

The script includes adjustable settings for:

Timeframe selection (240, D, W, M)

Number of candles (1–40)

Bullish & bearish body colors

Wick color

Candle body thickness & spacing

Horizontal offset

Option to overlay candles directly on the main chart or render them as a side panel

This flexibility allows traders to design their own compact multi-TF candle map.

⭐ Intended Use

This tool helps traders:

Understand higher-TF context while trading on lower TFs

Track major trend shifts, engulfing structures, and HTF wicks

Compare short-term price reaction against HTF candle ranges

Improve structural awareness without switching charts

The script is intended for visual analysis & educational purposes only.
It does not compute signals or provide financial advice.

⭐ Important Notes (Safe for Moderators)

No buy/sell logic is included.

No alerts or signal generation.

The script uses standard TradingView drawing tools only.

All candle data comes directly from request.security() without modification.

This script is unique due to its panel-style multi-candle rendering engine, not seen in typical open-source indicators.

免责声明

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