OPEN-SOURCE SCRIPT
ที่อัปเดต: Manual Candle ID Trendlines x20 + Channels x10 + BO/BD

# Manual Candle ID Trendlines & Adaptive Channels
This indicator allows traders to manually build precise trendlines and parallel channels by selecting candle IDs instead of relying on automatic pivot detection. It is designed for traders who prefer complete control over their market structure analysis while avoiding the inconsistencies of automatic algorithms.
Unlike traditional trendline tools that depend on pivot settings or swing detection, this script lets you anchor each trendline directly to the exact candle wicks you choose. This makes it suitable for discretionary technical analysis where the trader decides which market structure is important.
## Features
• Up to **20 independent manual trendlines**
* Connect any two candle highs or lows.
* Trendlines automatically extend a user-defined number of candles into the future.
* Individual enable/disable controls.
* Separate colors for high and low trendlines.
• Up to **10 parallel price channels**
* Each channel is constructed from **two manually selected lows** that define the channel slope and **one manually selected high** that determines the channel width.
* Optional channel midline.
* Channels automatically extend forward as new candles appear.
• **Live channel target projection**
For every enabled channel the script continuously calculates where the current candle would intersect the channel.
* Bullish candles display the projected upper channel target.
* Bearish candles display the projected lower channel target.
* Doji candles display the channel midpoint.
Optional price labels and a live summary table can display these projected target levels.
• **Breakout (BO) and Breakdown (BD) detection**
The script can generate signals whenever price crosses an enabled channel boundary.
* BO = Close crosses above the upper channel line.
* BD = Close crosses below the lower channel line.
Signals can be generated either:
* after candle close (default), or
* intrabar for traders who prefer earlier notifications.
Alert conditions are included for both BO and BD events.
## How the calculations work
Trendlines are calculated using the selected candle coordinates. The script computes the slope between the two anchor candles and projects that slope forward for the specified extension length.
Channels use the same manually defined slope from the two selected lows. The selected high determines the vertical offset, producing a parallel upper boundary while maintaining identical slope. A midpoint is then calculated between the two boundaries.
The live target feature continuously evaluates the current candle against the projected channel values to estimate the next interaction level.
## Typical uses
* Manual support and resistance analysis
* Trendline validation
* Building custom trend channels
* Planning breakout and breakdown trades
* Estimating dynamic price targets within channels
* Creating discretionary trading plans without relying on automatic pivot algorithms
## Notes
This indicator is intended as a discretionary charting tool. It does not automatically identify swing points or draw trendlines. The quality of the analysis depends on the trader's choice of anchor candles.
BO and BD signals simply indicate that price crossed an enabled channel boundary. They are not standalone buy or sell recommendations and should be combined with additional market context and risk management.
This indicator allows traders to manually build precise trendlines and parallel channels by selecting candle IDs instead of relying on automatic pivot detection. It is designed for traders who prefer complete control over their market structure analysis while avoiding the inconsistencies of automatic algorithms.
Unlike traditional trendline tools that depend on pivot settings or swing detection, this script lets you anchor each trendline directly to the exact candle wicks you choose. This makes it suitable for discretionary technical analysis where the trader decides which market structure is important.
## Features
• Up to **20 independent manual trendlines**
* Connect any two candle highs or lows.
* Trendlines automatically extend a user-defined number of candles into the future.
* Individual enable/disable controls.
* Separate colors for high and low trendlines.
• Up to **10 parallel price channels**
* Each channel is constructed from **two manually selected lows** that define the channel slope and **one manually selected high** that determines the channel width.
* Optional channel midline.
* Channels automatically extend forward as new candles appear.
• **Live channel target projection**
For every enabled channel the script continuously calculates where the current candle would intersect the channel.
* Bullish candles display the projected upper channel target.
* Bearish candles display the projected lower channel target.
* Doji candles display the channel midpoint.
Optional price labels and a live summary table can display these projected target levels.
• **Breakout (BO) and Breakdown (BD) detection**
The script can generate signals whenever price crosses an enabled channel boundary.
* BO = Close crosses above the upper channel line.
* BD = Close crosses below the lower channel line.
Signals can be generated either:
* after candle close (default), or
* intrabar for traders who prefer earlier notifications.
Alert conditions are included for both BO and BD events.
## How the calculations work
Trendlines are calculated using the selected candle coordinates. The script computes the slope between the two anchor candles and projects that slope forward for the specified extension length.
Channels use the same manually defined slope from the two selected lows. The selected high determines the vertical offset, producing a parallel upper boundary while maintaining identical slope. A midpoint is then calculated between the two boundaries.
The live target feature continuously evaluates the current candle against the projected channel values to estimate the next interaction level.
## Typical uses
* Manual support and resistance analysis
* Trendline validation
* Building custom trend channels
* Planning breakout and breakdown trades
* Estimating dynamic price targets within channels
* Creating discretionary trading plans without relying on automatic pivot algorithms
## Notes
This indicator is intended as a discretionary charting tool. It does not automatically identify swing points or draw trendlines. The quality of the analysis depends on the trader's choice of anchor candles.
BO and BD signals simply indicate that price crossed an enabled channel boundary. They are not standalone buy or sell recommendations and should be combined with additional market context and risk management.
Release Note
### UpdateThis update significantly expands the indicator's flexibility for discretionary chart analysis.
**New features:**
* Added **Open** and **Close** as additional anchor sources alongside **High (Wicks)** and **Low (Wicks)**, allowing trendlines to be built from candle bodies instead of wick extremes.
* Added **trendline naming**, making it easier to organize multiple manually drawn structures.
* Added **hover dots** at the end of every trendline that display the assigned trendline name.
* Added **channel naming** with hover dots, allowing each channel to be identified without cluttering the chart.
* Added **20 manual horizontal price levels**, each featuring:
* Enable/disable toggle
* User-defined price
* Custom name
* Hover dot displaying the assigned level name
* Improved support for running **multiple instances of the indicator** on the same chart. You can now dedicate separate instances to different analysis styles, for example:
* Wick-based market structure
* Candle-body trendlines
* Macro trend channels
* Intraday structure
* Key horizontal levels
These additions make the indicator suitable for maintaining a complete discretionary chart layout while keeping all manually defined structures organized and easily identifiable.
Release Note
uสคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน