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
نص برمجي مفتوح المصدر

قام مؤلف هذا النص البرمجي بنشره وجعله مفتوح المصدر، بحيث يمكن للمتداولين فهمه والتحقق منه، وهو الأمر الذي يدخل ضمن قيم TradingView. تحياتنا للمؤلف! يمكنك استخدامه مجانًا، ولكن إعادة استخدام هذا الكود في منشور تحكمه قواعد الموقع. يمكنك جعله مفضلاً لاستخدامه على الرسم البياني.

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.

هل تريد استخدام هذا النص البرمجي على الرسم البياني؟