Trend lines indicator by ForexBeeEnhanced 3-Swing Trendline Zones - Complete Feature Guide
WHAT THIS INDICATOR DOES
This indicator automatically draws trendline zones on your chart using a 3-point validation system. Instead of just connecting any two price points like basic trendline tools, it waits for three swing points to confirm the trendline is valid before drawing it.
FEATURE 1: SWING POINT DETECTION
What it detects:
Swing highs: Price points where the high is higher than surrounding candles
Swing lows: Price points where the low is lower than surrounding candles
These show up as small arrows on your chart labeled "SH" (swing high) and "SL" (swing low)
Settings that control this:
Swing Length : Default is 6, range 1-20
Higher numbers = fewer, more significant swing points
Lower numbers = more swing points, including minor ones
Example: Setting 5 means each swing point must be higher/lower than 5 candles on each side
How to use this setting:
On 1-minute charts: Use 5-10 to filter out noise
On daily charts: Use 2-3 for more sensitivity
Volatile markets: Increase the number
Quiet markets: Decrease the number
Please See the Below Images To See the difference of swing length of 6 and 8
Display control:
Show Swing Points : Turn the arrows on/off
Default: ON (you'll see the arrows)
Turn OFF if arrows clutter your chart
FEATURE 2: RETRACEMENT VALIDATION SYSTEM
What this does:
After finding two swing points, the system checks if the second swing represents a proper market retracement, not just random price movement.
How it works:
Finds the highest point between two swing lows (or lowest point between two swing highs)
Calculates how much the second swing retraced from this extreme point
Only accepts swings that retrace between your set percentages
Settings that control this:
Lower Limit % : Default 50%, range 0-100%
Upper Limit % : Default 90%, range 0-100%
These create a "valid retracement zone"
Why this matters:
Eliminates random trendlines that don't follow market structure
Ensures trendlines represent actual retracement patterns
Based on Elliott Wave and Fibonacci principles
FEATURE 3: ATR-BASED ZONE WIDTH
What ATR means:
Average True Range measures how much price typically moves in a given period. Instead of fixed-width trendlines, this creates zones that adapt to market volatility.
Settings that control this:
Zone Width (ATR Multiple) : Default 0.3, range 0.1-1.0
ATR Length : Default 14, range 1-50 periods
How zone width works:
Multiplier 0.1 = Very narrow zones (tight around trendline)
Multiplier 0.5 = Medium zones
Multiplier 1.0 = Wide zones (accommodates more price movement)
ATR Length explained:
14 periods = Uses last 14 candles to calculate average volatility
Shorter periods (7) = More sensitive to recent volatility changes
Longer periods (21) = Smoother, less sensitive to volatility spikes
Practical impact:
During high volatility: Zones automatically become wider
During low volatility: Zones automatically become narrower
Prevents false breakouts during normal market noise
Creates realistic support/resistance areas instead of precise lines
FEATURE 4: VISUAL ZONE SYSTEM
Active Uptrend Zones:
Green upper boundary line (solid, thick)
Lime green lower boundary line (solid, thick)
Green fill between lines (80% transparency)
These represent dynamic support levels
Active Downtrend Zones:
Blue upper boundary line (solid, thick)
Navy blue lower boundary line (solid, thick)
Red fill between lines (80% transparency)
These represent dynamic resistance levels
Broken/Expired Zones:
Gray/silver boundary lines (dashed, thick)
Original fill color maintained (green for uptrend zones, red for downtrend zones)
Shows historical trendlines that are no longer active
FEATURE 5: BREAK DETECTION SYSTEM
How breaks are detected:
The system monitors when price violates the zone boundaries, indicating the trendline structure has failed.
Settings that control this:
Use Wick Break : True/False toggle
TRUE: Break occurs when candle high/low touches zone boundary
FALSE: Break occurs when candle close price crosses zone boundary
Conservative vs Aggressive approach:
Wick Break = TRUE (Aggressive) :
- More sensitive, earlier signals
- May produce more false breaks during volatile periods
- Good for scalping and short-term trading
Wick Break = FALSE (Conservative) :
- Requires candle to close beyond zone
- Fewer false signals, more reliable breaks
- Better for swing trading and position trading
What happens when zone breaks:
Zone lines change from solid to dashed
Zone lines change color to gray/silver
Fill color remains original (green/red) for identification
Zone stops extending forward
Zone is removed from active monitoring
FEATURE 6: ZONE EXPIRATION SYSTEM
What expiration does:
Allows trendlines to automatically become inactive after a set number of bars, even if they haven't been broken.
Settings that control this:
Use Zone Expiration : True/False toggle
Zone Expiration (Bars) : Default 500, range 1-1000
FALSE: Zones run indefinitely until broken
TRUE: Zones expire after specified number of bars
Visual result:
Expired zones look identical to broken zones
Lines become dashed and gray/silver
Fill colors remain original (green/red)
FEATURE 7: MULTI-TIMEFRAME TREND ANALYSIS TABLE
What the table shows:
A small table on your chart that monitors trend conditions across four different timeframes simultaneously.
Settings that control this:
TF1, TF2, TF3, TF4 : Four customizable timeframes
Default: 4H, 8H, 1D, 1W
Table Position : 9 positions (top/middle/bottom + left/center/right)
Text Size : Tiny, Small, Normal, Large, Huge
How trend detection works:
Uptrend Pattern : Current candle's high AND low are both higher than previous candle's high AND low on specified timeframes
This creates higher highs and higher lows
Shows consistent buying pressure
Table displays green background with upward arrow (▲)
Downtrend Pattern : Current candle's high AND low are both lower than previous candle's high AND low on specified timeframes
This creates lower highs and lower lows
Shows consistent selling pressure
Table displays red background with downward arrow (▼)
Range/Sideways Pattern : Current candle creates either inside bar or outside bar
Inside bar: Current range smaller than previous candle
Outside bar: Current range larger than previous candle
Shows market indecision or consolidation
Table displays orange background with diamond symbol (◆)
No Clear Pattern : None of the above conditions are met
Table displays gray background with horizontal line (⎯)
How to interpret the table:
All timeframes green (uptrend): Strong bullish alignment
All timeframes red (downtrend): Strong bearish alignment
Mixed colors: Conflicting timeframes, exercise caution
Mostly orange: Market in consolidation phase
Tooltip explanations: Hover over each cell for detailed description
FEATURE 8: BACKGROUND COLOR SYSTEM
What background colors show:
Optional feature that colors your chart background based on the current timeframe's trend condition.
Settings that control this:
Show Background Colors : True/False toggle
Background Transparency : 80-98% range
Default: OFF (no background colors)
Color scheme:
Green background: Current timeframe showing uptrend
Red background: Current timeframe showing downtrend
Orange background: Current timeframe showing range/consolidation
No background: No clear trend pattern
Transparency levels:
80%: More visible background color
95%: Subtle background hint
98%: Very subtle background tint
"TRENDLINES"に関するスクリプトを検索
[GrandAlgo] ATR Trend MatrixThe ATR Trend Matrix is a dynamic trendline indicator designed to help traders visualize market structure using ATR-based trend projections. This tool adapts to price action and highlights potential support and resistance zones based on Average True Range (ATR) calculations.
Key Features
ATR-Based Trendlines – Calculates and plots dynamic trendlines using an adjustable ATR factor.
Multi-Level Matrix System – Provides up to four matrix levels, each customizable with different ATR multipliers.
Swing High & Low Detection – Automatically detects market pivots to serve as anchor points for trendlines.
Adjustable Trend Length – Fine-tune the sensitivity of trendlines using the Swing Length and Trend-Line Length Multiplier.
Auto-Adjustment Mode – When enabled, trendlines update dynamically as ATR evolves.
Buy & Sell Signals – Marks potential trade setups when price crosses below or above Matrix Level 1.
How It Works
Detects Swing Points – Identifies key highs and lows in the market using the length setting.
Plots ATR-Based Trendlines – Calculates trendlines using ATR with user-defined multipliers for four matrix levels.
Adjusts Dynamically – If Auto Adjust is enabled, trendlines shift with ATR movements.
Identifies Trade Signals – Highlights potential buy/sell zones when price interacts with Matrix Level 1 trendlines.
Manages Active Trendlines – Automatically updates and removes trendlines based on price interaction.
User Settings
General Settings
ATR Factor – Controls the ATR multiplier for trendline calculation.
Swing Length – Defines the number of bars for swing high/low detection.
Trend-Line Length Multiplier – Adjusts the extension length of trendlines.
Auto Adjust Trendlines – Enables real-time adjustment of trendlines as ATR changes.
Matrix Settings
Matrix Level 1-4 – Enable or disable individual trendline levels.
Matrix Factors – Customize the ATR multipliers for each matrix level.
Trading Applications
Trend Confirmation – Use the primary trendline and matrix levels to gauge trend strength.
Support & Resistance Zones – ATR-based trendlines can act as dynamic support/resistance.
Breakout & Rejection Signals – Identify potential breakouts or reversals when price interacts with matrix levels.
Volatility-Based Trading – ATR helps adjust trendlines based on market volatility.
The ATR Trend Matrix is a powerful tool for traders who want a dynamic, adaptive trendline system that reacts to market structure and volatility. With customizable settings, multi-level ATR projections, and trade signal detection, this indicator provides a comprehensive approach to price action analysis.
TRAPPER TRENDLINES — RSIBuilds dynamic RSI trendlines by connecting the two most recent confirmed RSI swing points (highs→highs for resistance, lows→lows for support). Includes optional channel shading for the 30–70 zone, an RSI moving average, clean break alerts, and simple bullish/bearish divergence alerts versus price.
How it works
RSI pivots: A point on RSI is a swing high/low only if it is the most extreme value compared with a set number of bars on the left and the right (the Pivot Lookback).
RSI trendlines:
Resistance connects the last two confirmed RSI swing highs.
Support connects the last two confirmed RSI swing lows.
Lines can be Full Extend (update into the future) or Pivot Only.
Channel block: Optional fill of the 30–70 range for fast visual context.
Alerts:
Breaks of RSI support/resistance trendlines.
Basic bullish/bearish RSI divergences versus price pivots.
Inputs
RSI
RSI Length: Default 14 (standard).
Pivot Lookback: Bars to the left/right required to confirm an RSI swing.
Overbought / Oversold: 70 / 30 by default.
Line Extension: Full Extend or Pivot Only.
Visuals
Show RSI Moving Average / Signal Length: Optional smoothing line on RSI.
RSI/Signal colors: Customize plot colors.
Show 30–70 Channel Block: Toggle the middle-zone fill.
Tint pane background when RSI in channel: Optional subtle background when RSI is between OB/OS.
Divergences & Alerts
Enable RSI TL Break Alerts: Alert conditions for RSI line breaks.
Enable Divergence Alerts: Bullish/Bearish divergence alerts versus price.
Pairing with price for confluence/divergence
For accurate confluence and clearer divergences, align this RSI tool with your price trendline tool (for example, TRAPPER TRENDLINES — PRICE):
Set RSI Pivot Lookback equal to the Pivot Left/Right size used on price.
Example: Price uses Pivot Left = 50 and Pivot Right = 50 → set RSI Pivot Lookback = 50.
Keep RSI Length = 14 and OB/OS = 70/30 unless you have a specific edge.
Interpretation:
Confluence: Price reacts at its trendline while RSI reacts at its own line in the same direction.
Divergence: Price makes a higher high while RSI makes a lower high (bearish), or price makes a lower low while RSI makes a higher low (bullish), using matched pivot windows.
Suggested settings
Higher timeframes (4H / 1D / 1W): Pivot Lookback = 50; optional RSI MA length 14; channel block ON.
Intraday (15m / 30m / 1H): Pivot Lookback = 30; optional RSI MA length 14.
Always mirror your price pivot size to this RSI Pivot Lookback for consistent swings.
Reading the signals
RSI trendline touch/hold: Momentum reacting at structure; look for confluence with price levels.
RSI Trendline Break Up / Down: Momentum shift; consider price structure and retests.
Bullish/Bearish Divergence: Confirm only when pivots are matched and the new swing is confirmed.
Notes & limitations
Pivots require future bars to confirm by design; trendlines update as new swings confirm.
Divergence logic compares RSI pivots to price pivots with the same lookback; mismatched windows can produce false positives.
No strategy entries/exits or performance claims are provided. This is an analytical tool.
Alerts (titles/messages)
RSI: Trendline Break Up — “RSI broke falling resistance line.”
RSI: Trendline Break Down — “RSI broke rising support line.”
RSI: Bullish Divergence — “Bullish RSI divergence confirmed.”
RSI: Bearish Divergence — “Bearish RSI divergence confirmed.”
Quick start
Add the indicator to a separate pane.
Set Pivot Lookback to match your price tool’s pivot size (e.g., 50).
Optionally toggle the RSI MA and Channel Block for clarity.
Enable alerts if you want notifications on RSI line breaks and divergences.
Use with TRAPPER TRENDLINES — PRICE or any price-based trendline tool for confluence/divergence analysis.
Compliance
This script is for educational purposes only and does not constitute financial advice. Trading involves risk. Past performance does not guarantee future results. No performance claims are made.
Support and Resistance TrendlinesStrategy:
Support: Identified as the lowest low over a specific period.
Resistance: Identified as the highest high over a specific period.
Dynamic Trendlines: We’ll use the concept of a rolling window to calculate the highest highs and lowest lows over the last n bars (you can adjust the number of bars for more sensitivity).
Explanation:
Lookback Period (length): The number of bars over which we calculate the support and resistance levels. You can adjust this value depending on the timeframe and the sensitivity you want for the trendlines.
Resistance: This is the highest high over the length of bars. We use ta.highest(high, length) to find the highest high within the specified lookback period.
Support: This is the lowest low over the length of bars. We use ta.lowest(low, length) to find the lowest low within the specified lookback period.
Plotting the Lines:
We plot the support and resistance as horizontal lines on the chart using plot().
Additionally, we create dynamic trendlines that update automatically with each new bar. The line.new function creates lines that can be modified dynamically as new price data comes in.
Line Persistence:
The line functions are used to create horizontal lines that persist across bars. The trendlines adjust their position as the bars move forward.
How It Works:
This indicator will automatically detect the highest and lowest prices over the last n bars and draw support (green line) and resistance (red line) levels on the chart.
The trendlines will adjust as the market evolves and provide visual reference points for potential areas of price reversal.
How to Use This Script:
Copy and paste the Pine Script code into the Pine Script Editor on TradingView.
Save the script, and then add it to your chart.
Adjust the Lookback Period input to suit your trading strategy and timeframe.
The support and resistance levels will be drawn dynamically, and the lines will update as new bars form.
Customizations:
You can modify the number of bars (length) used to calculate support and resistance, depending on the timeframes you're interested in.
If you need more advanced trendline drawing (such as drawing trendlines between significant high/low points or automatic adjustment to more complex patterns), you might need to implement more advanced logic using peaks and valleys or price action patterns.
Let me know if you need any further adjustments!
Support & Resistance/Supply & Demand/Liquidity/Trendlines (Expo)Real-Time Support & Resistance/Supply & Demand/Liquidity Zones /Trendlines / Key Levels
This trading tool automatically identifies real-time Support/Resistance, Supply and Demand, Liquidity Zones, Key levels, and Trendlines.
FEATURES
This indicator includes all necessary features for traditional technical analysis, such as Trendlines, Support/Resistance, Supply/Demand, and Liquidity Zones. In addition to that, we have added key market levels.
Support/Resistance: Identifies areas in real-time where the price finds support and resistance.
Supply/Demand: The indicator analyzes the market structure in real-time and maps out key supply and demand zones. The user gets an instant understanding of the current market structure.
Liquidity Zones: Liquidity zones are displayed where there is a significant level of trading activity and when there is both high supply and demand for an asset, security, or contract.
TrendLines: Trendlines help traders determine the current direction of market prices. A trendline is displayed when a price action trend is detected.
Key Levels: Key levels are psychological levels that are under the attention of many traders. There is a lot of buying or selling pressure at these levels. At these key levels, price decides its direction, either to go bearish or bullish.
HOW TO USE
Use the indicator to identify several important and commonly used levels and zones. All zones work as a future reference where the price has a higher likelihood to react at, bounce off from, or reverse.
-----------------
Disclaimer
Copyright by Zeiierman.
The information contained in my Scripts/Indicators/Ideas/Algos/Systems does not constitute financial advice or a solicitation to buy or sell any securities of any type. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual’s trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
My Scripts/Indicators/Ideas/Algos/Systems are only for educational purposes!
Pivot WebThe Pivot Web is a prototype with its base derived from TradingView's standard pivot point indicator plus inspiration from LuxAlgo's trendline work alongside my own observations/experiences.
The theory is that there's legitimacy, from a technical standpoint, pivot point calculations are an adequate gauge of momentum and sentiment because the same math was used under pressure by floor traders themselves. That calculation is centered on the average of high, low, and closing prices. This indicator creates trendlines connecting the last pivot, support, and resistance levels to the current ones. A dynamic visual cue could make it easier to assess if the price will continue or reverse the current trajectory. This method also shows us an excellent visual for volatility.
Key Takeaways:
This indicator draws new dynamic trendlines.
These new trendlines connect the past and present pivot point levels based on the timeframe you select.
Shorter timeframes = More trendlines
Price adherence to the path of these lines may offer insight for trading.
Lastly, note the first set of data in each new timeframe displays the current original pivot point levels along with the trendlines attached to their ending point. Most of the time this indicator leaves room by briefly highlighting the original static levels with all levels also being optional displays. Also note that a more stable asset may not require the outermost support and resistance levels. Like most time series analysis tools, the Pivot Web requires current data to function properly.
"Nature is pleased with simplicity, and nature is no dummy."
Trend Lines Pro for IndicatorsHello Traders!
We need to make things better & better to solve the puzzle and I try to do my best on this way. now I am here with my new Trend Lines Pro for Indicators script.
As you know, Trend Lines is very subjective and many people (even professionals) draw different Trend Lines on the same chart. This is confusing and there must be an automation to make the life easer. with this tool I tried to automate it.
The idea in this script is different from my previous trend lines scripts. In this, I use channel idea so it can check number of pivot points it contains. it also checks the angle while choosing trend lines. then we get stronger and useful Trend Lines automatically.
There are some option in the script, let see one by one:
Indicator: the indicator on which you want to see Trend lines, Predefined Indicators are: RSI, CCI(Commodity Channel Index), OBV(On-Balance Volume), Momentum, MACD, CMF(Chaikin Money Flow), External Indicator
External Indicator: with this option you can use other indicators as input and get trend lines for them.
- First add an indicator (such as MFI)
- in "Indicator" option select "External Indicator"
- click "External Indicator" option
- and choose the indicator from the list
Pivot Period: The Length to calculate Pivot Highs/Lows
Threshold Rate: This rate is used for channel width. it you give bigger numbers then you get bigger channels. it's 4 by default
Minimum Angle Rate for new Trendline: if there are different trend lines , there must be an angle between them to choose best trend lines . you can set the angle with this option.
Minimum Strength: there can be many trend lines but we need to choose/use stronger ones. with this option you can set the number of pivot points a trend channel have to contains. default value is 2
Maximum Loopback Length : by default the script can check 40 pivot highs and 40 pivot lows but to make the script faster and useful I needed to add a limitation for the number of bars that the script can go back.
Show Trendlines as: you can see trend lines as "Trendline", "Channel", "Trend Channel". you can see examples below.
Enable Weak Trend Lines : if there is no trend lines strong enough (as defined in "Minimum Strength" option) you have option to see a weak trend line . that is useful sometimes. if you enable this option weak lines are shown as dotted lines.
Show Price Labels on Trendlines: the script can show the price levels to break trend lines . the example
Line Style: trend lines can be Solid or Dashed as you wish
Color theme: colors of the Up/Down Trend lines can be set. Red, Lime, Blue, White, Black, Olive, Gray
Indicator color: colors of the Up/Down Trend lines can be set. Red, Lime, Blue, White, Black, Olive, Gray and Yellow
and last options are for length options for RSI, CCI, Momentum, MACD, CMF
There are many alerts such: Support/Resistance Broken, Price in Support/Resistance channel, Support/Resistance line broken but still in a channel that means it broke S/R but there is another trend lines to break.
Below an example how the script uses external indicator as input and draws trend lines on it. in this example chaikin ossilator was added to the chart and get trend lines for it. (I am going to make a short video about it)
An example of Trend Channel is below. when you use trend channel option you can get "big picture" of whats going on
An example for trend lines in channels, that is the idea behind this trend lines script
An axample for trend lines for CCI:
Trend lines on OBV:
Trend lines on Momentum:
Trend lines on MACD:
Trend lines on CMF:
Different colors and line styles:
Please send me message for access and do not hesitate to ask your questions about this tool.
Enjoy!
DISCLAIMER: No sharing, copying, reselling, modifying, or any other forms of use are authorized for our documents, script / strategy, and the information published with them. This informational planning script / strategy is strictly for individual use and educational purposes only. This is not financial or investment advice. Investments are always made at your own risk and are based on your personal judgement. I am not responsible for any losses you may incur. Please invest wisely.
TrendzonesHi all!
This indicator plots trendlines. These lines are not plotted as traditional lines, but are instead zones. This is useful if you think that trend lines are more of an area of importance than a line.
It does so by finding pivots and connecting two of them if they have not been broken (more about that later) in-between the pivots.
These trend zones can be used as support/resistance that the price can react to.
• The first trendline is drawn between the high/low of the first and second pivot.
• The second trendline's first point is at the open/close of the pivot (either the first pivot or the second one) that has the smallest difference between the high/low and the nearest open/close. The same difference (between the high/low and the open/close) is then subtracted from the other pivot's high/low. This creates a point at the other pivot bar. A trendline is then drawn between the points.
This creates two trendlines and a zone between the two trendlines. This zone is the one kept and is shown by the script.
You can define the pivot lengths used to find trend zones (defaults to 3/3). You can also define the number of pivots to look back for, to find trend zones and the number of active zones, both of these defaults to 3. You can also choose to let the script create new zones based on time ("Oldest") or the zone that is furthest away in price, this defaults to be based on time but it can be useful for letting the script remove the one which is furthest away in price. Another useful setting is the one called "Cross source". This defines the price that has to cross the trend zone to make it invalid (broken). This defaults to "Close", i.e. the bar has to close on the "wrong side" of the trend zone.
The current zones are shown with an extension to the right, but you can also choose to keep the previous lines (without extension). Please note that kept zones are only the ones that are broken, not the replaced ones. I.e. the zones that are kept are the ones that are crossed by the user defined "cross source" (defaults to the closing/current price of the bar).
Hope this makes sense, let me know if you have any questions.
Best of trading luck!
Mohammad - Auto TrendLinesMohammad - Auto TrendLines
Overview
An advanced automatic trendline detection system that identifies and draws both major and minor trendlines based on pivot highs and lows. This indicator uses sophisticated algorithms to detect market structure and automatically plot relevant trendlines, helping traders identify key support and resistance levels without manual chart analysis.
Key Features
Automatic Detection: Identifies pivot points and connects them to form trendlines without manual intervention
Multi-Level Analysis: Distinguishes between Major and Minor trendlines, both External and Internal
Smart Validation: Only draws trendlines that haven't been violated by price action
Comprehensive Alerts: 16 different alert conditions for breaks and reactions to trendlines
Fully Customizable: Complete control over colors, styles, widths, and display preferences for each trendline type
How It Works
The indicator uses a ZigZag algorithm with configurable pivot periods to identify significant highs and lows. It then connects these points to form trendlines, validating them against historical price action to ensure they remain relevant. The system categorizes trendlines into Major/Minor and External/Internal based on their significance in the market structure.
Use Cases
This indicator is particularly useful for:
Identifying trend continuations and potential reversals
Finding optimal entry and exit points based on trendline breaks
Setting stop-loss levels using trendline support/resistance
Confirming trade setups with multiple timeframe analysis
Automating trendline detection for systematic trading strategies
Settings/Parameters
Pivot Period: Controls the sensitivity of pivot detection (default: 5)
Display Options: Toggle visibility for each of the 8 trendline types
Style Customization: Adjust color, line style, width, and extension for each trendline
Alert Configuration: Enable/disable alerts for breaks and reactions to each trendline type
Delete Previous: Option to remove old trendlines when new ones are formed
How to Use
Add the indicator to your chart and adjust the Pivot Period based on your trading timeframe
Configure which trendline types you want to display (Major/Minor, External/Internal, Up/Down)
Set up alerts for the specific trendline interactions you want to monitor
Look for price reactions at trendlines for potential trade entries
Use trendline breaks as confirmation for trend changes
Signals
Break Alerts: Triggered when price closes beyond a trendline
React Alerts: Triggered when price touches but respects a trendline
Major External: Most significant trendlines based on major pivot points
Major Internal: Secondary major trendlines within the trend structure
Minor External: Short-term trendlines for intraday movements
Minor Internal: Smallest scale trendlines for precise entries
Trendline Types Explained
Up Trendlines: Connect ascending lows, act as support
Down Trendlines: Connect descending highs, act as resistance
External: Connect the outermost pivots
Internal: Connect pivots within the major structure
Best Timeframes
Works effectively on all timeframes:
Scalping: 1m, 5m, 15m charts
Day Trading: 15m, 1H, 4H charts
Swing Trading: 4H, Daily, Weekly charts
Position Trading: Daily, Weekly, Monthly charts
Important Notes
The indicator repaints trendlines as new pivots form - this is by design to maintain accuracy
Historical trendlines that have been broken are automatically extended to show past levels
Use multiple timeframe analysis for best results
Combine with other indicators for trade confirmation
Always use proper risk management
Alert Integration
This indicator uses the TradingFinder Alert Library for enhanced alert functionality, providing detailed notifications for all trendline interactions.
Version History
v6: Current version with full alert integration and enhanced trendline validation
Disclaimer: This indicator is for educational and informational purposes only. Past performance does not guarantee future results. Always conduct your own analysis and use proper risk management when trading.
Note: This is an overlay indicator that draws directly on your price chart. Ensure you have sufficient chart history loaded for optimal performance.
Cloud Trendlines_Pro[vn]👉Hello Trader .
- This is the Kumo cloud trendline indicator (taken from the indicator) in my "trendline analysis" series.
- On the chart of this indicator, there is only 1 pair of trendlines that are closest to the clouds: 1 uptrend line and 1 downtrend line.
- Actually in the process of trading with the trendline of the price I see the price undulating and sometimes the trendline of the price has been broken but also not sure if the price is a real break or a fake break, from which I came up with the idea to include the Ichimoku indicator for analysis. The Ichimoku indicator gives a good "Long" signal when the price breaks above the Kumo cloud and an uptrend when the price is still above the cloud (mathematical formula for creating the cloud of the Kumo cloud). Ichimoku I won't repeat it again), from here I have studied the trend line of the Kumo cloud. Because when the cloud goes up, the price increases, when the cloud goes down, the price decreases, So when the clouds begin to flatten and If the cloud shows signs of crossing its trendline, it is a signal of trend reversal or continuation of the previous trend.
- So, when combining 2 trend lines: price trendline and cloud trendline, it allows me to filter false breakout price signals and give a stoploss very effectively, especially effective with 5m frames. ,15m to create a new trend.
- The best entry signal is when the 2 trendlines are parallel and tend to cluster and the "price candle" breaks the 2 trend lines of the price and the cloud at the same time (it is possible that the price reacts at this point a few candles). ).if in a small time frame we can enter the "Market" order, and on the H1 frame or higher, we can still enter the "Market" order or wait for the retest of these 2 trend lines to place an order.
- If only one of the above 2 trend lines is displayed, the trader can ignore it.
- This cloud trendline method is very effective when the price is in the sideway, the price is bumpy (can't draw the trendline of the price)...but look at the trendline of the cloud if the cloud breaks its trendline. then it is a signal for us to know that the price has come out of the sideway and we can enter an order in the direction of breaking the trendline of the cloud.
- Small timeframes such as 1m, 3m, 5m, 15m I leave the default (cannot be changed) in the setting item 'Length' = 50, the remaining time can be changed, the default is 50
- To adjust, you can go to the setting to set the time according to your needs.
- The color of the Clouds trendline should be the same color as the clouds.
Note:
👉Indicator "Cloud Trendlines_Pro " should be combined with indicator "Trendlines_Pro " to give the best signal
Below are the images taken from my transaction.
-----------------------------------------------------------------------------------------------------------------------------------------------------
Vietnamese
👉Xin chào Trader Việt nam.
- Đây là chỉ báo về đường xu hướng của mây Kumo(lấy từ chỉ báo ) trong chuỗi "phân tích với đường xu hướng" của tôi.
- Trên biểu đồ của chỉ báo này chỉ vẽ ra 1 cặp đường xu hướng đi sát nhất với mây là: 1 đường xu hướng tăng và 1 đường xu hướng giảm.
- Thực ra trong quá trình giao dịch với đường xu hướng của giá tôi thấy giá đi nhấp nhô và có khi đường xu hướng của giá đã bị phá vỡ nhưng cũng không chắc chắn là giá phá vỡ thật hay phá vỡ giả, từ đó tôi nảy ý tưởng đưa chỉ báo Ichimoku vào để phân tích.Chỉ báo Ichimoku cho tín hiệu "Long" tốt khi giá vượt lên đám mây Kumo và xu hướng tăng khi giá vẫn ở trên mây(công thức toán học để tạo lên đám mây của Ichimoku tôi xin không nhắc lại nữa), từ đây tôi đã nghiên cứu ra đường xu hướng của mây Kumo.Vì khi mây hướng lên thì cho giá tăng, mây hướng xuống thì cho giá giảm,Vậy khi mây bắt đầu đang bằng phẳng và mây có dấu hiệu cắt đường xu hướng của nó thì đó là điểm báo đảo chiều xu hướng hay tiếp diễn xu hướng trước đó.
- Như vậy khi kết hợp 2 đường xu hướng là :đường xu hướng của giá và đường xu hướng của mây cho tôi lọc được tín hiệu giá phá vỡ giả và cho điểm stoploss cũng cực hiệu quả, đặt biệt hiệu quả với các khung 5m,15m để tạo lên xu hướng mới.
- Tín hiệu vào lệnh đẹp nhất khi 2 đường xu hướng song song và có xu hướng chụm lại và "cây nến giá" phá vỡ đồng thời 2 đường xu hướng của giá và mây(có thể giá phản ứng tại điểm này vài cây nến).nếu ở khung thời gian nhỏ ta có thể vào lệnh "Thị trường", còn khung H1 trở lên ta có vẫn có thể vào lệnh "Thị trường" hoặc chờ retest lại 2 đường xu hướng này để đặt lệnh.
- Nếu chỉ hiển thị một trong 2 đường xu hướng trên thì trader có thể bỏ qua.
- Phương pháp đường xu hướng cloud này rất hiệu quả khi giá trong vùng sideway ,giá mấp mô(không kẻ được đường xu hướng của giá )...nhưng nhìn vào đường xu hướng của mây nếu mây phá vỡ đường xu hướng của nó thì đó là tín hiệu để ta biết là giá đã ra khỏi vùng sideway và ta có thể vào lệnh theo hướng phá vỡ đường xu hướng của mây.
- Các timeframe nhỏ như 1m, 3m, 5m ,15m tôi để mặc định (không thay đổi được) trong setting mục 'Length' = 50, các thời gian còn lại có thể thay đổi được ,mặc định là 0
- Để điều chỉnh có thể vào setting để thiết lập các thời gian theo nhu cầu.
- Màu của đường xu hướng Mây tôi để cùng màu với mây.
Note:
👉chỉ báo "Cloud Trendlines_Pro " nên kết hợp với chỉ báo "Trendlines_Pro " để cho tín hiệu tốt nhất
Auto Trendlines [AlgoXcalibur]Effortlessly visualize trendlines.
This algorithm does more than just draw lines connecting structural swing points — it reveals dynamic support & resistance breakouts with clarity and precision while significantly reducing your workload compared to the hassle of manually drawing trendlines.
🧠 Algorithm Logic
This advanced Auto Trendlines indicator delivers clear market structure through an intelligent multi-fractal design, revealing useful swing structures in real time. For those seeking maximum awareness, the optional Micro Trendlines (Dotted) constantly monitors even the most recent and minor structural shifts — keeping you fully in tune with evolving market dynamics. A Break Detection Engine constantly monitors each trendline and provides instant visual feedback when structural integrity is lost: broken lines turn gray, stop extending, and remain visible to enhance clarity and situational awareness. The algorithm is carefully refined to prevent chart distortion commonly caused by forcing entire trendline structures into view — preserving a natural and accurate charting experience. To further ensure optimal readability, an integrated Clutter Control mechanism limits the number of visible trendlines — focusing attention only on the most relevant structures.
⚙️ User-Selectable Features
• Micro Trendlines (Dotted): Ultra-responsive short-term trendlines that react to even the smallest structural shifts — ideal for staying ahead of early trend changes.
• Broken Trendline Declutter: Enable to display only the most recent broken trendlines to simplify chart visuals and maintain clarity, or disable to analyze previous price action.
💡 Modern Innovation
Auto Trendline indicators are often inaccurate, clumsy, and rely on slow methods that fail to adapt. AlgoXcalibur’s Auto Trendline indicator takes a modern, refined approach — combining smart pivot logic for both speed and stability, dynamic break detection with clear visual cues, and displaying only the most relevant trendlines while prioritizing accuracy, preventing distortion, and reducing clutter — automatically.
🔐 To get access or learn more, visit the Author’s Instructions section.
MTF Trendlines_Pro[vn]-This is an indicator for trendline traders
-it statistics the upper and lower trend lines of the Multi Time Frame.
-Pine Script strategy draws pivot points and trendlines on the chart.
-This strategy allows the user to specify the interval to calculate the pivot points and the number of pivot points used to generate the trend lines.
-I use the "Trendlines_Pro " indicator to interpret the indicator "MTF trendlines_Pro " indicator for everyone to understand
-time frames are selected in settings like 1m,3m,15m,1h,2h,4h,6h,12h,1D.1W.1Month..
-If the price is in a wedge pattern, it is represented by the upper and lower parameters, the upper parameter is the resistance point of the upper trendline,the lower parameter is the support point of the below trendline
-when the price distance is <=1% from the trendline, the upper or lower parameter is colored blue (above) or red (below).
-when only the parameter is accompanied by the ⇗ or ⇘. symbol, it tells us that the price has not broken the corresponding trend line
-when showing green heart and % break .indicates that the price has broken the downtrend line to become an uptrend.
On the contrary, the red heart % breaks, it signals us to break the uptrend line to become a downtrend
-when showing parameters 12(1)|18(2)|20(3) and green heart, then :(3) shows that the price has broken out before 20 candles, (2) shows that there are 18 candles to close above The breakout point, (1) represents the last 12 candles that closed above the breakout point and as if a nice uptrend has occurred because 98% of the candles have closed above the breakout point....the opposite of The red heart is the price that broke below the trendline below.
-"MTF trendlines_Pro "indicator is integrated for both the trendline of the price line and the RSI. You can change it in the settings as shown below.
----------------------------------------------------------------------------
vietnamese
-Đây là chỉ báo dành cho các trader thuộc trường phái phân tích đường xu hướng
-nó thống kê các đường xu hướng trên và dưới của Multi Time Frame.
-Chiến lược Pine Script vẽ các điểm trục và đường xu hướng trên biểu đồ.
-Chiến lược này cho phép người dùng chỉ định khoảng thời gian tính toán các điểm xoay và số điểm xoay được sử dụng để tạo các đường xu hướng .
-tôi có dùng chỉ báo trendline_pro dùng để diễn giải chỉ báo MTF trendlines_pro cho mọi người dễ hiểu
-các khung thời gian được lựa chọn trong cài đặt như 1m,3m,15m,1h,2h,4h,6h,12h,....
-Nếu giá đang trong mô hình cái nêm thì được thể hiện bằng tham số trên và tham số dưới, tham số trên là điểm kháng cự của đường xu hướng bên trên,tham số dưới là điểm hỗ trợ của đường xu hướng bên dưới
-khi giá cách đường xu hướng <=1% thì tham số trên hoặc dưới được tô màu xanh (trên) hoặc đỏ(dưới)
-khi chỉ có tham số kèm theo biểu tượng ⇗ or ⇘.thì cho ta biết là giá chưa phá vỡ được đường xu hướng tương ứng
-khi hiện trái tim xanh và % phá vỡ .báo hiệu cho ta biết giá đã phá vỡ đường xu hướng giảm trở thành xu hướng tăng.
ngược lại trái tim đỏ % phá vỡ thì báo hiệu cho ta phá vỡ đường xu hướng tăng trở thành xu hướng giảm
-khi hiện thông số 12(1)|18(2)|20(3) và trái tim xanh thì :(3) thể hiện giá đã phá vỡ trước đó 20 nến,(2) thể hiện có 18 cây nến đóng cửa trên điểm phá vỡ,(1) thể hiện có 12 nến gần nhất đóng cửa trên điểm phá vỡ và như vạy xu hướng tăng đẹp đã xảy ra vì chiếm đến 98% nến đã đóng cửa trên điểm phá vỡ....ngược lại với trái tim đỏ là giá đã đột phá xuống dưới đường xu hướng bên dưới
-chỉ báo MTF trendlines_pro được tích hợp chung cho cả trendline của đường giá và RSI .các bạn có thể thay đổi trong phần cài đặt như hình bên dưới.
Auto Trendlines (Finviz Style)Oculus Auto Trendlines
Version 1.0 | Pine Script v6
Overview
Oculus Auto Trendlines automatically identifies and plots the most significant support and resistance trendlines by connecting the two most recent swing highs (resistance) and swing lows (support) over a user-defined pivot lookback. Each line extends dynamically to the right, recalculates in real time, and self-invalidates when price decisively breaks beyond it by a configurable tolerance.
Key Features
Automatic Pivot Detection
Uses ta.pivothigh and ta.pivotlow over your chosen bar span to pinpoint significant market turning points.
Dynamic Trendline Drawing
Connects the last two valid pivots to form support and resistance lines that update and extend to the right each bar.
Break-Triggered Refresh
When price closes beyond a drawn trendline by more than the break tolerance, that line is removed and a new one is drawn from the next valid pivots.
Configurable Sensitivity
Pivot Lookback: Number of bars on each side to define swings.
Break Tolerance: Percentage buffer to prevent false invalidations on minor wicks.
Clean Overlay
Minimal code and plotting ensures your chart remains uncluttered—only one support and one resistance line are visible at any time.
How to Use
Add to Chart: Apply “Oculus Auto Trendlines” to any symbol and timeframe.
Set Inputs:
Pivot Lookback: Larger values produce smoother, longer-term lines; smaller values react faster to recent price.
Break Tolerance (%): Adjust to allow for minor wicks or noise without resetting lines.
Read Trendlines:
The red resistance line connects the two most recent swing highs.
The green support line connects the two most recent swing lows.
Lines automatically redraw when invalidated by a clean break beyond tolerance.
Combine with Other Analysis: Use these auto-drawn trendlines alongside indicators like moving averages, volume, or price patterns for stronger confluence.
Inputs
Pivot Lookback: 10 (bars each side)
Break Tolerance (%): 0.2%
Version History
1.0 – Initial release with real-time pivot detection, auto-updating trendlines, and break validation.
Disclaimer
This indicator is provided for educational purposes. Always backtest settings on historical data, verify trendline relevance, and apply proper risk management before trading live.
ZigZag with Trend, EMA & TrendlinesIntroduction to the "ZigZag with Trend, EMA & Trendlines" Indicator
The "ZigZag with Trend, EMA & Trendlines" indicator is a comprehensive tool designed to assist traders in identifying market trends, key turning points, and dynamic price movements. By combining ZigZag patterns, Trendline analysis, and Exponential Moving Averages (EMA), this indicator offers multiple perspectives to help traders spot trend reversals, support/resistance zones, and potential buy/sell signals.
Key Features:
ZigZag Pattern Identification:
The ZigZag algorithm captures significant price swings, filtering out smaller price movements. This highlights the most relevant highs and lows, allowing traders to visualize the market's broader trend and anticipate reversals.
Customizable Swing Length: Traders can adjust the sensitivity of the ZigZag pattern by modifying the swing length, offering flexibility in detecting both short-term and long-term price patterns.
Adjustable ZigZag Color: You can change the color of the ZigZag line in the settings, making it easy to customize for visual preference.
Trend Analysis:
Trend Calculation: The indicator calculates the average trend by using a maximum and minimum price-based algorithm. This highlights whether the market is trending upwards (bullish) or downwards (bearish).
Buy/Sell Signals: Automatic buy and sell signals are plotted based on the crossing of trend lines, making it easier for traders to act on trend reversals.
The indicator uses dynamic colors—green for bullish and red for bearish trends.
Exponential Moving Averages (EMA):
The indicator includes three important EMAs—34, 89, and 200 periods—commonly used by traders to gauge the overall direction and momentum of the market.
EMA 34 (green) is suited for short-term trends, EMA 89 (yellow) for mid-term trends, and EMA 200 (red) for long-term market direction.
These EMAs are plotted on the chart, making it easy to determine potential crossover points and trend continuation signals.
Trendlines:
Automatic Trendline Drawing: Based on significant pivot highs and pivot lows, the indicator automatically draws trendlines on the chart. This visual representation of support and resistance helps traders anticipate future price movements.
Customizable Trendline Color: Uptrend and downtrend lines are plotted with customizable colors, providing clarity when the market is shifting between bullish and bearish conditions.
Trendline Period Setting: The trendline drawing period can be adjusted, allowing for more flexibility depending on the market's volatility.
How to Use:
Trend Confirmation: Use the combination of ZigZag patterns and EMAs to confirm the current trend direction. The ZigZag line will show the major swing highs and lows, while the EMAs will provide a broader understanding of trend strength and potential reversals.
Buy/Sell Signals: Look for crossovers between the average trend and the price to receive automatic buy (green) and sell (red) signals.
Support/Resistance: The automatically drawn trendlines based on pivot points offer valuable support and resistance levels that traders can use to set stop losses or take profits.
Conclusion:
The "ZigZag with Trend, EMA & Trendlines" indicator offers a unique combination of price action and trend-following tools. This all-in-one solution allows traders to visualize market structure, identify key price points, and confirm trends. It's a powerful tool for traders looking to capitalize on both short-term and long-term market movements, making it an essential addition to any trading strategy.
{20}Dashboard Trendlines & Wedge_Pro[vn]This is a script about 20 trading pairs with trendline.
-on each chart of a trading pair, there is only one trendline pair: 1 uptrendline and 1 downtrendline
-so when the statistics on the table also show the column of the uptrend and the column of the downtrend
-When the price approaches any trendline but the ratio is 1%, that trendline will be colored blue (downtrend), red (uptrend)
The column ✎ T.line-trendline above(✐ T.line-trendline below) is the value of the current trendline compared to the closing price of the candle
The ══════\n\𝖗𝖊𝖘𝖎𝖘𝖙𝖆𝖓(𝖘𝖚𝖕𝖕𝖔𝖗𝖙\n\══════) column when the price breaks will show ➊ (the is the first candle) and the percentage value when breaking through the point of the trendline.
Especially when a candle has closed above the trendline (assuming an uptrend), then from the 2nd tree to the current , it will count according to memory so that traders know when the price broke, and how many candles already.
The parameter when breaking is displayed < 10, it means that the price has broken through 10 candles, and the first 10 candles are colored yellow, then the color returns to normal.
In addition, when displaying 3 parameters as above, the next column (above/below T.line) will display the percentage from when the price breaks that point to the current price of the candle.
Wedge column is when the price is stuck between the upper and lower trendlines, if the sharp angle ratio is <=10%, the new column will show the value (and the text color is white) until it breaks to the bottom. 1 direction is left is hidden
Price column is the current price of the candle and the parameter 20:2 is the length of the trendline and to combine the same parameter with the indicator "Trendlines_pro "
You can change the time in Resolution indicator settings to show multiple time display the same cell as the price cell
The up arrow icons 🡹 represent the price broke upwards , the down arrows 🡻 represent the price broke below
------------------------------------------------------------------------------------------------------------------------------------------------------
Vietnamese
Đây là script về bảng thống kê 20 cặp giao dịch với đường trendline .
-trên mỗi biểu đồ của cặp giao dịch chỉ tồn tại duy nhất 1 cặp trendline là: 1trendline tăng và 1 trendline giảm
-vì vậy khi thống kê trên bảng cũng hiển thị cột của trend tăng và cột của trend giảm
-khi giá tiến gần đến 1 đường trendline bất kì mà tỉ lệ còn 1% thì đường trendline đó tô màu xanh(trend giảm) ,màu đỏ(trend tăng)
-cột ✎ T.line-đường trendline bên trên(✐ T.line-đường trendline bên dưới) là giá trị của đường trendline hiện tại so với giá đóng cửa của nến
-cột ══════\n\𝖗𝖊𝖘𝖎𝖘𝖙𝖆𝖓(𝖘𝖚𝖕𝖕𝖔𝖗𝖙\n\══════) khi giá phá vỡ sẽ thể thiện ➊(tức là cây nến đầu tiên) và giá trị phần trăm khi phá qua điểm của trendline.
-đặc biệt khi 1 cây nến đã đóng cửa trên đường trendline(giả sử trend tăng) thì từ cây thứ 2 đến hiện tại nó sẽ đếm theo bộ nhớ để các trader biết được giá đã phá khi nào,và qua bao nhiêu nến rồi.
-thông số khi phá vỡ hiển thị < 10 thì hiểu là giá đã phá vỡ qua 10 nến, và 10 nến đầu tiên được tô màu vàng ,sau đó màu trở lại trạng thái bình thường
-ngoài ra khi hiện thông số như trên thì cột bên cạnh (above/below T.line) sẽ hiển thị được số phần trăm tính từ khi giá phá vỡ điểm đó đến giá hiện tại của cây nến.
-cột Wedge(cái nêm) là khi giá đang bị kẹt giữa 2 đường trendline trên và dưới ,nếu tỷ lệ góc nhọn <=10% thì cột đó mới hiện giá trị (và màu chữ là trắng) cho đến khi phá vỡ về 1 hướng nào đó còn lại là bị ẩn
-cột giá là giá hiện tại của nến và thông số 20:2 là độ dài đường trendline và để kết hợp cùng thông số với chỉ báo "Trendlines_pro "
-các bạn có thể thay đổi thời gian trong cài đặt chỉ báo Resolution để hiển thị nhiều cung thời gian hiển thị cùng ô với ô giá
-các biểu tượng mũi tên lên 🡹 thể hiện giá phá vỡ lên trên ,mũi tên xuống 🡻 thể hiện giá đã phá vỡ xuống dưới
Cảm ơn mọi người đã quan tâm và tin dùng
SPX Trendlines with VIX Levels By- Profit gang
This comprehensive technical analysis tool combines SPX trendline analysis with VIX volatility levels to help identify potential market turning points. The indicator is specifically designed with non-repainting logic to ensure reliability for both backtesting and live trading.
🔧 KEY FEATURES:
Non-Repainting Design: All signals and lines are drawn only on confirmed bars using barstate.isconfirmed
Dynamic Trendlines: Automatically draws support and resistance lines connecting recent pivot points
VIX Integration: Displays current VIX levels with customizable thresholds for market sentiment analysis
Multiple Visual Elements: Includes diagonal trendlines, horizontal level lines, and an information table
Comprehensive Alerts: Configurable alert system for both buy and sell signals
Clean Interface: Organized inputs and customizable colors for all elements
📊 TRADING CONCEPT:
The indicator utilizes the inverse relationship between VIX and SPX:
High VIX at pivot lows may indicate oversold conditions (potential buying opportunities)
Low VIX at pivot highs may signal complacency at market tops (potential caution zones)
🎛️ CUSTOMIZATION OPTIONS:
Toggle trendlines, VIX labels, and level lines independently
Adjust VIX thresholds (default: 25 high, 18 low)
Customize pivot length for sensitivity (default: 15)
Choose line styles (solid, dashed, dotted) and widths
Personalize all colors and alert preferences
📈 VISUAL COMPONENTS:
Red Lines: Resistance levels and trendlines
Green Lines: Support levels and trendlines
Information Table: Real-time VIX status and current levels
Signal Shapes: Triangle markers for confirmed buy/sell signals
Background Highlighting: Optional signal emphasis
⚠️ EDUCATIONAL PURPOSE:
This indicator is designed for educational and informational purposes. Past performance does not guarantee future results. Always conduct your own research and consider risk management before making trading decisions.
🔔 ALERT SYSTEM:
Separate alerts for buy and sell signals
All alerts trigger only on confirmed bars
Customizable alert messages with price and VIX data
Multiple alert condition options for flexible setup
Perfect for traders who want to combine technical analysis with volatility sentiment in a reliable, non-repainting format.
Ultra TrendlinesThis indicator automatically draws trendlines based on every pivot point, helping traders visualize key support and resistance levels. It dynamically adjusts as new pivots are detected and validates the trendlines against price movement.
Introduction
The Ultra Trendlines indicator is designed to help traders identify and track significant trendlines on their charts. By automatically detecting pivot points (both highs and lows), it draws trendlines that highlight key market movements. These trendlines are valuable for understanding the broader trend and for making informed trading decisions.
Detailed Description
The indicator analyzes price data to find pivot points highs and lows over a user-defined lookback period. Once a pivot is detected, it draws trendlines between the pivot points.
.........
Accuracy
To ensure accuracy, the indicator only keeps trendlines that are confirmed by price action. It checks if the price crosses the trendline and deletes invalid lines.
Additionally, it checks if the trendlines stay within predefined price thresholds, filtering out irrelevant lines that are too far from current price action.
The indicator also has an option to only show "rising lows" and "falling highs" trendlines, offering further precision in trend direction.
As new pivots are detected, older trendlines that fall outside the lookback period are removed, ensuring the chart remains clean.
.....
Style
The trendlines can extend forward (infinite and userdefined), backward, both or none. The lines are drawn with a customizable style (solid, dotted, or dashed), color, and width.
.........
Summary of Key Points
The indicator automatically detects pivot points (highs and lows) and draws trendlines based on them. It allows you to customize the style, color, and width of the trendlines. The indicator filters out invalid trendlines by checking if they are still relevant based on price action and price thresholds. Additionally, you can choose to only display rising lows and falling highs for more accurate trend analysis. It also removes outdated trendlines to keep the chart clean.
Market Structure - HH, HL, LH, LL with Trendlines & AlertsMarket Structure Script – HH, HL, LH, LL with Trendlines & Alerts
This Pine Script is designed to help identify key market structure patterns such as Higher Highs (HH), Higher Lows (HL), Lower Highs (LH), and Lower Lows (LL) on price charts. It also draws trendlines connecting the respective swing points and provides alerts when these important price patterns occur.
Key Features:
Swing High and Low Detection:
The script uses the ta.pivothigh and ta.pivotlow functions to identify significant swing highs and swing lows based on the pivot length (pivotLen). These points mark local peaks and troughs in the price action.
Dynamic Pivot Length:
The script adjusts the pivotLen (which defines the number of bars used to calculate swing points) based on the current timeframe of the chart. For example, for a 15-minute chart, it uses a pivot length of 5 bars, while for a daily chart, it uses 10 bars. This dynamic adjustment ensures that the script works across different timeframes.
Higher Highs (HH), Higher Lows (HL), Lower Highs (LH), Lower Lows (LL):
Higher High (HH): Identifies a price peak that is higher than the previous swing high, indicating an uptrend.
Higher Low (HL): Identifies a price trough that is higher than the previous swing low, supporting the idea of an ongoing uptrend.
Lower High (LH): Identifies a price peak that is lower than the previous swing high, suggesting a potential reversal or downtrend.
Lower Low (LL): Identifies a price trough that is lower than the previous swing low, indicating a downtrend.
Trendlines:
For each identified Higher High, Higher Low, Lower High, or Lower Low, the script automatically draws a trendline connecting the corresponding swing points. These trendlines provide a visual representation of the market’s price structure, showing support and resistance levels.
Labels:
The script places labels on the chart next to the respective swing points. These labels mark whether the point is a Higher High (HH), Higher Low (HL), Lower High (LH), or Lower Low (LL). This helps traders easily visualize the price pattern at a glance.
Alerts:
Alert conditions are set for when a Higher High (HH), Higher Low (HL), Lower High (LH), or Lower Low (LL) is detected. Users can set up alerts to be notified whenever one of these key market structure patterns forms. Alerts are an essential feature for traders who want to act quickly when important trend changes are happening.
Auto TrendLines [TradingFinder] Support Resistance Signal Alerts🔵 Introduction
The trendline is one of the most essential tools in technical analysis, widely used in financial markets such as Forex, cryptocurrency, and stocks. A trendline is a straight line that connects swing highs or swing lows and visually indicates the market’s trend direction.
Traders use trendlines to identify price structure, the strength of buyers and sellers, dynamic support and resistance zones, and optimal entry and exit points.
In technical analysis, trendlines are typically classified into three categories: uptrend lines (drawn by connecting higher lows), downtrend lines (formed by connecting lower highs), and sideways trends (moving horizontally). A valid trendline usually requires at least three confirmed touchpoints to be considered reliable for trading decisions.
Trendlines can serve as the foundation for a variety of trading strategies, such as the trendline bounce strategy, valid breakout setups, and confluence-based analysis with other tools like candlestick patterns, divergences, moving averages, and Fibonacci levels.
Additionally, trendlines are categorized into internal and external, and further into major and minor levels, each serving unique roles in market structure analysis.
🔵 How to Use
Trendlines are a key component in technical analysis, used to identify market direction, define dynamic support and resistance zones, highlight strategic entry and exit points, and manage risk. For a trendline to be reliable, it must be drawn based on structural principles—not by simply connecting two arbitrary points.
🟣 Selecting Pivot Types Based on Trend Direction
The first step is to determine the market trend: uptrend, downtrend, or sideways.
Then, choose pivot points that match the trend type :
In an uptrend, trendlines are drawn by connecting low pivots, especially higher lows.
In a downtrend, trendlines are formed by connecting high pivots, specifically lower highs.
It is crucial to connect pivots of the same type and structure to ensure the trendline is valid and analytically sound.
🟣 Pivot Classification
This indicator automatically classifies pivot points into two categories :
Major Pivots :
MLL : Major Lower Low
MHL : Major Higher Low
MHH : Major Higher High
MLH : Major Lower High
These define the primary structure of the market and are typically used in broader structural analysis.
Minor Pivots :
mLL: minor Lower Low
mHL: minor Higher Low
mHH: minor Higher High
mLH: minor Lower High
These are used for drawing more precise trendlines within corrective waves or internal price movements.
Example : In a downtrend, drawing a trendline from an MHH to an mHH creates structural inconsistency and introduces noise. Instead, connect points like MHL to MHL or mLH to mLH for a valid trendline.
🟣 Drawing High-Precision Trendlines
To ensure a reliable trendline :
Use pivots of the same classification (Major with Major or Minor with Minor).
Ensure at least three valid contact points (three touches = structural confirmation).
Draw through candles with the least deviation (choose wicks or bodies based on confluence).
Preferably draw from right to left for better alignment with current market behavior.
Use parallel lines to turn a single trendline into a trendline zone, if needed.
🟣 Using Trendlines for Trade Entries
Bounce Entry: When price approaches the trendline and shows signs of reversal (e.g., a reversal candle, divergence, or support/resistance), enter in the direction of the trend with a logical stop-loss.
Breakout Entry: When price breaks through the trendline with strong momentum and a confirmation (such as a retest or break of structure), consider trading in the direction of the breakout.
🟣 Trendline-Based Risk Management
For bounce entries, the stop-loss is placed below the trendline or the last pivot low (in an uptrend).
For breakout entries, the stop-loss is set behind the breakout candle or the last structural level.
A broken trendline can also act as an exit signal from a trade.
🟣 Combining Trendlines with Other Tools (Confluence)
Trendlines gain much more strength when used alongside other analytical tools :
Horizontal support and resistance levels
Moving averages (such as EMA 50 or EMA 200)
Fibonacci retracement zones
Candlestick patterns (e.g., Engulfing, Pin Bar)
RSI or MACD divergences
Market structure breaks (BoS / ChoCH)
🔵 Settings
Pivot Period : This defines how sensitive the pivot detection is. A higher number means the algorithm will identify more significant pivot points, resulting in longer-term trendlines.
Alerts
Alert :
Enable or disable the entire alert system
Set a custom alert name
Choose how often alerts trigger (every time, once per bar, or on bar close)
Select the time zone for alert timestamps (e.g., UTC)
Each trendline type supports two alert types :
Break Alert : Triggered when price breaks the trendline
React Alert : Triggered when price reacts or bounces off the trendline
These alerts can be independently enabled or disabled for all trendline categories (Major/Minor, Internal/External, Up/Down).
Display :
For each of the eight trendline types, you can control :
Whether to show or hide the line
Whether to delete the previous line when a new one is drawn
Color, line style (solid, dashed, dotted), extension direction (e.g., right only), and width
Major lines are typically thicker and more opaque, while minor lines appear thinner and more transparent.
All settings are designed to give the user full control over the appearance, behavior, and alert system of the indicator, without requiring manual drawing or adjustments.
🔵 Conclusion
A trendline is more than just a line on the chart—it is a structural, strategic, and flexible tool in technical analysis that can serve as the foundation for understanding price behavior and making trading decisions. Whether in trending markets or during corrections, trendlines help traders identify market direction, key zones, and high-potential entry and exit points with precision.
The accuracy and effectiveness of a trendline depend on using structurally valid pivot points and adhering to proper market logic, rather than relying on guesswork or personal bias.
This indicator is built to solve that exact problem. It automatically detects and draws multiple types of trendlines based on actual price structure, separating them into Major/Minor and Internal/External categories, and respecting professional analytical principles such as pivot type, trend direction, and structural location.
Machine Learning Trendlines Cluster [LuxAlgo]The ML Trendlines Cluster indicator allows traders to automatically identify trendlines using a machine learning algorithm based on k-means clustering and linear regression, highlighting trendlines from clustered prices.
For trader's convenience, trendlines can be filtered based on their slope, allowing them to filter out trendlines that are too horizontal, or instead keep them depending on the user-selected settings.
🔶 USAGE
Traders only need to set the number of trendlines (clusters) they want the tool to detect and the algorithm will do the rest.
By default the tool is set to detect 4 clusters over the last 500 bars, in the image above it is set to detect 10 clusters over the same period.
This approach only focuses on drawing trendlines from prices that share a common trading range, offering a unique perspective to traditional trendlines. Trendlines with a significant slope can highlight higher dispersion within its cluster.
🔹 Trendline Slope Filtering
Traders can filter trendlines by their slope to display only steep or flat trendlines relative to a user-defined threshold.
The image above shows the three different configurations of this feature:
Filtering disabled
Filter slopes above threshold
Filter slopes below threshold
🔶 DETAILS
K-means clustering is a popular machine-learning algorithm that finds observations in a data set that are similar to each other and places them in a group.
The process starts by randomly assigning each data point to an initial group and calculating the centroid for each. A centroid is the center of the group. K-means clustering forms the groups in such a way that the variances between the data points and the centroid of the cluster are minimized.
The trendlines are displayed according to the linear regression function calculated for each cluster.
🔶 SETTINGS
Window Size: Maximum number of bars to get data from
Clusters: Maximum number of clusters (trendlines) to detect
🔹 Optimization
Maximum Iteration Steps: Maximum loop iterations for cluster computation
🔹 Slope Filter
Threshold Multiplier: Multiplier applied to a volatility measure, higher multiplier equals higher threshold
Filter Slopes: Enable/Disable Trendline Slope Filtering, select to filter trendlines with slopes ABOVE or BELOW the threshold
🔹 Style
Upper Zone: Color to display in the top zone
Lower Zone: Color to display in the bottom zone
Lines: Style for the lines
Size: Line size
All Possible Trendlines W/AlertsCore Functionality:
Trendline Detection: The system uses a proprietary algorithm that goes beyond traditional pivot point connection methods. It analyzes price action patterns and market structure to identify potential trendlines that many traders might overlook. This includes not just obvious trendlines, but also subtle ones that could become significant in the future.
Significance Evaluation: Unlike conventional indicators that treat all trendlines equally, the system employs a unique scoring system to evaluate each trendline's importance. This system considers factors such as the number of touch points, the length of the trendline, and its historical reliability in predicting price movements. This allows traders to focus on the most relevant trendlines.
Dynamic Updating: The AITI continuously reassesses and adjusts trendlines as new price data becomes available. This dynamic approach ensures that the indicator adapts to changing market conditions, providing up-to-date and relevant information.
What Makes It Original:
The AITI's originality lies in its holistic approach to trendline analysis. While most indicators focus on identifying a few key trendlines, this system aims to present a complete picture of all possible trendlines in the market. This comprehensive view allows traders to:
- Gain deeper insights into market structure and potential price movements.
- Identify less obvious but potentially significant trendlines that other traders might miss.
- Understand the relative importance of different trendlines, rather than treating all trendlines as equally significant.
The indicator's ability to dynamically update and re-evaluate trendlines in real-time sets it apart from static trendline tools. This ensures that traders always have the most current and relevant information at their disposal.
By providing a more nuanced and complete view of trendlines, the AITI enables traders to make more informed decisions based on a deeper understanding of market structure. This approach to trendline analysis is not readily available in open-source alternatives, making the AITI a valuable tool for traders seeking a more comprehensive technical analysis solution.
Simple Trendlines📈 Trendlines, made easy.
Simple Trendlines is a carefully made library that provides an easy and accessible way to draw trendlines on the chart.
Containing only 10 properties and 2 methods, the implementation is designed to be understandable through an object-oriented structure and provides developers the opportunity to expand without having to deal with slope calculation while also ensuring that there's no leakage between the trendlines before they're drawn.
Developers only need to provide 5 expressions to get everything up in running. This includes the following but is not limited to
The x-axis
Point A (Y1 Value)
Point B (Y2 Value)
A condition to draw the line
A condition to keep the trendline under continuation
Automatic x-axis calculation is not a built-in feature due to the inconsistency it could bring.
📕 Quick Example
import HoanGhetti/SimpleTrendlines/1 as tl
input_len = input.int(defval = 10)
pivotLow = fixnan(ta.pivotlow(input_len, input_len))
xAxis = ta.valuewhen(ta.change(pivotLow), bar_index, 0) - ta.valuewhen(ta.change(pivotLow), bar_index, 1)
prevPivot = ta.valuewhen(ta.change(pivotLow), pivotLow, 1)
pivotCondition = ta.change(pivotLow) and pivotLow > prevPivot
plData = tl.new(x_axis = xAxis, offset = input_len)
plData.drawLine(pivotCondition, prevPivot, pivotLow)
plData.drawTrendline(close > 0)
plData.lines.trendline.set_style(line.style_dashed)
plData.lines.trendline.set_width(2)
plData.lines.startline.set_width(2)
Excluding the styling at the bottom, that was only 8 lines of code which yields the following result.
⏳ Before continuing
The library does not support block-scoped execution. Conditions must be declared before and integrated as a parameter. This doesn't limit any capabilities and only involves thinking logically about precedence. It was made this way for code readability and to keep things organized.
The offset value inside the TrendlineSettings object can potentially affect performance (although very minimal) if you're using strict mode. When using strict mode, it loops through historical values to then do backend calculations.
🔽 Getting Started 🔽
Creating trendlines without a library isn't a hard task. However, the library features a built-in system called strict mode. We'll dive further into this below.
Creating an Instance
You can create an instance of the library by calling the new() function. Passing an identifier is conventionally mandatory in this case so you can reference properties and methods.
import HoanGhetti/SimpleTrendlines/2 as tl
lineData = tl.new(int x_axis, int offset, bool strictMode, int strictType)
___
int x_axis (Required) The distance between point A and point B provided by the user.
int offset (Optional) The offset from x2 and the current bar_index. Used in situations where conditions execute ahead of where the x2 location is such as pivót events.
bool strictMode (Optional) Strict mode works in the backend of things to ensure that the price hasn't closed below the trendline before the trendline is drawn.
int strictType (Optional) Only accepts 0 and 1, 0 ensures that the price during slope calculation is above the line, and 1 ensures that the price during slope calculation is below the line.
The Initial Line
After instantiating the library, we can go ahead use the identifer we made above and create an instance of our initial line by calling the drawLine() method.
lineData.drawLine(bool condition, float y1, float y2, float src)
___
bool condition (Required) The condition in order to draw a new line.
float y1 (Required) The y-value of point A.
float y2 (Required) The y-value of point B.
float src (Optional) Determines which value strict mode will actively check for leakage before a trendline is drawn.
Typically used if you're not referencing OHLC values for your y-values, or you want to check for another value to exceed the line besides using the close value.
The Trendline
The trendline that gets drawn solely uses the values of the initial line and can be called using the drawTrendline() method. The library enforces a condition as a parameter in order to maintain simplicity.
lineData.drawTrendline(bool condition)
___
bool condition (Required) The condition in order to maintain and continue drawing the trendline.
⚙️ Features
🔹 Automatic Slope Calculation
In the background, the library calculates the next Y2 and X2 values on every tick for the trendline. Preventing the developer from having to do such a process themself.
🔹 Object-Oriented
Each object contains manipulative properties that allow the developer to debug and have the freedom they want.
🔹 Enforced Error Checking
Runtime errors have been put in place to ensure you're doing things correctly.
🔹 Strict Mode & Offset
Strict mode can only be used when the offset value is over 0. It's a feature that's only meant to function under scenarios where a condition executes further than where the X2 is relative to the current bar_index value.
Let's think about pivot systems. As you're aware, pivot events are detected based on historical factors. If a swing low occurred nth bars ago, then the pivot condition will execute at the current bar_index instead of executing nth bars back.
Now because of this, what if you wanted to draw a trendline when the pivot event is executed? The offset value takes care of this just as you would when developing your other scripts, basically how we always do bar_index - n. However, what does this mean for strict mode?
The photo below represents the logic behind the execution.
When looking at this image, imagine this just happened, the event just executed and the trendline is now drawn. Pay attention to all the values inside the surrounding box. As you can see there are some candles that closed below the trendline before the trendline was drawn.
From what I can see 5-6 candles closed below the trendline during slope calculation. The goal of strict mode is to be a provisional system that prevents such occurrences from happening.
Here's a photo with strict mode on.
🔹 Strict Type
A parameter used in the new() function that acts as a representation of what strict mode should calculate for. It accepts only two values, 0 and 1.
0 - Ensures that all candles have closed above the trendline before the trendline is drawn.
1 - Ensures that all candles have closed below the trendline before the trendline is drawn.
In the most recent photo above, I used 0 for strict type, since I was wanting to have a clean trendline and ensure that not a single candlestick closed below.
If you want to reference something else besides the close value during strict mode calculation, you can change it in the drawLine() method.
If it's still difficult to understand, think 0 for pivot lows, and 1 for pivot highs.
📕 Methods and Property Inheritance
The library isn't crazy, but hopefully, it helps.
That is all.👍
Auto Trendlines [RG]Auto Trendlines
Overview
Auto Trendlines automatically identifies, draws, and manages dynamic support and resistance trendlines based on pivot points. It continuously monitors price action to validate and update trendlines.
Key Features
Automatically identifies support (green) and resistance (red) trendlines
Validates trendlines against historical price action
Configurable lookback period and maximum active lines
Clean visualization with customizable line widths
How It Works
The indicator detects pivot highs and lows using your specified lookback period
It connects consecutive pivots to create potential trendlines
Lines are extended to the right until a confirmed price break
Older lines are automatically removed when the maximum is reached
Customization Options
Lookback Period: Controls the sensitivity of pivot detection
Maximum Active Lines: Limits the number of trendlines displayed
Line Width: Separate width controls for support and resistance lines
Ideal For
Identifying dynamic support and resistance levels.
Spotting potential reversal zones.
This indicator will help you identify trendlines, which you can then sophisticate and redraw more accurately. Please use this indicator only to identify trendline scenarios. Keep in mind that this is not a buy and sell indicator. Trendline breaks and bounces are not always respected, as prices can turn around at any moment. Happy Trading :)