clocks156t174

TrendLine Channels

Abstract
This script provides a set of Trendline Channels which can be tighter than Donchian Channels.
This script computes the most suitable active upper and lower trendlines and updates them as soon as possible.
We can use it for breakout signals earlier than Donchian Channels.

Introduction
Channels are tools which can mark area of values of ranging markets.
Once the price leaves the original region, range traders may start admitting they are wrong and trigger trend.
Donchian Channels (misheard as Dungeon Channels) use the highest and the lowest price to define area of values.
When the price breakouts, it just like it got released from a dungeon.
However, waiting for the price making even higher or lower may be too late and risk reward ratio may be lower.
Trendlines can make the channels tighter and we can find earlier breakout signals.

Computing Trendline Channels
(1) Find the most active trendlines
In this script, a valid trendline connects two high values or two low values.
A high value means the highest value in a trading day.
A low value means the lowest value in a trading day.
In this script, every trendline does not crossover any bar but can exactly touch them.
The most flat trendline is taken. (one for upper and one for lower)
(2) Continue to use or Change a trendline
If there is a tighter trendline available, this script changes to use it.
If the previous active trendline is broken, this script re-computes the trendline available.
When this case happens, this script display with an another color.
Otherwise, this script continues using the previous trendline.
(3) Middle line
The middle line indicates the middle value between the upper and the lower.

Parameters
Length : how many days are used for computation. The default value is 16 just because 16=4*4, using binary characteristic.
x_go_on : If the previous trendline is not breakout and there are no tighter trendlines available, we continue use it.

Color Options
(1) Upper trendline (no update or tighter)
(2) Upper trendline (changed due to breakout)
(3) Middle line
(4) Lower trendline (no update or tighter)
(5) Lower trendline (changed due to breakout)

Conclusion
Trendline Channels can be tighter than Donchian Channels and evaluate earlier breakout signals.
Comparing to known auto trendline scripts, Trendline Channels is continuous.
Once a trendline is broken, Trendline Channels can instantly point out the next available one.
If you think the price movement is boring or you cannot have good risk reward ratio, you can go to an another timeframe.

Reference
How to trade with Donchian Channels
How to trade with Trendlines
Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?