Trendlines, Support, Resistance and Fibonacci With AlertsHello Traders :)
I am Only Fibonacci.
I would like to give you detailed information about this indicator that I have prepared.
Within this indicator, you can see falling trends, rising trends, support and resistance, as well as Fibonacci levels.
I've prepared a few extra nice things for you. With this indicator, you can see the instant values of the active trend lines and their distance from the price. In my opinion, one of the best aspects of this indicator is that it can set alarms for automatically drawn trends. You can add alarms for both downtrend and uptrend.
The alarm is triggered at the break of the trend closest to the price.
Note: I do not recommend adding an alarm without thoroughly using the indicator.
We are now ready to introduce.
You can use this indicator in two languages. English and Turkish. The choice is yours.
When we enter the indicator settings, there is a group under the TREND heading. With the settings in this group, you can determine the sensitivity of the trends to be plotted. The lower the sensitivity, the less reliable the plotted trends will be. I am sure you will find the middle ground.
Trends are calculated by relationships between all detected peaks.
If you check the Show Data box, you can see the value of the active ( unbroken ) trends in the current candle. Sometimes it can create visual pollution. So you can remove it. Below will be a version view where the values of the trendlines are not visible.
If you don't want to see the trends on the chart at all, uncheck the Show Trends box.
One of our subtitles is Fibonacci.
When you enter the number of bars that need to be checked backwards, it finds the highest and lowest levels in the past bars, and automatically draws fibonacci levels on the screen with a beautiful visual.
If you don't want to see Fibonacci on your chart, you can uncheck the Fibonacci Show box.
Our last topic is support and resistances.
We need a certain sensitivity setting to see support and resistance on the chart. The sensitivity setting will provide you with more realistic data. I am sure that you can adjust the correct settings in this regard as well. If you don't want to see any or both support or resistance on the chart, you can uncheck the Show Resistance or Show Support boxes.
Alarm
Active downtrends and rising trends are kept on the chart. If you want to be notified on the falling trend break closest to the price, you should choose DownTrend Breakdown.
If you want to be notified on the breakout of the rising trend closest to the price, you should choose UpTrend Breakdown.
Visuality
Downtrends are covered by a filled line between the two points. It continues with a dashed line from the second peak to the active candle. When the trend is broken, it disappears. It is red in color.
Uptrends are covered by a filled line between the two points. It continues with a dashed line from the second bottom to the active candle. When the trend is broken, it disappears. It is green in color.
The resistances are determined to cover the entire wick from the starting point to the active candle. It is red in color. It disappears when the resistance is broken.
Supports are determined to cover the entire wick from the starting point to the active candle. It is green in color. It disappears when the support is broken.
Use the link below to access this indicator.
在腳本中搜尋"TRENDLINES"
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
[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.
RSI Trendlines and Divergences█OVERVIEW
The "RSI Trendlines and Divergences" indicator is an advanced technical analysis tool that leverages the Relative Strength Index (RSI) to draw trendlines and detect divergences. Designed for traders seeking precise market signals, the indicator identifies key pivot points on the RSI chart, draws trendlines between pivots, and detects bullish and bearish divergences. It offers flexible settings, background coloring for breakout signals, and divergence labels, supported by alerts for key events. The indicator is universal and works across all markets (stocks, forex, cryptocurrencies) and timeframes.
█CONCEPTS
The indicator was developed to provide an alternative signal source for the RSI oscillator. Trendline breakouts and bounces off trendlines offer a broader perspective on potential price behavior. Combining these with traditional RSI signal interpretation can serve as a foundation for creating various trading strategies.
█FEATURES
- RSI and Pivot Calculation: Calculates RSI based on the selected source price (default: close) with a customizable period (default: 14). Identifies pivot points on RSI and price for trendlines and divergences.
- RSI Trendlines: Draws trendlines connecting RSI pivots (upper for downtrends, lower for uptrends) with optional extension (default: 30 bars). The trendline appears and generates a signal only after the first RSI crossover. Lines are colored (red for upper, green for lower).
- Trendline Fill: Widens the trendline with a tolerance margin expressed in RSI points, reducing signal noise and visually highlighting trend zones. Breaking this zone is a condition for generating signals, minimizing false signals. The tolerance margin can be increased or decreased.
- Divergence Detection: Identifies bullish and bearish divergences based on RSI and price pivots, displaying labels (“Bull” for bullish, “Bear” for bearish) with adjustable transparency. Divergence labels appear with a delay equal to the specified pivot length (default: 5). Higher values yield stronger signals but with greater delay.
- Breakout Signals: Generates signals when RSI crosses the trendline (bullish for upper lines, bearish for lower lines), with background coloring for signal confirmation.
- Alerts: Built-in alerts for:
Detection of bullish and bearish divergences.
Upper trendline crossover (bullish signal).
Lower trendline crossover (bearish signal).
- Customization: Allows adjustment of RSI length, pivot settings, line colors, fills, labels, and transparency of signals and background.
█HOW TO USE
Add the indicator to your TradingView chart via the Pine Editor or Indicators menu.
Configuring Settings.
RSI Settings
- RSI Length: Period for RSI calculation (default: 14).
- SMA Length: Period for RSI moving average (default: 9).
- Source: Source price for RSI (default: close).
Pivot Settings for Trend
- Left Bars for Pivot: Number of bars back for detecting pivots (default: 10).
- Right Bars for Pivot: Number of bars forward for confirming pivots (default: 10).
- Extension after Second Pivot: Number of bars to extend the trendline (default: 30, 0 = none). Extension increases the number of signals, while shortening reduces them.
- Tolerance: Deviation in RSI points to widen the breakout margin, reducing signal noise (default: 3.0).
Divergence Settings
- Enable Divergence Detection: Enables/disables divergence detection (default: enabled).
- Pivot Length for Divergence: Pivot period for divergences (default: 5).
Style Settings
- Upper Trendline Color: Color for downtrend lines (default: red).
- Upper Fill Color: Fill color for upper lines (default: red, transparency 70).
- Lower Trendline Color: Color for uptrend lines (default: green).
- Lower Fill Color: Fill color for lower lines (default: green, transparency 70).
- SMA Color: Color for RSI moving average (default: yellow).
- Bullish Divergence Color: Color for bullish labels (default: green).
- Bearish Divergence Color: Color for bearish labels (default: red).
- Text Color: Color for label text (default: white).
- Divergence Label Transparency: Transparency of labels (0-100, default: 40).
- Signal Background Transparency: Transparency of breakout signal background (0-100, default: 80).
Interpreting Signals
- Trendlines: Upper lines (red) indicate RSI downtrends, lower lines (green) indicate uptrends. The trendline appears and generates a signal only after the first RSI crossover. Trendline breakouts suggest potential trend reversals.
- Divergences: “Bull” labels indicate bullish divergence (potential rise), “Bear” labels indicate bearish divergence (potential decline), with a delay based on pivot length (default: 5). Divergences serve as confirmation or warning of trend reversal, not as standalone signals.
- Signal Background: Green background signals bullish breakouts, red background signals bearish breakouts.
- RSI Levels: Horizontal lines at 70 (overbought), 50 (midline), and 30 (oversold) help assess market zones.
- Alerts: Set up alerts in TradingView for divergences or trendline breakouts.
Combining with Other Tools: Use with support/resistance levels, Fibonacci levels, or other indicators for signal confirmation.
█APPLICATIONS
The "RSI Trendlines and Divergence" indicator is designed to identify trends and potential reversal points, supporting both trend-following and reversal strategies:
- Trend Confirmation: Trendlines indicate the RSI trend direction, with breakouts signaling potential reversals. The indicator is functional in traditional RSI usage, allowing classic RSI interpretation (e.g., returning from overbought/oversold zones). Combining trendline breakouts with RSI signal levels, such as a return from overbought or oversold zones paired with a trendline breakout, strengthens the signal.
- Divergence Detection: Divergences serve as confirmation or warning of trend reversal, not as standalone signals.
█NOTES
- Adjust settings (e.g., RSI length, pivots, tolerance) to suit your trading style and timeframe.
- Combine with other technical analysis tools to enhance signal accuracy.
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.
Hybrid Trend Line-J-AlgoOverview
The Hybrid Trend Line-J-Algo is an advanced multi-layered trendline detection system that identifies market trends across three distinct timeframes simultaneously. This indicator combines confirmed, developing, and real-time trend analysis to provide traders with a comprehensive view of market structure and momentum shifts.
Key Features
[✅ Three-Tier Trend Detection System:
Confirmed Trendlines (⚡T💧/⚡T🩸) - High-probability, established trends with 20-period confirmation
Developing Trendlines (⚡D💧/⚡D🩸) - Emerging trends with 8-period detection for early entries
Real-Time Trendlines (⚡R💧/⚡R🩸) - Immediate trend identification with minimal lag (10-period lookback)
✅ Visual Channel System:
Gradient-filled channels between trendlines and parallel support/resistance zones
Adjustable channel padding for volatility-based spacing
Color-coded bullish (blue/teal/lime) and bearish (gray/red/orange) trends
✅ Customizable Display:
Toggle each trendline type independently
Adjustable detection lengths for all three systems
Custom colors and label sizes
Optional gradient fills or solid colors
✅ Smart Trendline Management:
Automatic trendline extension to current price
Pivot-based detection for accurate swing points
Dynamic slope calculations
Labeled indicators for easy trend identification
How It Works
Confirmed Trendlines use pivot highs/lows with a 20-bar lookback to identify well-established trends. These represent the most reliable trend structure and are ideal for position trading and trend confirmation.
Developing Trendlines employ an 8-bar detection period to catch trends as they form. These provide earlier signals than confirmed lines, making them suitable for swing trading and anticipating trend continuations.
Real-Time Trendlines track the most recent price action with minimal lag, connecting recent highs and lows to identify immediate momentum shifts. Perfect for intraday trading and quick reversals.
Best Use Cases
📈 Trend Following - Align trades with confirmed trendlines for high-probability setups
📉 Early Entry Detection - Use developing trendlines to enter before the crowd
⚡ Scalping & Day Trading - Real-time trendlines provide instant trend direction
🎯 Multi-Timeframe Analysis - View all three trend layers simultaneously for confluence
Settings Guide
Confirmed Trend Lines:
Detection Length: 20 (default) - Higher = fewer, stronger signals
Colors: Customizable bullish/bearish
Developing Trend Lines:
Detection Length: 8 (default) - Lower = more responsive
Dashed style for visual distinction
Real-Time Trend Lines:
Lookback: 10 (default) - Minimal lag for immediate feedback
Dotted style for differentiation
Visual Settings:
Gradient Fills: Toggle smooth color transitions
Channel Padding: Adjust spacing (2.0 default)
Label Size: Choose from Tiny to Huge
Trading Tips
💡 Look for confluence when multiple trendline types align in the same direction
💡 Watch for breaks of confirmed trendlines as potential reversal signals
💡 Use developing trendlines to anticipate confirmed trend formations
💡 Combine with volume and momentum indicators for enhanced accuracy
💡 Respect the channel boundaries as dynamic support/resistance zones
Unique Advantages
✨ No Repainting - All trendlines are based on confirmed pivots and historical data
✨ Clean Visual Design - Emoji labels and gradient fills for intuitive interpretation
✨ Fully Customizable - Adapt to any trading style or timeframe
✨ Multiple Confirmation Levels - Reduces false signals through multi-tier analysis
✨ Beginner Friendly - Clear visual cues with labeled trend indicators
Disclaimer
This indicator is for educational and informational purposes only. It does not constitute financial advice. Always conduct your own analysis and risk management before making trading decisions.
Version: 6
Type: Overlay Indicator
Max Lines/Labels: 500
Perfect for: Trend traders, swing traders, day traders, and multi-timeframe analysts
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.
Rsi TrendLines with Breakouts [KoTa]### RSI TrendLines with Breakouts Indicator: Detailed User Guide
The "RSI TrendLines with Breakouts " indicator is a custom Pine Script tool designed for TradingView. It builds on the standard Relative Strength Index (RSI) by adding dynamic trendlines based on RSI pivots (highs and lows) across multiple user-defined periods. These trendlines act as support and resistance levels on the RSI chart, and the indicator detects breakouts when the RSI crosses these lines, generating potential buy (long) or sell (short) signals. It also includes overbought/oversold thresholds and optional breakout labels. Below, I'll provide a detailed explanation in English, covering how to use it, its purpose, advantages and disadvantages, example strategies, and ways to enhance strategies with other indicators.
How to Use the Indicator
- The indicator uses `max_lines_count=500` to handle a large number of lines without performance issues, but on very long charts, you may need to zoom in for clarity.
1. **Customizing Settings**:
The indicator has several input groups for flexibility. Access them via the gear icon next to the indicator's name on the chart.
- **RSI Settings**:
- RSI Length: Default 14. This is the period for calculating the RSI. Shorter lengths (e.g., 7-10) make it more sensitive to recent price changes; longer (e.g., 20+) smooth it out for trends.
- RSI Source: Default is close price. You can change to open, high, low, or other sources like volume-weighted for different assets.
- Overbought Level: Default 70. RSI above this suggests potential overbuying.
- Oversold Level: Default 30. RSI below this suggests potential overselling.
- **Trend Periods**:
- You can enable/disable up to 5 periods (defaults: Period 1=3, Period 2=5, Period 3=10, Period 4=20, Period 5=50). Only enabled periods will draw trendlines.
- Each period detects pivots (highs/lows) in RSI using `ta.pivothigh` and `ta.pivotlow`. Shorter periods (e.g., 3-10) capture short-term trends; longer ones (20-50) show medium-to-long-term momentum.
- Inline checkboxes allow you to toggle display for each (e.g., display_p3=true by default).
- **Color Settings**:
- Resistance/Support Color: Defaults to red for resistance (up-trendlines from RSI highs) and green for support (down-trendlines from RSI lows).
- Labels for breakouts use green for "B" (buy/long) and red for "S" (sell/short).
- **Breakout Settings**:
- Show Prev. Breakouts: If true, displays previous breakout labels (up to "Max Prev. Breakouts Label" +1, default 2+1=3).
- Show Breakouts: Separate toggles for each period (e.g., show_breakouts3). When enabled, dotted extension lines project the trendline forward, and crossovers/crossunders trigger labels like "B3" (breakout above resistance for Period 3) or "S3" (break below support).
- Note: Divergence detection is commented out in the code. If you want to enable it, uncomment the relevant sections (e.g., show_divergence input) and adjust the lookback (default 5 bars) for spotting bullish/bearish divergences between price and RSI.
2. **Interpreting the Visuals**:
- **RSI Plot**: A blue line showing the RSI value (0-100). Horizontal dashed lines at 70 (red, overbought), 30 (green, oversold), and 50 (gray, midline).
- **Trendlines**: Solid lines connecting recent RSI pivots. Green lines (support) connect lows; red lines (resistance) connect highs. Only the most recent line per direction is shown per period to avoid clutter.
- **Breakout Projections**: Dotted lines extend the current trendline forward. When RSI crosses above a red dotted resistance, a "B" label (e.g., "B1") appears above, indicating a potential bullish breakout. Crossing below a green dotted support shows an "S" label below, indicating bearish.
- **Labels**: Current breakouts are bright (green/red); previous ones fade to gray. Use these as signal alerts.
- **Alerts**: The code includes commented-out alert conditions (e.g., for breakouts or RSI crossing levels). Uncomment and set them up in TradingView's alert menu for notifications.
3. **Best Practices**:
- Use on RSI-compatible timeframes (e.g., 1H, 4H, daily) for stocks, forex, or crypto.
- Combine with price chart: Trendlines are on RSI, so check if RSI breakouts align with price action (e.g., breaking a price resistance).
- Test on historical data: Backtest signals using TradingView's replay feature.
- Avoid over-customization initially—start with defaults (Periods 3 and 5 enabled) to understand behavior.
What It Is Used For
This indicator is primarily used for **momentum-based trend analysis and breakout trading on the RSI oscillator**. Traditional RSI identifies overbought/oversold conditions, but this enhances it by drawing dynamic trendlines on RSI itself, treating RSI as a "price-like" chart for trend detection.
- **Key Purposes**:
- **Identifying Momentum Trends**: RSI trendlines show if momentum is strengthening (upward-sloping support) or weakening (downward-sloping resistance), even if price is ranging.
- **Spotting Breakouts**: Detects when RSI breaks its own support/resistance, signaling potential price reversals or continuations. For example, an RSI breakout above resistance in an oversold zone might indicate a bullish price reversal.
- **Multi-Period Analysis**: By using multiple pivot periods, it acts like a multi-timeframe tool within RSI, helping confirm short-term signals with longer-term trends.
- **Signal Generation**: Breakout labels provide entry/exit points, especially in trending markets. It's useful for swing trading, scalping, or confirming trends in larger strategies.
- **Divergence (Optional)**: If enabled, it highlights mismatches between price highs/lows and RSI, which can predict reversals (e.g., bullish divergence: price lower low, RSI higher low).
Overall, it's ideal for traders who rely on oscillators but want more visual structure, like trendline traders applying price concepts to RSI.
Advantages and Disadvantages
**Advantages**:
- **Visual Clarity**: Trendlines make RSI easier to interpret than raw numbers, helping spot support/resistance in momentum without manual drawing.
- **Multi-Period Flexibility**: Multiple periods allow analyzing short- and long-term momentum simultaneously, reducing noise from single-period RSI.
- **Breakout Signals**: Automated detection of breakouts provides timely alerts, with labels and projections for proactive trading. This can improve entry timing in volatile markets.
- **Customization**: Extensive inputs (periods, colors, breakouts) make it adaptable to different assets/timeframes. The stateful management of lines/labels prevents chart clutter.
- **Complementary to Price Action**: Enhances standard RSI by adding trend context, useful for confirming divergences or overbought/oversold trades.
- **Efficiency**: Uses efficient arrays and line management, supporting up to 500 lines for long charts without lagging TradingView.
**Disadvantages**:
- **Lagging Nature**: Based on historical pivots, signals may lag in fast-moving markets, leading to late entries. Shorter periods help but increase whipsaws.
- **False Signals**: In ranging or sideways markets, RSI trendlines can produce frequent false breakouts. It performs better in trending conditions but may underperform without filters.
- **Over-Reliance on RSI**: Ignores volume, fundamentals, or price structure—breakouts might not translate to price moves if momentum decouples from price.
- **Complexity for Beginners**: Multiple periods and settings can overwhelm new users; misconfiguration (e.g., too many periods) leads to noisy charts.
- **No Built-in Risk Management**: Signals lack stop-loss/take-profit logic; users must add these manually.
- **Divergence Limitations**: The basic (commented) divergence detection is simplistic and may miss hidden divergences or require tuning.
In summary, it's powerful for momentum traders but should be used with confirmation tools to mitigate false positives.
Example Strategies
Here are one LONG (buy) and one SHORT (sell) strategy example using the indicator. These are basic; always backtest and use risk management (e.g., 1-2% risk per trade, stop-loss at recent lows/highs).
**LONG Strategy Example: Oversold RSI Support Breakout**
- **Setup**: Use on a daily chart for stocks or crypto. Enable Periods 3 and 5 (short- and medium-term). Set oversold level to 30.
- **Entry**: Wait for RSI to be in oversold (<30). Look for a "B" breakout label (e.g., "B3" or "B5") when RSI crosses above a red resistance trendline projection. Confirm with price forming a higher low or candlestick reversal (e.g., hammer).
- **Stop-Loss**: Place below the recent price low or the RSI support level equivalent in price terms (e.g., 5-10% below entry).
- **Take-Profit**: Target RSI reaching overbought (70) or a 2:1 risk-reward ratio. Exit on a bearish RSI crossunder midline (50).
- **Example Scenario**: In a downtrending stock, RSI hits 25 and forms a support trendline. On a "B5" breakout, enter long. This captures momentum reversals after overselling.
- **Rationale**: Breakout above RSI resistance in oversold signals fading selling pressure, potential for price uptrend.
**SHORT Strategy Example: Overbought RSI Resistance Breakout**
- **Setup**: Use on a 4H chart for forex pairs. Enable Periods 10 and 20. Set overbought level to 70.
- **Entry**: Wait for RSI in overbought (>70). Enter on an "S" breakout label (e.g., "S3" or "S4") when RSI crosses below a green support trendline projection. Confirm with price showing a lower high or bearish candlestick (e.g., shooting star).
- **Stop-Loss**: Above the recent price high or RSI resistance level (e.g., 5-10% above entry).
- **Take-Profit**: Target RSI hitting oversold (30) or a 2:1 risk-reward. Exit on bullish RSI crossover midline (50).
- **Example Scenario**: In an uptrending pair, RSI peaks at 75 with a resistance trendline. On "S4" breakout, enter short. This targets momentum exhaustion after overbuying.
- **Rationale**: Break below RSI support in overbought indicates weakening buying momentum, likely price downturn.
Enhancing Strategy Validity with Other Indicators
To increase the reliability of strategies based on this indicator, combine it with complementary tools for confirmation, filtering false signals, and adding context. This creates multi-indicator strategies that reduce whipsaws and improve win rates. Focus on indicators that address RSI's weaknesses (e.g., lagging, momentum-only). Below are examples of different indicators, how to integrate them, and sample strategies.
1. **Moving Averages (e.g., SMA/EMA)**:
- **How to Use**: Overlay 50/200-period EMAs on the price chart. Use RSI breakouts only in the direction of the trend (e.g., long only if price > 200 EMA).
- **Strategy Example**: Trend-Following Long – Enter on "B" RSI breakout if price is above 200 EMA and RSI > 50. This filters reversals in uptrends. Add MACD crossover for entry timing. Advantage: Aligns momentum with price trend, reducing counter-trend trades.
2. **Volume Indicators (e.g., Volume Oscillator or OBV)**:
- **How to Use**: Require increasing volume on RSI breakouts (e.g., OBV making higher highs on bullish breakouts).
- **Strategy Example**: Volume-Confirmed Short – On "S" breakout, check if volume is rising and OBV breaks its own trendline downward. Enter short only if confirmed. This validates breakouts with real market participation, avoiding low-volume traps.
3. **Other Oscillators (e.g., MACD or Stochastic)**:
- **How to Use**: Use for divergence confirmation or overbought/oversold alignment. For instance, require Stochastic (14,3,3) to also breakout from its levels.
- **Strategy Example**: Dual-Oscillator Reversal Long – Enable divergence in the indicator. Enter on bullish RSI divergence + "B" breakout if MACD histogram flips positive. Exit on MACD bearish crossover. This strengthens reversal signals by cross-verifying momentum.
4. **Price Action Tools (e.g., Support/Resistance or Candlestick Patterns)**:
- **How to Use**: Map RSI trendlines to price levels (e.g., if RSI resistance breaks, check if price breaks a key resistance).
- **Strategy Example**: Price-Aligned Breakout Short – On "S" RSI breakout in overbought, confirm with price breaking below a drawn support line or forming a bearish engulfing candle. Use Fibonacci retracements for targets. This ensures momentum translates to price movement.
5. **Volatility Indicators (e.g., Bollinger Bands or ATR)**:
- **How to Use**: Avoid trades during low volatility (e.g., Bollinger Band squeeze) to filter ranging markets. Use ATR for dynamic stops.
- **Strategy Example**: Volatility-Filtered Long – Enter "B" breakout only if Bollinger Bands are expanding (increasing volatility) and RSI is oversold. Set stop-loss at 1.5x ATR below entry. This targets high-momentum breakouts while skipping choppy periods.
**General Tips for Building Enhanced Strategies**:
- **Layering**: Start with RSI breakout as the primary signal, add 1-2 confirmations (e.g., EMA trend + volume).
- **Backtesting**: Use TradingView's strategy tester to quantify win rates with/without additions.
- **Risk Filters**: Incorporate overall market sentiment (e.g., via VIX) or avoid trading near news events.
- **Timeframe Alignment**: Use higher timeframes for trend (e.g., daily EMA) and lower for entries (e.g., 1H RSI breakout).
- **Avoid Overloading**: Too many indicators cause paralysis; aim for synergy (e.g., trend + momentum + volume).
This indicator is a versatile tool, but success depends on context and discipline. If you need code modifications or specific backtests, provide more details!
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