Eyemaginative

Gap Trend Lines by @eyemaginative

Eyemaginative 업데이트됨   
Summary:
The "Gap Trend Lines" script is designed to identify and visualize gaps between the close of one candle and the opening of the next on a TradingView chart. It draws extended trend lines to visually connect these gaps, helping traders to identify significant price movements between consecutive candles.

Functionality:
Indicator Setup:
The script is set as an overlay indicator on the main chart.
It includes settings for maximum line and label counts, ensuring efficient performance.
Parameter Customization:
Gap Threshold: Defines the minimum gap size considered significant.
Line Colors: Allows customization of colors for small and large gaps.
Line Thickness and Style: Provides options to adjust the thickness and style (solid, dotted, dashed) of the trend lines.

Drawing Extended Trend Lines:

For each bar (candlestick) on the chart, the script checks if there is a gap between the previous candle's close and the current candle's open.
If a gap is detected (i.e., close != open), it determines the size of the gap.
Depending on the size relative to the defined threshold, it selects the appropriate color (small or large gap).
It then draws an extended trend line that starts from the close of the previous candle (bar_index, close) and extends to the open of the current candle (bar_index, open).
The trend line is drawn with the specified thickness, color, and style.

Dynamic Line Attribute Changes:

The script includes a function (changeLineAttributes()) that periodically changes the color and style of the trend lines.
By default, it changes the color every 4 hours (adjustable), alternating between green and the original color.

Enhanced Functionality:

Handles both small and large gaps with different visual cues (colors).
Supports extended trend lines that span both past and future directions (extend=extend.both), ensuring visibility across the entire chart.

Usage:

Traders can use the "Gap Trend Lines" script to:
Identify and analyze gaps between candlesticks.
Visualize significant price movements or breaks in continuity.
Customize the appearance of trend lines for better clarity and analysis.

By utilizing this script, traders can gain insights into price gap dynamics directly on TradingView charts, aiding in decision-making and strategy development.
릴리즈 노트:
Update: This script now includes input parameters for customizing the color and style of lines that change every 4 hours. The default values for these parameters are green for color and dotted for style, but you can customize them as needed.

Summary:
The "Gap Trend Lines" script is designed to identify and visualize gaps between the close of one candle and the opening of the next on a TradingView chart. It draws extended trend lines to visually connect these gaps, helping traders to identify significant price movements between consecutive candles.

Functionality:
Indicator Setup:
The script is set as an overlay indicator on the main chart.
It includes settings for maximum line and label counts, ensuring efficient performance.
Parameter Customization:
Gap Threshold: Defines the minimum gap size considered significant.
Line Colors: Allows customization of colors for small and large gaps.
Line Thickness and Style: Provides options to adjust the thickness and style (solid, dotted, dashed) of the trend lines.

Drawing Extended Trend Lines:

For each bar (candlestick) on the chart, the script checks if there is a gap between the previous candle's close and the current candle's open.
If a gap is detected (i.e., close != open), it determines the size of the gap.
Depending on the size relative to the defined threshold, it selects the appropriate color (small or large gap).
It then draws an extended trend line that starts from the close of the previous candle (bar_index, close) and extends to the open of the current candle (bar_index, open).
The trend line is drawn with the specified thickness, color, and style.

Dynamic Line Attribute Changes:

The script includes a function (changeLineAttributes()) that periodically changes the color and style of the trend lines.
By default, it changes the color every 4 hours (adjustable), alternating between green and the original color.

Enhanced Functionality:

Handles both small and large gaps with different visual cues (colors).
Supports extended trend lines that span both past and future directions (extend=extend.both), ensuring visibility across the entire chart.

Usage:

Traders can use the "Gap Trend Lines" script to:
Identify and analyze gaps between candlesticks.
Visualize significant price movements or breaks in continuity.
Customize the appearance of trend lines for better clarity and analysis.

By utilizing this script, traders can gain insights into price gap dynamics directly on TradingView charts, aiding in decision-making and strategy development.
릴리즈 노트:
Updated Indicator Image, No Script Update
릴리즈 노트:
Changed Sample Image, No Script Change
릴리즈 노트:
NOTE: There still exists an issue when refreshing browser where the script will need removed and readded due to a compile error. It compiles initially and will function until a refresh. I will resolve this in a future update.

Changes Made in this Release:
Added Independent Customization:

Added separate customization for small and large gaps, including line thickness and style.
Parameters for old gap customization included color, thickness, and style.
Dynamic Deletion of Lines:

Ensured delete_all_lines() function only deletes lines when necessary to avoid compilation issues upon refresh.
Error Handling:

Checked if trendLines array is empty before performing operations on it, preventing out-of-bounds errors.
Refined Periodic Change Function:

Added more granular control over the appearance of lines older than 4 hours, allowing customization from the input parameters.

This version ensures the script dynamically updates on changes and prevents issues with array bounds, providing robust functionality for identifying and visualizing price gaps.

Key Features:
Gap Detection: Identifies gaps where the close price of one candle is different from the open price of the next.

Line Drawing: Draws extended trend lines between these gaps, with customizable colors, thicknesses, and styles based on the gap size.

Periodic Change: Changes the color and style of lines that are older than 4 hours, with customizable parameters.

Dynamic Updates: Ensures the script updates dynamically when the gap threshold changes.

Customization Parameters:
Gap Threshold: Determines the size of gaps to be considered.

Small Gaps: Customizable color, thickness, and style for lines representing small gaps.
Large Gaps: Customizable color, thickness, and style for lines representing large gaps.
Old Gaps: Customizable color, thickness, and style for lines older than 4 hours.

Functions:
get_line_style(): Converts string input to the corresponding line style.
delete_all_lines(): Deletes all existing lines to prevent accumulation on parameter changes.
changeLineAttributes(): Changes the appearance of lines older than 4 hours based on specified intervals.
릴리즈 노트:
Preventing Large Gap Lines from Becoming Old Gap Lines:

Initially, the script was treating all gap lines that persisted beyond a certain age as old gap lines. This included both small and large gap lines.

To differentiate between large and old gap lines, we modified the condition in the changeLineAttributes function. Now, only lines categorized as small gaps are allowed to age into old gap lines. Large gap lines retain their original attributes without turning into old gap lines.

Adding Hidden Line Options in Input Settings:

Three checkboxes were added to the input settings: Hide Small Gaps, Hide Large Gaps, and Hide Old Gaps.

Each checkbox allows the user to toggle the visibility of specific types of gap trend lines independently.

The update_visibility function was updated to read these settings and adjust the visibility of lines accordingly. Lines are hidden based on their type (small, large, or old) and whether the respective checkbox is checked.

These changes enable more flexible control over which types of gap trend lines are displayed on the chart, improving usability and customization options for the indicator.
오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?