Trend Lines
Oct 17, 2023

Our "Trend Lines" indicator is a powerful tool designed to detect and highlight significant trendlines on your chart while minimizing clutter. Tailored for real-time trading, it includes advanced filters and estimates trendline angles for more precise analysis. This tool is ideal for traders looking to use trendlines as part of their trading strategy.
How to Trade with the Trend Lines Trading Indicator?
Trendlines play a crucial role as support and resistance levels with multiple tests, signaling a stronger support/resistance role. Our indicator eloquently highlights these lines to help traders pinpoint them easily.
When a trendline is broken, it could be a sign of a potential trend reversal, making this indicator essential for identifying and taking advantage of these critical market shifts. Trendline breaks are conveniently labeled on the chart.
To make the analysis even more efficient, traders can filter trendlines by their angles, only displaying those within a specific range.
This customizable feature allows users to declutter their charts and focus on the trendlines that matter most, such as steeper or more horizontal ones.
Technical Details of the Trend Lines Indicator
When a swing, or pivot point, is detected, the indicator draws a trendline based on specific conditions. A key condition is that a Bearish Trendline (red) appears on a lower high, while a Bullish Trendline (blue) shows up on a higher low.
Initially, a dotted-style TrendLine is presented, progressing into a solid-style secondary TrendLine, which is used for real-time break detection.
Users have the option to apply different conditions for more tailored analysis:
Detecting Swings
A swing occurs when a high/low stands out as the extreme point against several others, determined by the "Length" setting. Visual aids like yellow flags mark confirmed swings and trigger trendline drawing based on these criteria.
After initial confirmation, trendlines evolve with the market, progressing until a new trendline is formed or a break occurs.
- New trendline formation
- Trendline breaking
Understanding Breaks Between Swings
Once the trendline criteria are met, the indicator can filter out lines based on breaking activity, controlled via "Check breaks between."
- Disabled: Allows the initial TrendLine to be pierced.
- Check breaks between point A - point B: No breaks between Swing points are permitted.
- Point A - Current bar: Prohibits breaks from the first Swing point to the confirmation point.
Managing TrendLine Breaks
The secondary, solid TrendLine continues to update with market progress until broken or replaced. A reappearing trendline can signal multiple trades, controlled by the "Minimal bars" setting, which determines the sturdiness of a TrendLine before break considerations.
Users can tailor the signal frequency for breaks by adjusting this setting, as shown below:
Calculating Angles More Accurately
While traditional methods use equal units for X and Y axes to calculate angles, this is challenging given that the X-axis uses bars and the Y-axis uses price. Our solution, the calculate_slope() function, effectively normalizes angles by examining price differences over a set bar range.
Setting preferences for the visible chart ratio allows traders to see angles reflecting true market conditions, adjustable via "Angles -> Ratio X-Y axis."
Settings: Angles - Ratio X-Y axis:
Customizing Indicator Settings
Swing Detection
- Length: Defines the lookback period for detecting swing points.
Trendline Validation
-
Check breaks between:
- Disabled: TrendLines can be pierced.
- Check breaks between point A - point B: Prevents pierces between points.
- Point A - Current bar: Blocks pierces post swing confirmation.
-
Source (breaks): Determines invalidating conditions, default is close.
TrendLine Break Management
- Minimal bars: Specifies the minimum uninterrupted bars before a break signal.
Angle Adjustments
- Show: Toggle angle labels.
- Ratio X-Y axis: Adjusts viewing preferences to align angles with expectations.
- Only TrendLine between: Restricts trendlines to set degree parameters.
FAQ
How can I access the Trend Lines indicator? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Trading is risky and many will lose money in connection with trading activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other markets involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.
Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.
Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.
As a provider of technical analysis tools for charting platforms, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content or tool we provide.
Charts used on this site are by TradingView in which the majority of our tools are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com. TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.
This does not represent our full Disclaimer. Please read our full disclaimer.
© 2025 LuxAlgo Global, LLC.