OPEN-SOURCE SCRIPT
Support Band of Trend

Support Band of Trend
by MasterTony
**Support Band with Dynamic Ichimoku Boundaries**
This indicator combines three layered tools into a single clean overlay: a trend-adaptive support/resistance band using golden moving averages, dynamic Ichimoku Tenkan/Kijun boundaries, and price pivot S/R levels. Together they define a structured zone where price is expected to find support in bull trends and resistance in bear trends.
---
**How It's Calculated**
**Trend Direction (ADX + 200 SMA)**
The indicator continuously reads market direction using two inputs. The DMI system compares DI+ against DI− to determine which side has directional dominance. The 200-period SMA acts as a tiebreaker when DI+ and DI− are equal. There is no neutral state — the indicator always commits to bull or bear based on whichever side is dominant at that moment.
**Inner Support Band (SMA 20 / EMA 21)**
The core of the indicator is a filled zone between the 20-period Simple Moving Average and the 21-period Exponential Moving Average. Because the SMA and EMA are nearly identical in length but calculated differently, the fill between them defines a tight dynamic zone that price frequently interacts with. In a bull trend the band is green, acting as a floor. In a bear trend it turns red, acting as a ceiling.
**Outer Boundary (Tenkan-Sen / Kijun-Sen Band)**
Wrapping the inner band is a filled zone between the Tenkan-Sen and Kijun-Sen, ported from a full adaptive Ichimoku engine. Both lines use dynamic lengths driven by a volume oscillator (OBV), ATR volatility, and a Chikou trend filter. When conditions are bullish the lengths compress toward their minimums (9 and 20), making the lines react faster. When conditions are bearish the lengths expand toward their maximums (30 and 60), making them slower and more resistant. The Tenkan and Kijun lines themselves are colored teal when Tenkan is above Kijun and purple when below. The filled zone between them matches the overall bull/bear color of the indicator.
**Price Pivot S/R Lines**
The indicator identifies the last three swing highs and swing lows using a 5-bar left/5-bar right pivot calculation. Each level is drawn as a horizontal dashed line extended to the right — red for resistance, green for support. These are static reference points showing where price has previously reversed.
**200 SMA**
Plotted as a light blue reference line. Used internally for trend bias and visually as the macro trend anchor.
---
**How to Read It**
The indicator is designed to be read as a layered zone, not a single line.
When the bands are **green**, the entire filled area from the outer TK boundary down to the inner SMA/EMA band is a **support zone**. Price pulling back into this zone during an uptrend is expected behavior. The tighter the band compression, the stronger the trend.
When the bands are **red**, the same zone becomes **resistance**. Price rallying back up into it during a downtrend is a selling opportunity. A failure to break above the zone confirms bearish continuation.
The **Tenkan/Kijun color** gives you a secondary read. Teal means the fast line is above the slow line — momentum is bullish within the Ichimoku framework. Purple means the fast line has crossed below — momentum has shifted bearish. When the band color and the TK color agree, the signal is stronger.
The **pivot S/R lines** give you price memory. A green pivot level sitting just below the band in a bull trend creates a confluence support cluster. A red pivot level just above the band in a bear trend creates a confluence resistance cluster.
---
**How to Trade With It**
**Bull Trend Pullback Entry**
Wait for the band to be green. Let price pull back into the inner SMA/EMA band or the wider TK zone. Look for a candle reversal or momentum shift back upward while inside the zone. Enter long with a stop below the outer TK boundary. The nearest green pivot S/R line below acts as your invalidation level.
**Bear Trend Rally Entry**
Wait for the band to be red. Let price rally back up into the inner band or TK zone. Look for rejection or a momentum shift downward while inside the zone. Enter short with a stop above the outer TK boundary. The nearest red pivot S/R line above acts as your invalidation level.
**Trend Change Warning**
When the band flips from green to red or red to green, it signals a shift in directional dominance. This is not an immediate entry signal — it is a warning to stop trading in the previous direction and wait for the new color to confirm with a pullback setup.
**Confluence Filter**
The highest probability setups occur when all three layers agree: the band color matches the trade direction, the Tenkan is above Kijun (for longs) or below (for shorts), and a pivot S/R level is nearby providing additional structure.
---
by MasterTony
**Support Band with Dynamic Ichimoku Boundaries**
This indicator combines three layered tools into a single clean overlay: a trend-adaptive support/resistance band using golden moving averages, dynamic Ichimoku Tenkan/Kijun boundaries, and price pivot S/R levels. Together they define a structured zone where price is expected to find support in bull trends and resistance in bear trends.
---
**How It's Calculated**
**Trend Direction (ADX + 200 SMA)**
The indicator continuously reads market direction using two inputs. The DMI system compares DI+ against DI− to determine which side has directional dominance. The 200-period SMA acts as a tiebreaker when DI+ and DI− are equal. There is no neutral state — the indicator always commits to bull or bear based on whichever side is dominant at that moment.
**Inner Support Band (SMA 20 / EMA 21)**
The core of the indicator is a filled zone between the 20-period Simple Moving Average and the 21-period Exponential Moving Average. Because the SMA and EMA are nearly identical in length but calculated differently, the fill between them defines a tight dynamic zone that price frequently interacts with. In a bull trend the band is green, acting as a floor. In a bear trend it turns red, acting as a ceiling.
**Outer Boundary (Tenkan-Sen / Kijun-Sen Band)**
Wrapping the inner band is a filled zone between the Tenkan-Sen and Kijun-Sen, ported from a full adaptive Ichimoku engine. Both lines use dynamic lengths driven by a volume oscillator (OBV), ATR volatility, and a Chikou trend filter. When conditions are bullish the lengths compress toward their minimums (9 and 20), making the lines react faster. When conditions are bearish the lengths expand toward their maximums (30 and 60), making them slower and more resistant. The Tenkan and Kijun lines themselves are colored teal when Tenkan is above Kijun and purple when below. The filled zone between them matches the overall bull/bear color of the indicator.
**Price Pivot S/R Lines**
The indicator identifies the last three swing highs and swing lows using a 5-bar left/5-bar right pivot calculation. Each level is drawn as a horizontal dashed line extended to the right — red for resistance, green for support. These are static reference points showing where price has previously reversed.
**200 SMA**
Plotted as a light blue reference line. Used internally for trend bias and visually as the macro trend anchor.
---
**How to Read It**
The indicator is designed to be read as a layered zone, not a single line.
When the bands are **green**, the entire filled area from the outer TK boundary down to the inner SMA/EMA band is a **support zone**. Price pulling back into this zone during an uptrend is expected behavior. The tighter the band compression, the stronger the trend.
When the bands are **red**, the same zone becomes **resistance**. Price rallying back up into it during a downtrend is a selling opportunity. A failure to break above the zone confirms bearish continuation.
The **Tenkan/Kijun color** gives you a secondary read. Teal means the fast line is above the slow line — momentum is bullish within the Ichimoku framework. Purple means the fast line has crossed below — momentum has shifted bearish. When the band color and the TK color agree, the signal is stronger.
The **pivot S/R lines** give you price memory. A green pivot level sitting just below the band in a bull trend creates a confluence support cluster. A red pivot level just above the band in a bear trend creates a confluence resistance cluster.
---
**How to Trade With It**
**Bull Trend Pullback Entry**
Wait for the band to be green. Let price pull back into the inner SMA/EMA band or the wider TK zone. Look for a candle reversal or momentum shift back upward while inside the zone. Enter long with a stop below the outer TK boundary. The nearest green pivot S/R line below acts as your invalidation level.
**Bear Trend Rally Entry**
Wait for the band to be red. Let price rally back up into the inner band or TK zone. Look for rejection or a momentum shift downward while inside the zone. Enter short with a stop above the outer TK boundary. The nearest red pivot S/R line above acts as your invalidation level.
**Trend Change Warning**
When the band flips from green to red or red to green, it signals a shift in directional dominance. This is not an immediate entry signal — it is a warning to stop trading in the previous direction and wait for the new color to confirm with a pullback setup.
**Confluence Filter**
The highest probability setups occur when all three layers agree: the band color matches the trade direction, the Tenkan is above Kijun (for longs) or below (for shorts), and a pivot S/R level is nearby providing additional structure.
---
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน