TrendLines with AlertsThis isn't my own work, hence giving it in Open Source library for others to benefit from it too.
I have tried to refin the output of trendlines in this Strategy
The original Code is available at
The script needs some modifications, so I'll be making further updates in future, but for now I'm publishing this because most people don't know how to track trandlines, moreover, some use Line.New() by tradingview Pinescript, which again is a bit difficult to deal with.
This script is a basic version of trendlines on a certain angle (anglecheck was provided by the original author in his script).
Nothing fancy in this script.
Also Converted the original Script to Pinescript v4.
Komut dosyalarını "trendline" için ara
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.
TrendLine I3-TLIdea:
Draw a trendline that can set an alert every time the price cross over/under.
Concept:
(Note that we take the close to get the closing price).
-Determine the coordinates of 2 points of the line AB: A(x1;y1); B(x2;y2).
-Apply Oxy geometry to the chart with price as Oy axis, time as Ox axis. Use linear equations to determine:
+If point's x > line's x, the point is to the right of the line.
+If point's x < line's x, the point is to the left of the line.
+If point's x == line's x, the point is on the line.
-Determine when the price is crossOver or crossUnder the trend line, display that time on the chart and send an alert.
How it works:
1. Input value to config the line by manually:
- Y1: Price 1 as point 1.
- X1: Time at point 1.
- Y2: Price 2 as point 2.
- X2: Time at point 2.
X2 (To date) must be after X1 (From date).
Please consider time (hour, minute) if timeframe < 1hour.
Then draw a line on the pouring table with straight line AB as solid line, extended line as broken line. Logic will start from dashed line (To date in input).
If the price changes value from side to side of the line, show the text label, change the background color accordingly (blue top, red bottom),
also sends an alert ("CrossUnder"; "CrossOver").
2. The indicator's operating range is limited to 500 bars from the "From date" bar. When reaching to the outside, it will show a yellow warning with outbound message.
3. Set alert for this indicator, it will send alert follow 1. condition.
Suitable time frames:
5m, 15m, 1h, 4h, 1D
* Please note that this logic does not attempt to predict future prices or 100% accurate signal.
This is FREE indicator.
(Please direct message or visit website if you want to try another invite-only indicators)
Hope you guys enjoy!
Examples:
GOLD 1D
EURUSD 1H
TRENDLINE V1Hello all ...
this is the source trendline of the three pivots
with adjustable resolution and length
function to find a breakout or breakdown
[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.
BTC Trendline Patterns with Signals BTC Trendline Patterns with Signals
This custom Pine Script indicator automatically detects key pivot points in Bitcoin price action and draws support and resistance trendlines. The indicator provides buy (long) and sell (short) signals when these trendlines are broken. This can help traders identify potential breakout opportunities and trend reversals based on established price levels.
Features:
Pivot Point Detection: Automatically identifies pivot highs and lows in the price chart, based on customizable parameters (Pivot Left and Pivot Right).
Support and Resistance Trendlines: Draws trendlines based on the identified pivot points. These lines represent significant price levels where price may experience support or resistance.
Breakout Signals: Provides buy (long) and sell (short) signals when the price breaks above the resistance trendline (for buy signals) or below the support trendline (for sell signals).
Customizable Pivot Lengths: Adjust the number of bars considered for determining pivot points using the Pivot Left and Pivot Right input parameters.
How it Works:
Pivot Detection: The script identifies the highest high (pivotHigh) and the lowest low (pivotLow) within a specific range of bars (defined by Pivot Left and Pivot Right).
Trendline Plotting: Once pivots are detected, the script draws resistance (red) and support (green) trendlines connecting the most recent pivots. These trendlines act as dynamic support and resistance levels.
Breakout Signals: The script generates signals:
BUY (Long): Triggered when the price breaks above the most recent resistance trendline.
SELL (Short): Triggered when the price breaks below the most recent support trendline.
Parameters:
Pivot Left: Number of bars to the left of the pivot point to consider.
Pivot Right: Number of bars to the right of the pivot point to consider.
Line Width: Customizable line width for drawing trendlines.
Ideal Use:
Timeframes: This indicator works well on timeframes ranging from 1-minute to daily charts. For best results, use it on 1-hour, 4-hour, or daily charts.
Strategy: Ideal for breakout traders or trend-following strategies. Use it to identify potential entry points when price breaks key levels of support or resistance.
Example Use Case:
Swing Traders: Traders looking for potential breakouts can use this script to identify key levels in the market and wait for the price to break through resistance for a long trade or support for a short trade.
Day Traders: For those looking to enter and exit trades in a single day, this indicator can help pinpoint areas of support and resistance, and provide actionable signals when price breaks those levels.
Disclaimer:
This script is not a guarantee of success and should be used in conjunction with other technical analysis tools. Always perform additional research and backtesting before live trading.
Important Notes:
The pivot points and trendlines may adjust dynamically as the price evolves. Adjust the pivot settings to suit the volatility and timeframe of the market you're trading.
This indicator works best when combined with other indicators such as volume, RSI, or MACD for confirmation.
How to Use:
Add the indicator to your chart.
Adjust the Pivot Left and Pivot Right parameters to fine-tune the pivot point detection.
Monitor for trendline breakouts. When the price breaks above the resistance line, a BUY signal will appear. When the price breaks below the support line, a SELL signal will appear.
Use the signals to enter trades at the right moment.
Final Notes:
If you're submitting to TradingView for publishing, keep your description clear and informative, but also concise. Traders need to quickly understand how your indicator works, what parameters they can adjust, and how it might fit into their trading strategy.
DonAlt - Smart Money Toolkit [BigBeluga]DonAlt - Smart Money Toolkit is inspired by the analytical insights of popular crypto influencer DonAlt.
This advanced toolkit integrates smart money concepts with key technical analysis elements to enhance your trading decisions.
🔵 KEY FEATURES:
SUPPORT AND RESISTANCE LEVELS Automatically identifies critical market turning points with significant volume. Levels turn green when the price is above them and red when below, providing a visual cue for key market thresholds.
ORDER BLOCKS: Highlights significant price zones preceding major price movements.
- If the move is down , it searches for the last bullish candle and plots a block from its body.
- If the move is up , it searches for the last bearish candle and creates a block from its body.
These blocks help identify areas of institutional interest and potential reversals.
TRENDLINES: Automatically plots trendlines to identify breakout zones or price accumulation areas.
• Bullish trendlines accumulation form when the current low is higher than the previous low.
• Bearish trendlines accumulation emerge when the current high is lower than the previous high.
• Bullish trendlines Breakout form when the price break above it.
• Bearish trendlines Breakout form when the price break below it.
Volatility Integration: The levels incorporate normalized volatility to ensure only significant zones are highlighted, filtering noise and emphasizing meaningful data.
🔵 WHEN TO USE:
This toolkit is ideal for traders seeking to align with "smart money" strategies by identifying key areas of institutional activity, strong support and resistance zones, and potential breakout setups.
🔵 CUSTOMIZATION:
Toggle the visibility of levels, order blocks, or trendlines to match your trading style and focus.
Colors of the Bull and Bear key features
Extend trendline
Algo LinesThe primary objective of this indicator is to identify and draw significant trendlines based on pivot points. These trendlines can help traders make informed decisions by providing a visual representation of support and resistance levels in the market.The script consists of several input parameters, functions, and variables that work together to create dynamic trendlines based on pivot points. The input parameters allow users to customize the appearance and behavior of the indicator, including the colors of the trendlines, the timeframe, and the maximum number of crossed lines to display.
The core of the script is built around two main functions:
1. createLine(): This function is responsible for creating a new trendline based on the provided pivot points. It takes five arguments - pivot type, x1, y1, x2, and y2 coordinates - and returns a new line object. Depending on the pivot type, the function adds the new line to either the dtlArray (down trendline array) or utlArray (up trendline array).
2. getSlope(): This function calculates the slope of a given line and returns the extended price level based on the current bar index. It takes one argument - the line object - and uses its coordinates to compute the slope.
The script also employs several variables to store and manipulate pivot points and trendlines. These include arrays for up and down trendlines (dtlArray and utlArray), variables for storing pivot point coordinates (utlX1, utlY1, etc.), and temporary arrays for storing crossed trendlines (tempUtl and tempDtl).
Creating Trendlines
The Algo Lines script identifies pivot highs and pivot lows using the ta.pivothigh() and ta.pivotlow() functions. When a new pivot low is detected, the script updates the utlX1 and utlY1 variables with the previous pivot low coordinates, and the utlX2 and utlY2 variables with the current pivot low coordinates. If the rate of change between these points meets the minimum threshold specified by the user, the createLine() function is called to create a new up trendline.
Similarly, when a new pivot high is detected, the script updates the dtlX1 and dtlY1 variables with the previous pivot high coordinates, and the dtlX2 and dtlY2 variables with the current pivot high coordinates. If the rate of change between these points meets the minimum threshold specified by the user, the createLine() function is called to create a new down trendline.
Processing Trendlines
The Algo Lines script processes up and down trendlines separately. For each trendline in the utlArray, the script checks if the price has crossed the trendline based on the user's chosen cross source (either close or high/low). If the price crosses a trendline, the script creates a new dashed line with the pastColor and adds it to the temporary array (tempUtl). The original trendline is then deleted.
The same process is applied to the dtlArray, except that the temporary array used is tempDtl. In both cases, if the number of crossed lines exceeds the maximum specified by the user, the oldest crossed line is removed from the temporary array.
Conclusion
The Algo Lines indicator offers traders a powerful tool for identifying significant trendlines based on pivot points. By providing a customizable and dynamic visual representation of support and resistance levels, the script enables traders to make better-informed decisions in the market. The concise and well-structured Pine Script code adheres to TradingView's house rules and ensures a seamless integration with the platform.
Trend Lines [LuxAlgo]Our new "Trend Lines" indicator detects and highlights relevant trendlines on the user chart while keeping it free of as much clutter as possible.
The indicator is thought for real-time usage and includes several filters as well as the ability to estimate trendline angles.
🔶 USAGE
Trendlines can act as support/resistance, with a higher number of tests indicating a more significant support/resistance role.
A broken TrendLine can be indicative of a potential trend reversal. The script highlights breaks with a label.
Users can additionally filter trendlines, only showing trendlines whose angles fall within a user set range:
This allows for the removal of potential clutter from the chart but also helps keep steeper or more horizontal trendlines.
🔶 DETAILS
When a swing (pivot point) is found, a Trendline is drawn when certain conditions are fulfilled.
An essential condition is that a Bearish Trendline (red) always occurs on a lower high, while a Bullish Trendline (blue) occurs on a higher low.
Our implementation will first show an initial dotted-styled TrendLine on confirmation, after which a solid-styled secondary TrendLine will develop. The latter will be used for the real-time detection of breaks at that line:
Furthermore, the script allows you to add more conditions:
🔹 Length (Swings)
A swing develops when a high/low is the highest/lowest against x highs/lows on the left AND right of that bar. x can be set by "Length" in settings.
The following images clarify this. The script confirms a swing where the yellow flag is shown; the high (here visualized with a purple label) is the highest point against x bars left and right of that point.
At that moment, this swing is checked against the previous swing. If all conditions are fulfilled, an initial TrendLine is drawn on confirmation.
After that point, a secondary thicker solid line is seen which keeps progressing bar after bar, until:
• a new TrendLine is formed
• the TrendLine is broken
🔹 Breaks between Swings
Once there is confirmation that a TrendLine can be drawn, the script allows you to filter for breakthroughs on that line. This can be set with "Check breaks between"
Disabled : the initial TrendLine is allowed to be pierced:
Check breaks between point A - point B : no breaks are allowed between both Swing points:
Point A - Current bar : no breaks are allowed between the first Swing point and the point of confirmation ('current' bar):
🔹 TrendLine breaks
As mentioned, the secondary TrendLine (solid line) progresses bar after bar until a new TrendLine is formed or the TrendLine is broken. When a TrendLine is broken, the TrendLine stops progressing, but if there isn't a new TrendLine and price return back, the TrendLine will re-appear, potentially giving several signals when the TrendLine is broken again.
Minimal bars allow you to regulate the amount of signals when the TrendLine is broken.
-> The secondary TrendLine must be uninterrupted for at least x bars before a potential break can be considered.
The following example shows 1 signal against 3 by adjusting this setting from 2 to 5:
🔹 Angles
Angles should normally be calculated when the units of the X and Y axis are the same. However, on our charts, the unit of the X-axis is bar_index (bars), and on the Y-axis the unit is price (¥, €, £, $,...).
It is not easy to normalize and create reasonably valid angles. Often certain angle calculations can differ through price changes or volatility.
Our calculate_slope() function tries to make corresponding angles through all bars.
We do this by calculating the difference between the highest/lowest price values in a certain bar range. The bar range is our X-axis, and the price difference is our Y-axis.
Zooming in/out will not change the amount of bars or the price. Since it does change our view on the chart, and thereby how we see the angles, we have included a setting where you can personalize the ratio between X and Y-axis (Angles -> Ratio X-Y axis).
Settings: Angles - Ratio X-Y axis:
🔶 SETTINGS
🔹 Swings
Length: Lookback period for the detection of swing points.
🔹 Trendline validation
Check breaks between :
Disabled : the initial TrendLine is allowed to be pierced
Check breaks between point A - point B : no breaks are allowed between both Swing points
Point A - Current bar : no breaks are allowed between the first Swing point and the point of confirmation ('current' bar)
Source (breaks) : Source which invalidates TrendLine, default: close
🔹 TrendLine breaks
Minimal bars : The secondary TrendLine must be uninterrupted for at least x bars before a potential break can be considered.
🔹 Angles
Show : Toggle labels.
Ratio X-Y axis : Every user has his preferences regarding zoom, chart layout,...
If the shown angles are not according to your expectations, you can adjust this number.
Only TrendLine between : Only allow TrendLines between the minimum and maximum degrees. Set only the minimal and maximum values above 0.
Breakout Patterns Detector: Triangle & Wedge [Splirus]This indicator identifies Breakout Patterns such as Ascending Triangles , Descending Triangles , Symmetric Triangles , Ascending Wedges , and Descending Wedges , using candlestick charts and Trendlines. It provides visual cues, stop-loss (SL), and take-profit (TP) levels, alongside a detailed dashboard to evaluate performance. The indicator supports two alert modes: Manual Mode for trader notifications and Bot Mode for automated trading signals.
To achieve optimal results, users are encouraged to experiment with indicator parameters and analyze the dashboard summary to find the perfect configuration for each timeframe, pair, and market condition.
Pattern Identification
The indicator detects the following breakout patterns based on pivot highs and lows:
Ascending Triangle : Flat upper trendline, rising lower trendline.
Descending Triangle : Flat lower trendline, declining upper trendline.
Symmetric Triangle : Converging trendlines with similar slopes (within a user-defined threshold).
Ascending Wedge : Both trendlines slope upward, converging.
Descending Wedge : Both trendlines slope downward, converging.
Patterns are identified using configurable left and right bars for small and big patterns, with slope thresholds normalized by ATR. A trend confirmation filter ensures breakouts align with market direction, and users can adjust breakout confirmation bars to validate signals.
The goal is to fine-tune these settings to suit specific timeframes and pairs, as each combination may require a unique setup for optimal performance.
Stop-Loss Calculation
Stop-loss levels are calculated dynamically based on pattern type and breakout direction:
Symmetric Triangle : SL is set at the first pivot of the opposite trendline, adjusted by a buffer percentage.
Ascending/Descending Triangle : SL is placed at the breakout trendline’s price, plus the buffer.
Ascending/Descending Wedge : SL is set at the second pivot of the opposite trendline, adjusted by the buffer.
The indicator calculates leverage based on a user-defined risk tolerance percentage. Users should adjust the SL buffer and risk tolerance to balance risk and reward, monitoring the dashboard to assess how these settings impact performance across different timeframes and pairs.
Take-Profit Calculation
Three take-profit levels ( TP1 , TP2 , TP3 ) are calculated using pattern height and user-defined multipliers:
For Ascending/Descending Triangles, height is the difference between the max and min prices within the pattern.
For Symmetric Triangles and Wedges, height is the vertical distance between trendlines at the pattern’s start.
TP levels are set as:
TP1 = Breakout price ± (Height × TP1 Multiplier).
TP2 = Breakout price ± (Height × TP2 Multiplier).
TP3 = Breakout price ± (Height × TP3 Multiplier, with a 1.5x adjustment for Wedges).
Experiment with TP multipliers to optimize the risk-reward ratio, using the dashboard to evaluate TP hit rates and overall profitability for each configuration.
Symmetric Triangle:
Ascending/Descending Wedge:
Ascending/Descending Triangles:
Finding the Perfect Configuration
The indicator’s dashboard provides a comprehensive summary of performance metrics, including total trades, TP1/TP2/TP3 hits, SL hits, profit/loss percentages, and win rates for bullish, bearish, and combined trades. These metrics are crucial for identifying the ideal parameter settings:
Timeframe and Pair Variability : Each timeframe (e.g., 15m, 30min, 1H, 4H, Daily) and pair (e.g., BTC/USD, EUR/USD) behaves differently. Adjust parameters like left/right bars, minimum pattern length, and breakout confirmation bars to match the volatility and trend characteristics of the chosen pair and timeframe.
Parameter Tuning : Modify slope thresholds, trend confirmation filters, and bars inside the pattern to filter out false breakouts. For example, a higher breakout confirmation bar setting may reduce signals but increase reliability on longer timeframes.
Dashboard Analysis : Focus on the dashboard’s win rate, profit/loss ratio, and TP/SL hit frequencies. A “Perfect” win rate (>66%) or high TP hit rate indicates a strong configuration. If the SL hit rate is high, consider tightening the trend confirmation filter or increasing the SL buffer.
Iterative Testing : Test different combinations of settings (e.g., small vs. big patterns, aggressive vs. conservative breakout confirmation) and compare dashboard results over time. The goal is to find a balance where the indicator consistently delivers high win rates and profitability for your specific trading setup.
Alert Modes
The indicator supports two alert modes to suit different trading styles:
Manual Mode : Generates alerts for breakouts with entry price, SL, TP1/TP2/TP3, and leverage, tailored for Crypto or Forex markets. Use this mode to manually evaluate signals while refining configurations.
Bot Mode : Sends automated trading signals. To avoid conflicts, Bot Mode ensures no short position alert is triggered while a long position is active, and vice versa. This mode is ideal once you’ve identified an optimal configuration via the dashboard.
Additional Features
Historical Patterns : Displays past trendlines with customizable transparency and extension, helping users analyze how patterns performed under different settings.
Customizable Settings : Adjust pattern size, breakout confirmation, trend filters, and visual preferences (colors, dashboard location) to match your trading style.
Market Compatibility : Supports Crypto and Forex markets across all timeframes, but requires careful tuning for each market type.
Usage Notes
Start with default settings and monitor the dashboard to establish a baseline performance for your chosen timeframe and pair.
Gradually adjust one parameter at a time (e.g., left/right bars, TP multipliers) and compare dashboard results to identify improvements.
Use historical pattern analysis to understand how past breakouts performed under different configurations, guiding your optimization process.
Once a high win rate and profitability are achieved, consider automating trades with Bot Mode for consistent execution.
Disclaimer
This indicator is intended for educational purposes only and should not be considered financial advice. Trading involves significant risk, and past performance is not indicative of future results. Users are strongly advised to thoroughly test and validate the indicator’s signals in a demo environment before using it in live trading. The author is not responsible for any financial losses incurred while using this indicator. Always conduct your own research and consult with a qualified financial advisor before making trading decisions.
Trend Lines ProHello 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 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 checks H/L/C in the channels as well. 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:
Pivot Period: The Length to calculate Pivot Highs/Lows
Source : Option to use "High/Low" or "Close" as the source for Pivot Points
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.
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 examples are below
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
you can see the Trend Lines as channels:
you can see Trend Channels to see the big picture.also there is dotted trend line as weak trend line defined above.
you can set color/width of trend lines as you wish.
the script is fast enough to run on 1sec chart:
you can use this script on any chart, fx pairs, stocks, indices etc
I made a short video to explain how to use it and some options:
Please PM for access.
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.
Dual Trendline Breakout [Splirus]This advanced trading tool leverages the power of dual pivot-based trendlines to provide traders with a superior edge in identifying potential breakout and retest opportunities. By combining two separate pivot lengths, the indicator creates both primary and secondary trendlines, enabling more robust confluence and decision-making in your trading strategy.
Key Features:
1. Dual Pivot Analysis:
Primary Trendline: Uses a shorter pivot length to capture immediate price movements and breakout scenarios.
Secondary Trendline: Employs a longer pivot length for broader trend identification and confirmation.
2. Enhanced Confluence:
The combination of short-term and long-term trendlines provides stronger signals, reducing false positives and enhancing accuracy.
3. Dynamic Visualization:
Automatically plots trendlines and extends them until they are crossed.
Distinct colors for uptrend and downtrend lines for easy interpretation.
Highlights where price breaks above or below the trendlines with bar coloring.
4. Alerts for Key Events:
Alerts are triggered for breakout and retest scenarios, ensuring you never miss critical market movements.
5. Customizable Settings:
Adjust pivot lengths, trendline colors, and visualization preferences to suit your trading style.
Optional settings for showing only the most recent trendlines, hiding crossed lines, and extending lines dynamically.
How It Works:
The indicator identifies pivot highs and lows based on the specified lengths for both primary and secondary trendlines.
When price interacts with these trendlines (breakout, retest, or cross), it highlights the event with customizable bar colors and optional alerts.
By monitoring these interactions, traders can better time their entries and exits, leveraging the dual-period analysis for stronger market confluence.
Ideal Use Cases:
Scalping: Use primary trendlines for quick trade opportunities.
Swing Trading: Combine primary and secondary trendlines for more significant market moves.
Trend Continuation or Reversal: Identify breakout confirmations or retests for confident trade setups.
This indicator is a powerful addition to any trader's toolkit, offering precision, adaptability, and actionable insights for navigating the markets with confidence.
Its closed-source design ensures that the unique advantages of the Dual Trendline identification algorithm remain exclusive to its users, providing an edge that cannot be duplicated elsewhere.
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.
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!
{20}Dashboard RSI-trendlines_Pro[vn]👉 Here is a script of 20 trading pairs scanner with RSI trendline.
-On each chart of the trading pair, there is only 1 trendline pair that comes closest to the RSI: 1 uptrendline and 1 downtrend line.
-So when the statistics on the table also show the column of the uptrend and the column of the downtrend
-When the RSI approaches any trendline and the ratio is 10%, the trendline will be colored blue (downtrend) and red (uptrend).
-Column ✎ T.line-trendline above (✐ T.line-trendline below) is the value of the current trendline compared to RSI
-Column \n\𝖗𝖊𝖘𝖎𝖘𝖙𝖆𝖓(𝖘𝖚𝖕𝖕𝖔𝖗𝖙\n\══════) when RSI breaks trendline will show 1|1|1 ( first candle) and percentage value when breaking through the point of the trendline. This is a good signal for us to consider trading with the RSI line
-The parameter when breaking shows 10|10|10, it means that the price has broken 10 candles (RSI candles), and the first 10 candles are colored yellow, then it will be
hidden. (can be changed in settings) put)
-Also, when displaying the parameters and yellow color of the box as above, the column next to it (above/below T.line) will show the percentage from when RSI broke that
point to the current price of the candle.
-The RSI column is the current of the candle and the 20:2 parameter is the RSI trendline length and to combine the same parameters with the "RSI - trendlines - div "
indicator.
-The time can be changed in the Resolution indicator setting to show multiple time arcs.
-The up arrow symbols represent the price breaking upwards, the down arrow showing the price breaking downwards
Thank you everyone for your interest and trust
-----------------------------------------------------------------------------
Vietnamese
👉 Đây là script về máy quét 20 cặp giao dịch với đường trendline của RSI .
-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 đi sát nhất với RSI là: 1 trendline 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 RSI tiến gần đến 1 đường trendline bất kì mà tỉ lệ còn 10% 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 RSI
-Cột ══════\n\𝖗𝖊𝖘𝖎𝖘𝖙𝖆𝖓(𝖘𝖚𝖕𝖕𝖔𝖗𝖙\n\══════) khi RSI phá vỡ trendline sẽ thể thiện 1|1|1 (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.Đây là tín hiệu tốt để ta xem xét giao dịch với đường RSI
-Thông số khi phá vỡ hiển thị 10|10|10 thì hiểu là giá đã phá vỡ 10 nến(nến RSI), và 10 nến đầu tiên được tô màu vàng ,sau đó sẽ bị ẩn.(có thể thay đổi trong cài đặt)
-Ngoài ra khi hiện thông số và màu vàng của ô 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 RSI phá vỡ điểm đó đến giá hiện tại của cây nến.
-Cột RSI là hiện tại của nến và thông số 20:2 là độ dài đường trendline RSI và để kết hợp cùng thông số với chỉ báo "RSI - trendlines - div "
-Có thể thay đổi thời gian trong cài đặt chỉ báo Resolution để hiển thị nhiều cung thời gian.
-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
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!
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!
IsAlgo - Manual TrendLine► Overview:
Manual TrendLine is a strategy that allows traders to manually insert a trendline and opens trades when the trendline is retested or when the price hits a new highest high or lowest low. It provides flexibility in trendline configuration and trading behavior, enabling responsive and adaptable trading strategies.
► Description:
The Manual TrendLine strategy revolves around using manually defined trendlines as the primary tool for making trading decisions. Traders start by specifying two key points on the chart to establish the trendline. Each point is defined by a specific time and price, enabling precise placement according to the trader’s analysis and insights. Additionally, the strategy allows for the adjustment of the trendline’s width, which acts as a buffer zone around the trendline, providing flexibility in how closely price movements must align with the trendline to trigger trades.
Once the trendline is established, the strategy continuously monitors price movements relative to this line. One of its core functions is to execute trades when the price retests the trendline. A retest occurs when the price approaches the trendline after initially diverging from it, indicating potential continuation of the prevailing trend. This behavior is often seen as a confirmation of the trend’s strength, and the strategy takes advantage of these moments to enter trades in the direction of the trend.
Beyond retests, the strategy also tracks the formation of new highest highs and lowest lows in relation to the trendline. When the price reaches a new highest high or lowest low, it signifies strong momentum in the trend’s direction. The strategy can be configured to open trades at these critical points.
Another key feature of the strategy is its response to trendline breaks. A break occurs when the price moves through the trendline, potentially signaling a reversal or a significant shift in market sentiment. The strategy can be set to open reverse trades upon such breaks, enabling traders to quickly adapt to changing market conditions. Additionally, traders have the option to stop opening new trades after a trendline break, helping to avoid trades during periods of uncertainty or increased volatility.
↑ Up Trend Example:
↓ Down Trend Example:
► Features and Settings:
⚙︎ TrendLine: Define the time and price of the two main points of the trendline, and set the trendline width.
⚙︎ Entry Candle: Specify the minimum and maximum body size and the body-to-candle size ratio for entry candles.
⚙︎ Trading Session: Define specific trading hours during which the strategy operates, restricting trades to preferred market periods.
⚙︎ Trading Days: Specify active trading days to avoid certain days of the week.
⚙︎ Backtesting: backtesting for a selected period to evaluate strategy performance. This feature can be deactivated if not needed.
⚙︎ Trades: Configure trade direction (long, short, or both), position sizing (fixed or percentage-based), maximum number of open trades, and daily trade limits.
⚙︎ Trades Exit: Set profit/loss limits, specify trade duration, or exit based on band reversal signals.
⚙︎ Stop Loss: Choose from various stop-loss methods, including fixed pips, ATR-based, or highest/lowest price points within a specified number of candles. Trades can also be closed after a certain number of adverse candle movements.
⚙︎ Break Even: Adjust stop loss to break even once predefined profit levels are reached, protecting gains.
⚙︎ Trailing Stop: Implement a trailing stop to adjust the stop loss as the trade becomes profitable, securing gains and potentially capturing further upside.
⚙︎ Take Profit: Set up to three take-profit levels using methods such as fixed pips, ATR, or risk-to-reward ratios. Alternatively, specify a set number of candles moving in the trade’s direction.
⚙︎ Alerts: Comprehensive alert system to notify users of significant actions, including trade openings and closings. Supports dynamic placeholders for take-profit levels and stop-loss prices.
⚙︎ Dashboard: Visual display on the chart providing detailed information about ongoing and past trades, aiding users in monitoring strategy performance and making informed decisions.
► Backtesting Details:
Timeframe: 30-minute EURUSD chart
Initial Balance: $10,000
Order Size: 500 units
Commission: 0.05%
Slippage: 5 ticks
This strategy opens trades around a manually drawn trendline, which results in a smaller number of closed trades.
RSI - trendlines - div[vn]This is an indicator for traders of trendline analysis with RSI (the formula for calculating RSI I don't mention here anymore because every trader knows it)
-
The Pine Script strategy plots pivot points and trendlines on the RSI chart.
This strategy allows the user to specify the interval for calculating the pivot points and the number of pivot points used to generate the RSI trendlines.
As all traders know, the RSI line closely follows the actual price line, it is an indicator of momentum, the RSI often tells us the direction of the price line in advance, it often precedes and goes along with the price.
RSI is one of the indicators that predicts price trends very well when it crosses its trendline (except in case of divergence).
On the chart of the RSI indicator, I only show 2 trendlines closest to the RSI (1 increase, 1 decrease) and the trend lines far away from me are hidden so that traders can focus on observing better.
When an uptrend line of RSI (or a decrease of RSI) is drawn according to the settings in the settings of the indicator, then that line is support and resistance so that we can proceed to make a BUY or SELL point according to the indicator. RSI support and resistance strategy
When the RSI line breaks above the definitive uptrend line or breaks below the trendline definitively, the price signals a reversal to the nearest trendline.
When the RSI breaks the downtrend line of the RSI (definitively), it signals that the price has a high probability of reversing or approaching the nearest resistance area or possibly reversing from bearish to bullish.
When the RSI breaks the uptrend line of the RSI (definitively), it signals that the price is likely to reverse or reach the nearest resistance area or it may reverse from bullish to bearish.
In addition, I have integrated the normal divergence function of RSI for traders to use in case of divergence - combined with trendline to identify trend reversal more clearly.
-------------------------------------------------------------------------------------------------------
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 với RSI(công thức tính RSI tôi không nhắc ở đây nữa vì mọi trader đều biết)
-Chiến lược Pine Script vẽ các điểm trục và đường xu hướng trên biểu đồ RSI.
-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 của RSI.
-Như các Trader đều biết đường RSI bám sát thực tế với đường giá, nó là chỉ báo về động lượng ,RSI nhiều khi cho chúng ta "biết trước" được hướng đi của đường giá, nó thường đi trước và đi cùng với giá
-RSI là một trong những chỉ báo dự đoán xu hướng giá rất tốt khi cắt đường xu hướng của nó (chỉ trừ trường hợp phân kì)
-Trên biểu đồ của chỉ báo RSI tôi chỉ đưa ra 2 đường trendline gần với đường RSI nhất (1 tăng , 1 giảm)còn các đường xu hướng cách xa tôi đều để ẩn để các Trader tập chung quan sát tốt hơn
-Khi đường xu hướng tăng của RSI (hoặc giảm của RSI) được vẽ ra theo các thiết lập trong cài đặt của chỉ báo,thì đường đó là hỗ trợ,kháng cự để ta có thể tiến hành thực hiện điểm BUY hoặc SELL theo chiến lược hỗ trợ và kháng cự của RSI
-Khi đường RSI mà phá vỡ lên trên đường xu hướng tăng dứt khoát hoặc phá xuống dưới đường xu hướng cách dứt khoát thì giá báo hiệu sắp đảo chiều ngược với đường xu hướng gần nhất
-Khi RSI phá vỡ đường xu hướng giảm của RSI (cách dứt khoát) thì báo hiệu sắp tới giá có khả năng cao sẽ đảo chiều hay tiến tới vùng kháng cự gần nhất hay có thể đảo chiều từ giảm thành tăng
-Khi RSI phá vỡ đường xu hướng tăng của RSI (cách dứt khoát) thì báo hiệu sắp tới giá có khả năng cao sẽ đảo chiều hay tiến tới vùng kháng cự gần nhất hay có thể đảo chiều từ tăng thành giảm
-ngoài ra tôi có tích hợp thêm vào công cụ chức năng phân kì thường của RSI để trader dùng trong trường hợp phân kì - kết hợp với đường trendline để xác định xu hướng đảo chiều rõ ràng hơn
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.
Khate ravandThis script draws trendlines from the pivot points in the price chart.
//
// The input for the function that draws the trendlines is any calculation or function
// (here this is pivot points, but the core of the script can be used in other implementations too),
// that most of the time and occasionally produces a 'non n/a' value.
// The trendline function then connects the non n/a values and extends the connections of those points in a trendline.
//
// There is an option to draw the lines from the wicks or from the 'real bodies' of the candles.
// The trendlines can either extend infinitely or only run for an adjustable amount of bars.
//
// There's an option to display trendline breaks
// And the option to display trendlines in color or monochrome
//
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.