PROTECTED SOURCE SCRIPT
SuperTrend - Dynamic Lines and Channels

SuperTrend Indicator: Comprehensive Description
Overview
The SuperTrend indicator is Pine Script V6 designed for TradingView to plot dynamic trend lines & channels across multiple timeframes (Daily, Weekly, Monthly, Quarterly, and Yearly/All-Time) to assist traders in identifying potential support, resistance, and trend continuation levels. The script calculates trendlines based on high and low prices over specified periods, projects these trendlines forward, and includes optional reflection channels and heartlines to provide additional context for price action analysis. The indicator is highly customizable, allowing users to toggle the visibility of trendlines, projections, and heartlines for each timeframe, with a focus on the DayTrade channel, which includes unique reflection channel features.
This description provides a detailed explanation of the indicator’s features, functionality, and display, with a specific focus on the DayTrade channel’s anchoring, the role of static and dynamic channels in projecting future price action, the heartline’s potential as a volume indicator, and how traders can use the indicator for line-to-line trading strategies.
Features and Functionality
1. Dynamic Trend Channels
The SuperTrend indicator calculates trend channels for five timeframes:
Each channel consists of:
DayTrade Channel Anchoring
The DayTrade channel anchors its trendlines to the high and low prices of the previous and current trading days, with updates restricted to before 12 PM to capture significant price movements during the morning session, which is often more volatile due to market openings or news events. The "Show DayTrade Trend Lines" toggle enables this channel, and after 12 PM, the trendlines and projections remain static for the rest of the trading day. This static anchoring provides a consistent reference for potential support and resistance levels, allowing traders to anticipate price reactions based on historical highs and lows from the previous day and the morning session of the current day.
The static nature of the DayTrade channel after 12 PM ensures that the trendlines and projections do not shift mid-session, providing a stable framework for traders to assess whether price action respects or breaks these levels, potentially indicating trend continuation or reversal.
Static vs. Dynamic Channels
2. Reflection Channels (DayTrade Only)
The DayTrade channel includes optional lower and upper reflection channels, which are additional trendlines positioned symmetrically around the main channel to provide extended support and resistance zones. These are controlled by the "Show Reflection Channel" dropdown.
3. Heartlines
Each timeframe, including the DayTrade channel and its reflection channels, can display a heartline, which is a dashed line plotted at the midpoint between the upper and lower trendlines or their projections. For the DayTrade channel:
4. Alerts
The script includes alert conditions for all timeframes, triggered when a candle closes fully above the upper projection or below the lower projection. For the DayTrade channel:
5. Customization Options
The script provides extensive customization through input settings, grouped by timeframe:
Display
The indicator overlays the following elements on the chart:
Trading Applications: Line-to-Line Trading
The SuperTrend indicator can be used to inform trading decisions by providing a framework for line-to-line trading, where traders use the trendlines, projections, and heartlines as reference points for entries, exits, and risk management. Below is a detailed explanation of how to use the DayTrade channel and its reflection channels for trading, focusing on their anchoring, static/dynamic behavior, and the heartline’s role.
1. Why DayTrade Channel Anchoring
The DayTrade channel’s anchoring to the previous day’s high/low and the current day’s high/low before 12 PM, controlled by the "Show DayTrade Trend Lines" toggle, captures significant price levels during high-volatility periods:
This anchoring makes the DayTrade channel particularly useful for intraday traders, as it provides a consistent framework based on recent price history, which can guide decisions on trend continuation or reversal.
2. Using Static Channels and Projections
The static nature of the DayTrade channel after 12 PM, enabled by "Show DayTrade Trend Lines," and the dynamic projections, set via "DayTrade Projection Channel Color," provide a structured approach to trading:
3. Line-to-Line Trading Strategy
Line-to-line trading involves using the trendlines, projections, and reflection channels as sequential price targets or reversal zones:
4. Heartline as a Volume Indicator
The heartline, controlled by toggles like "Show DayTrade Heartline," "Show Lower Reflection Heartline," and "Show Upper Reflection Heartline," may serve as an indirect proxy for areas of high trading activity:
5. Practical Trading Considerations
How to Use in TradingView
Conclusion
The SuperTrend indicator provides a robust framework for technical analysis by plotting dynamic trend channels, projections, and heartlines across multiple timeframes, with advanced features for the DayTrade channel, including lower and upper reflection channels. The DayTrade channel’s anchoring to previous and current day highs/lows before 12 PM, enabled by "Show DayTrade Trend Lines," creates a stable reference for intraday trading, while static trendlines and dynamic projections guide traders in anticipating price movements. The heartlines, controlled by toggles like "Show DayTrade Heartline," offer potential insights into high-activity price levels, with breaks possibly indicating momentum shifts. Traders can use the indicator for line-to-line trading by targeting moves between trendlines, projections, and reflection channels, while managing risk with stop-losses and confirmations from other tools. The indicator should be used as part of a comprehensive trading plan.
Overview
The SuperTrend indicator is Pine Script V6 designed for TradingView to plot dynamic trend lines & channels across multiple timeframes (Daily, Weekly, Monthly, Quarterly, and Yearly/All-Time) to assist traders in identifying potential support, resistance, and trend continuation levels. The script calculates trendlines based on high and low prices over specified periods, projects these trendlines forward, and includes optional reflection channels and heartlines to provide additional context for price action analysis. The indicator is highly customizable, allowing users to toggle the visibility of trendlines, projections, and heartlines for each timeframe, with a focus on the DayTrade channel, which includes unique reflection channel features.
This description provides a detailed explanation of the indicator’s features, functionality, and display, with a specific focus on the DayTrade channel’s anchoring, the role of static and dynamic channels in projecting future price action, the heartline’s potential as a volume indicator, and how traders can use the indicator for line-to-line trading strategies.
Features and Functionality
1. Dynamic Trend Channels
The SuperTrend indicator calculates trend channels for five timeframes:
- []DayTrade Channel: Tracks daily highs and lows, updating before 12 PM each trading day.
[]Weekly Channel: Tracks highs and lows over a user-selected period (1, 2, or 3 weeks).
[]Monthly Channel: Tracks monthly highs and lows.
[]Quarterly Channel: Tracks highs and lows over a user-selected period (1 or 2 quarters). - Yearly/All-Time Channel: Tracks highs and lows over a user-selected period (1 to 10 years or All Time).
Each channel consists of:
- []Upper Trendline: Connects the high prices of the previous and current periods.
[]Lower Trendline: Connects the low prices of the previous and current periods.
[]Projections: Extends the trendlines forward based on the trend’s slope.
[]Heartline: A dashed line drawn at the midpoint between the upper and lower trendlines or their projections.
DayTrade Channel Anchoring
The DayTrade channel anchors its trendlines to the high and low prices of the previous and current trading days, with updates restricted to before 12 PM to capture significant price movements during the morning session, which is often more volatile due to market openings or news events. The "Show DayTrade Trend Lines" toggle enables this channel, and after 12 PM, the trendlines and projections remain static for the rest of the trading day. This static anchoring provides a consistent reference for potential support and resistance levels, allowing traders to anticipate price reactions based on historical highs and lows from the previous day and the morning session of the current day.
The static nature of the DayTrade channel after 12 PM ensures that the trendlines and projections do not shift mid-session, providing a stable framework for traders to assess whether price action respects or breaks these levels, potentially indicating trend continuation or reversal.
Static vs. Dynamic Channels
- []Static Channels: Once set (e.g., after 12 PM for the DayTrade channel or at the start of a new period for other timeframes), the trendlines remain fixed until the next period begins. This static behavior allows traders to use the channels as reference levels for potential price targets or reversal points, as they are based on historical price extremes.
[]Dynamic Projections: The projections extend the trendlines forward, providing a visual guide for potential future price action, assuming the trend’s momentum continues. When a trendline is broken (e.g., price closes above the upper projection or below the lower projection), it may suggest a breakout or reversal, prompting traders to reassess their positions.
2. Reflection Channels (DayTrade Only)
The DayTrade channel includes optional lower and upper reflection channels, which are additional trendlines positioned symmetrically around the main channel to provide extended support and resistance zones. These are controlled by the "Show Reflection Channel" dropdown.
- []Lower Reflection Channel:
- []Position: Drawn below the lower trendline at a distance equal to the range between the upper and lower trendlines.
[]Projection: Extends forward as a dashed line.
[]Heartline: A dashed line drawn at the midpoint between the lower trendline and the lower reflection trendline, controlled by the "Show Lower Reflection Heartline" toggle.
- []Position: Drawn above the upper trendline at the same distance as the main channel’s range.
[]Projection: Extends forward as a dashed line.
[]Heartline: A dashed line drawn at the midpoint between the upper trendline and the upper reflection trendline, controlled by the "Show Upper Reflection Heartline" toggle.
- []"None": No reflection channels are shown.
[]"Lower": Only the lower reflection channel is shown.
[]"Upper": Only the upper reflection channel is shown.
[]"Both": Both reflection channels are shown.
- []Position: Drawn below the lower trendline at a distance equal to the range between the upper and lower trendlines.
3. Heartlines
Each timeframe, including the DayTrade channel and its reflection channels, can display a heartline, which is a dashed line plotted at the midpoint between the upper and lower trendlines or their projections. For the DayTrade channel:
- []Main DayTrade Heartline: Midpoint between the upper and lower trendlines, controlled by the "Show DayTrade Heartline" toggle.
[]Lower Reflection Heartline: Midpoint between the lower trendline and the lower reflection trendline, controlled by the "Show Lower Reflection Heartline" toggle.
[]Upper Reflection Heartline: Midpoint between the upper trendline and the upper reflection trendline, controlled by the "Show Upper Reflection Heartline" toggle.
[]Independent Toggles: Visibility is controlled by:- []"Show DayTrade Heartline": For the main DayTrade heartline.
[]"Show Lower Reflection Heartline": For the lower reflection heartline.
[]"Show Upper Reflection Heartline": For the upper reflection heartline.
- []"Show DayTrade Heartline": For the main DayTrade heartline.
4. Alerts
The script includes alert conditions for all timeframes, triggered when a candle closes fully above the upper projection or below the lower projection. For the DayTrade channel:
- []Upper Trend Break: Triggers when a candle closes fully above the upper projection.
[]Lower Trend Break: Triggers when a candle closes fully below the lower projection. - Alerts are combined across all timeframes, so a break in any timeframe triggers a general "Upper Trend Break" or "Lower Trend Break" alert with the message: "Candle closed fully above/below one or more projection lines." Alerts fire once per bar close.
5. Customization Options
The script provides extensive customization through input settings, grouped by timeframe:
- []DayTrade Channel:
- []"Show DayTrade Trend Lines": Toggle main trendlines and projections.
[]"Show DayTrade Heartline": Toggle main heartline.
[]"Show Lower Reflection Heartline": Toggle lower reflection heartline.
[]"Show Upper Reflection Heartline": Toggle upper reflection heartline.
[]"DayTrade Channel Color": Set color for trendlines.
[]"DayTrade Projection Channel Color": Set color for projections.
[]"Heartline Color": Set color for all heartlines.
[]"Show Reflection Channel": Dropdown to show "None," "Lower," "Upper," or "Both" reflection channels.
- []Toggles for trendlines (e.g., "Show Weekly Trend Lines," "Show Monthly Trend Lines") and heartlines (e.g., "Show Weekly Heartline," "Show Monthly Heartline").
[]Period selection (e.g., "Weekly Period" for 1, 2, or 3 weeks; "Yearly Period" for 1 to 10 years or All Time).
[]Separate colors for trendlines (e.g., "Weekly Channel Color"), projections (e.g., "Weekly Projection Channel Color"), and heartlines (e.g., "Weekly Heartline Color").
- []"Show DayTrade Trend Lines": Toggle main trendlines and projections.
Display
The indicator overlays the following elements on the chart:
- []Trendlines: Solid lines connecting the high and low anchor points for each timeframe, using user-specified colors (e.g., set via "DayTrade Channel Color").
[]Projections: Dashed lines extending from the current anchor points, indicating potential future price levels, using colors set via "DayTrade Projection Channel Color" or equivalent.
[]Heartlines: Dashed lines at the midpoint of each channel, using the color set via "Heartline Color" or equivalent.
[]Reflection Channels (DayTrade Only):- []Lower reflection trendline and projection: Below the lower trendline, using the same colors as the main channel.
[]Upper reflection trendline and projection: Above the upper trendline, using the same colors.
[]Reflection heartlines: Midpoints between the main trendlines and their respective reflection trendlines, using the "Heartline Color."
- []Lower reflection trendline and projection: Below the lower trendline, using the same colors as the main channel.
Trading Applications: Line-to-Line Trading
The SuperTrend indicator can be used to inform trading decisions by providing a framework for line-to-line trading, where traders use the trendlines, projections, and heartlines as reference points for entries, exits, and risk management. Below is a detailed explanation of how to use the DayTrade channel and its reflection channels for trading, focusing on their anchoring, static/dynamic behavior, and the heartline’s role.
1. Why DayTrade Channel Anchoring
The DayTrade channel’s anchoring to the previous day’s high/low and the current day’s high/low before 12 PM, controlled by the "Show DayTrade Trend Lines" toggle, captures significant price levels during high-volatility periods:
- []Previous Day High/Low: These represent key levels where price found resistance (high) or support (low) in the prior session, often acting as psychological or technical barriers in the current session.
[]Current Day High/Low Before 12 PM: The morning session (before 12 PM) often sees increased volatility due to market openings, news releases, or institutional activity. Anchoring to these early highs/lows ensures the channel reflects the most relevant price extremes, which are likely to influence intraday price action. - Static After 12 PM: By fixing the anchor points after 12 PM, the trendlines and projections become stable references for the afternoon session, allowing traders to anticipate price reactions at these levels without the lines shifting unexpectedly.
This anchoring makes the DayTrade channel particularly useful for intraday traders, as it provides a consistent framework based on recent price history, which can guide decisions on trend continuation or reversal.
2. Using Static Channels and Projections
The static nature of the DayTrade channel after 12 PM, enabled by "Show DayTrade Trend Lines," and the dynamic projections, set via "DayTrade Projection Channel Color," provide a structured approach to trading:
- []Support and Resistance:
- []The upper trendline and lower trendline act as dynamic support/resistance levels based on the previous and current day’s price extremes.
[]Traders may observe price reactions (e.g., bounces or breaks) at these levels. For example, if price approaches the lower trendline and bounces, it may indicate support, suggesting a potential long entry.
- []The projections extend the trendlines forward, offering potential price targets if the trend continues. For instance, if price breaks above the upper trendline and continues toward the upper projection, traders might consider it a bullish continuation signal.
[]A candle closing fully above the upper projection or below the lower projection (triggering an alert) may indicate a breakout, prompting traders to enter in the direction of the break or reassess if the break fails.
- []Because the trendlines are static after 12 PM, they serve as fixed reference points. A break above the upper trendline or its projection may suggest bullish momentum, while a break below the lower trendline or projection may indicate bearish momentum.
- Traders can use these breaks to set entry points (e.g., entering a long position after a confirmed break above the upper projection) and place stop-losses below the broken level to manage risk.
- []The upper trendline and lower trendline act as dynamic support/resistance levels based on the previous and current day’s price extremes.
3. Line-to-Line Trading Strategy
Line-to-line trading involves using the trendlines, projections, and reflection channels as sequential price targets or reversal zones:
- []Trading Within the Main Channel:
- []Long Setup: If price bounces off the lower trendline and moves toward the heartline (enabled by "Show DayTrade Heartline") or upper trendline, traders might enter a long position near the lower trendline, targeting the heartline or upper trendline for profit-taking. A stop-loss could be placed below the lower trendline to protect against a breakdown.
[]Short Setup: If price rejects from the upper trendline and moves toward the heartline or lower trendline, traders might enter a short position near the upper trendline, targeting the heartline or lower trendline, with a stop-loss above the upper trendline.
- []If price breaks above the upper trendline and continues toward the upper reflection trendline or its projection (enabled by "Show Reflection Channel" set to "Upper" or "Both"), traders might treat this as a breakout trade, entering long with a target at the upper reflection level and a stop-loss below the upper trendline.
[]Similarly, a break below the lower trendline toward the lower reflection trendline or its projection (enabled by "Show Reflection Channel" set to "Lower" or "Both") could signal a short opportunity, with a target at the lower reflection level and a stop-loss above the lower trendline.
- []If price reaches the upper reflection trendline and shows signs of rejection (e.g., a bearish candlestick pattern), traders might consider a short position, anticipating a move back toward the main channel’s upper trendline or heartline.
[]Conversely, a rejection at the lower reflection trendline could prompt a long position targeting the lower trendline or heartline.
- []Use the heartline as a midpoint to gauge whether price is likely to continue toward the opposite trendline or reverse. For example, a failure to break above the heartline after bouncing from the lower trendline might suggest weakening bullish momentum, prompting a tighter stop-loss.
[]The static nature of the channels after 12 PM allows traders to set precise stop-loss and take-profit levels based on historical price levels, reducing the risk of chasing moving targets.
- []Long Setup: If price bounces off the lower trendline and moves toward the heartline (enabled by "Show DayTrade Heartline") or upper trendline, traders might enter a long position near the lower trendline, targeting the heartline or upper trendline for profit-taking. A stop-loss could be placed below the lower trendline to protect against a breakdown.
4. Heartline as a Volume Indicator
The heartline, controlled by toggles like "Show DayTrade Heartline," "Show Lower Reflection Heartline," and "Show Upper Reflection Heartline," may serve as an indirect proxy for areas of high trading activity:
- []Rationale: The heartline represents the average price between the high and low of a period, which often aligns with price levels where significant buying and selling have occurred, as these midpoints can correspond to areas of consolidation or high volume in the order book. While the script does not directly use volume data, the heartline’s position may reflect price levels where market participants have historically balanced supply and demand.
[]Breakout Potential: A break above or below the heartline, particularly with a strong candle (e.g., wide range or high momentum), may indicate a shift in market sentiment, potentially leading to accelerated price movement in the direction of the break. For example:- []A close above the main DayTrade heartline could suggest buyers are overpowering sellers, potentially leading to a move toward the upper trendline or upper reflection channel.
[]A close below the heartline could indicate seller dominance, targeting the lower trendline or lower reflection channel.
- []Traders might use heartline breaks as confirmation signals for trend continuation. For instance, after a bounce from the lower trendline, a close above the heartline could confirm bullish momentum, prompting a long entry.
[]The heartline can also act as a dynamic stop-loss or trailing stop level. For example, in a long trade, a trader might exit if price falls below the heartline, indicating a potential reversal.
[]For reflection heartlines, a break above the upper reflection heartline or below the lower reflection heartline could signal strong momentum, as these levels are further from the main channel and may require significant buying or selling pressure to breach.
- []A close above the main DayTrade heartline could suggest buyers are overpowering sellers, potentially leading to a move toward the upper trendline or upper reflection channel.
5. Practical Trading Considerations
- []Timeframe Context: The DayTrade channel, enabled by "Show DayTrade Trend Lines," is best suited for intraday trading due to its daily anchoring and morning update behavior. Traders should consider higher timeframe channels (e.g., enabled by "Show Weekly Trend Lines" or "Show Monthly Trend Lines") for broader context, as breaks of the DayTrade channel may align with or be influenced by larger trends.
[]Confirmation Tools: Use additional indicators (e.g., RSI, MACD, or volume-based indicators) or candlestick patterns to confirm signals at trendlines, projections, or heartlines. The script’s alerts can help identify breakouts, but traders should verify with other technical or fundamental factors.
[]Risk Management: Always define risk-reward ratios before entering trades. For example, a 1:2 risk-reward ratio might involve risking a stop-loss below the lower trendline to target the heartline or upper trendline.
[]Market Conditions: The effectiveness of the channels and heartlines depends on market conditions (e.g., trending vs. ranging markets). In choppy markets, price may oscillate within the main channel, favoring range-bound strategies. In trending markets, breaks of projections or reflection channels may signal continuation trades. - Limitations: The indicator relies on historical price data and does not incorporate volume, news, or other external factors. Traders should use it as part of a broader strategy and avoid relying solely on its signals.
How to Use in TradingView
- []Add the Indicator: Copy the script into TradingView’s Pine Editor, compile it, and add it to your chart.
[]Configure Settings:
[]Enable "Show DayTrade Trend Lines" to display the main DayTrade trendlines and projections.
[]Use the "Show Reflection Channel" dropdown to select "Lower," "Upper," or "Both" to display reflection channels.
[]Toggle "Show DayTrade Heartline," "Show Lower Reflection Heartline," and "Show Upper Reflection Heartline" to control heartline visibility.
[]Adjust colors using "DayTrade Channel Color," "DayTrade Projection Channel Color," and "Heartline Color."
[]Enable other timeframes (e.g., "Show Weekly Trend Lines," "Show Monthly Trend Lines") for additional context, if desired.
[]Set Alerts: Configure alerts in TradingView for "Upper Trend Break" or "Lower Trend Break" to receive notifications when a candle closes fully above or below any timeframe’s projections.
[]Analyze the Chart:
[]Monitor price interactions with the trendlines, projections, and heartlines.
[]Look for bounces, breaks, or rejections at these levels to plan entries and exits.
[]Use the heartline breaks as potential confirmation of momentum shifts. - Test Strategies: Backtest line-to-line trading strategies in TradingView’s strategy tester or demo account to evaluate performance before trading with real capital.
Conclusion
The SuperTrend indicator provides a robust framework for technical analysis by plotting dynamic trend channels, projections, and heartlines across multiple timeframes, with advanced features for the DayTrade channel, including lower and upper reflection channels. The DayTrade channel’s anchoring to previous and current day highs/lows before 12 PM, enabled by "Show DayTrade Trend Lines," creates a stable reference for intraday trading, while static trendlines and dynamic projections guide traders in anticipating price movements. The heartlines, controlled by toggles like "Show DayTrade Heartline," offer potential insights into high-activity price levels, with breaks possibly indicating momentum shifts. Traders can use the indicator for line-to-line trading by targeting moves between trendlines, projections, and reflection channels, while managing risk with stop-losses and confirmations from other tools. The indicator should be used as part of a comprehensive trading plan.
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya dengan percuma dan tanpa had – ketahui lebih lanjut di sini.
All opinions while deemed valid by its operators and shared on this board are not financial advice and are primarily for Entertainment Purposes.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya dengan percuma dan tanpa had – ketahui lebih lanjut di sini.
All opinions while deemed valid by its operators and shared on this board are not financial advice and are primarily for Entertainment Purposes.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.