OPEN-SOURCE SCRIPT

Custom Time Frame Background

This indicator allows you to highlight custom time frames on your chart with alternating background colors. It's particularly useful for visualizing specific intervals that are not standard on TradingView, such as 4-hour, 6-hour, or any other custom duration you choose. Features:

Customizable time frames: Set any combination of minutes, hours, and days
Fallback to daily/weekly coloring if no custom time frame is set
User-defined colors for alternating backgrounds

How to use:

Add the indicator to your chart
In the settings, input your desired custom time frame:
Set 'Custom Minutes' for intervals less than an hour
Use 'Custom Hours' for hourly intervals
Use 'Custom Days' for daily intervals
Adjust 'Color 1' and 'Color 2' to your preferred background colors

Examples:

For a 4-hour time frame: Set Custom Hours to 4
For a 6-hour time frame: Set Custom Hours to 6
For a 2-day time frame: Set Custom Days to 2

If all inputs are set to 0, the indicator will default to daily coloring for intraday charts and weekly coloring for higher timeframes. This indicator helps traders visually segment their charts into custom intervals, making it easier to identify patterns and trends over specific time periods.
Candlestick analysisCycleseducationalmulti-timeframeTIMEtimeframe

开源脚本

本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受网站规则约束。 您可以收藏它以在图表上使用。

想在图表上使用此脚本?


更多:

免责声明