Smart Trendline Detector
- 지표
- 버전: 1.10
Smart Trendline Detector is an automatic multi-timeframe trendline analysis indicator for MetaTrader 5 that detects and ranks rising support and falling resistance structures using market swing points.
Instead of filling the chart with every possible trendline, the indicator evaluates qualifying structures and displays only a controlled number of the strongest candidates according to configurable ranking criteria.
The result is a cleaner chart with relevant trendline structure kept clearly visible.
Main Features
-
Automatic rising support trendline detection
-
Automatic falling resistance trendline detection
-
Ranked trendline selection
-
Multi-timeframe analysis
-
Adjustable swing-point sensitivity
-
Historical structure scanning
-
Independent limits for upward and downward trendlines
-
Maximum total trendline limit
-
Limited future trendline projection
-
Touch-point markers
-
Broken trendline detection
-
Clean broken-line visualization
-
Optional swing-point markers
-
Adjustable colors and line styles
-
No trading alerts
-
No automatic trade execution
Ranked Trendline Selection
Smart Trendline Detector does not simply display every trendline that can be created from historical swing points.
Potential trendlines are evaluated using several structural characteristics, including:
-
number of qualifying touches
-
distance between anchor points
-
recency of the trendline structure
-
historical price violations
The ranking system helps prioritize cleaner and more relevant trendline structures.
The ranking weights can be adjusted directly from the indicator Inputs.
Rising Support Trendlines
Rising support trendlines are calculated from qualifying swing lows.
When directional slope filtering is enabled, the newer swing low must be higher than the older swing low.
This helps identify ascending support structures rather than displaying every possible connection between lows.
Falling Resistance Trendlines
Falling resistance trendlines are calculated from qualifying swing highs.
When directional slope filtering is enabled, the newer swing high must be lower than the older swing high.
This helps identify descending resistance structures clearly on the chart.
Controlled Number of Trendlines
The indicator allows the trader to control how many trendlines are displayed.
Default settings are:
-
Maximum total trendlines on chart: 4
-
Maximum upward trendlines: 2
-
Maximum downward trendlines: 2
These values can be changed from the Inputs.
The indicator may display fewer lines when the available market structure does not contain enough qualifying trendlines.
It does not create artificial trendlines simply to reach the selected maximum.
Multi-Timeframe Analysis
Smart Trendline Detector can analyze a timeframe different from the timeframe currently displayed on the chart.
For example:
A trader can keep an XAUUSD M5 chart open while setting the indicator analysis timeframe to M15 or H1.
This allows higher-timeframe trendline structures to be viewed directly on a lower-timeframe trading chart.
The analysis timeframe can be selected from the indicator Inputs.
Historical Bars to Analyze
The indicator scans up to 500 historical bars by default.
The number of historical bars can be increased or reduced depending on the amount of market structure the trader wants the indicator to analyze.
A larger historical window can identify longer-term structures, while a smaller window focuses more heavily on recent price action.
Limited Future Extension
Trendlines do not extend infinitely into empty future chart space.
The Future Bars setting controls how far active trendlines are projected beyond the current market.
Default:
Future Bars = 7
For example, when the analysis timeframe is M15, the active trendline is projected approximately seven M15 bars into the future.
This keeps the chart cleaner while maintaining the current trendline structure.
Touch Markers
When price reaches the configured tolerance around an active trendline, Smart Trendline Detector can place a small touch marker at the interaction point.
The entire trendline does not need to change into a large highlighted line.
This keeps the chart visually clean while still showing important price interactions with the trendline.
Touch markers can be enabled or disabled from the Inputs.
Broken Trendlines
Trendline breaks are confirmed using closed-candle price data.
When a qualifying trendline is broken:
-
the active trendline is removed
-
the historical line can remain visible
-
the broken line stops around the break candle instead of extending indefinitely
-
the broken structure is displayed using a separate dashed style
-
an optional break marker can be displayed
The number of retained broken trendlines can also be controlled.
Swing Points
Swing highs and swing lows are used internally to construct the trendline candidates.
Swing-point dots can optionally be displayed on the chart.
For a cleaner default appearance:
Show Swing Dots = false
Traders who want to inspect the exact anchor points can enable them from the Inputs.
Smart Filtering
The indicator includes a minimum-distance filter between swing anchors.
This helps prevent very closely spaced swing points from creating unnecessary short trendlines.
The default minimum distance is adjustable.
Historical Violation Filter
Potential trendlines can also be filtered according to historical price violations.
This helps prevent structures that repeatedly cut through price from being ranked as clean active trendlines.
The allowed number of historical violations can be adjusted from the Inputs.
Main Inputs
Analysis
InpTimeframe
Selects the timeframe used for trendline calculations.
InpLeftBars
Controls swing-point confirmation on one side of a potential pivot.
InpRightBars
Controls swing-point confirmation on the other side of a potential pivot.
InpBarsToCheck
Controls the number of historical bars scanned. Default: 500.
EqualTolerancePoints
Tolerance used when comparing relevant price structures.
InpTouchPoints
Tolerance used for identifying price interaction with a trendline.
UseSmartFilter
Enables or disables filtering of closely spaced swing anchors.
MinBarsBetweenSwings
Minimum distance between qualifying swing points.
MaxAllowedHistoricalViolations
Controls how many historical trendline violations are permitted.
Trendline Limits
MaxTrendlinesOnChart
Maximum total number of trendlines displayed.
Default: 4.
MaxUpwardTrendlines
Maximum number of rising support trendlines.
Default: 2.
MaxDownwardTrendlines
Maximum number of falling resistance trendlines.
Default: 2.
RequireDirectionalSlope
When enabled, support lines must rise and resistance lines must fall.
Display
FutureBars
Controls future trendline extension.
Default: 7.
ShowSwingDots
Shows or hides swing anchor markers.
Default: false.
ShowTouchMarkers
Shows or hides price-touch markers.
ShowBrokenLines
Controls whether recent broken structures remain visible.
MaxBrokenLinesToShow
Controls the number of retained broken trendlines.
ShowBreakMarkers
Shows or hides the trendline break marker.
Ranking
UseRanking
Enables the trendline ranking system.
RankTouchWeight
Controls the importance of structural touches.
RankSpanWeight
Controls the importance of anchor-point distance.
RankRecencyWeight
Controls the importance of recent market structure.
RankViolationPenalty
Controls the ranking penalty applied to permitted violations.
Style
UpTrendlineColor
Color used for rising support trendlines.
DownTrendlineColor
Color used for falling resistance trendlines.
TouchMarkerColor
Color used for touch markers.
BrokenColor
Color used for broken trendlines.
ActiveLineWidth
Width of active trendlines.
BrokenLineWidth
Width of broken trendlines.
BrokenLineStyle
Style used for broken trendlines.
How to Use
-
Attach Smart Trendline Detector to any MetaTrader 5 chart.
-
Select the timeframe you want the indicator to analyze.
-
Adjust the historical bars and swing settings if required.
-
Set the maximum number of upward, downward and total trendlines.
-
Allow the indicator to identify and rank qualifying trendline structures.
-
Use the displayed trendlines together with your own trading methodology and risk management.
Designed for a Clean Chart
Smart Trendline Detector is designed to keep trendline analysis useful without unnecessarily covering the chart.
The combination of:
-
ranked structures
-
controlled trendline limits
-
limited future projection
-
optional swing dots
-
compact touch markers
-
clean broken-line handling
helps maintain a clear view of price action.
Important Information
Smart Trendline Detector is a technical-analysis and chart-visualization tool.
It does not open, modify or close trades.
It does not provide guaranteed Buy or Sell signals.
Trendlines are calculated mathematically from the selected indicator settings and the available price data.
Different symbols, timeframes and parameter combinations can therefore produce different trendline structures.
The indicator should be used as an analytical aid together with the trader's own strategy, market analysis and risk-management process.
