Auto Trendlines [AFD]Traders!
If this draws fewer lines than the last auto-trendline script you tried, that is not a bug.
Almost every free entrant in this category will connect any two points and call the result a trendline, including points price has already traded straight through. This one will not draw that line at all.
WHAT IT DOES
Two confirmed same-side pivots define a diagonal line - two swing highs for a descending line, two swing lows for an ascending one. Before it is drawn, the pair has to pass four checks, all required:
Same side. Never one high paired with one low.
Progressive. The second pivot has to be lower than the first on a descending line, higher on an ascending one.
No pierce. No bar between the two anchors may have traded through the line.
Still intact now. No bar since the second anchor may have violated it either.
The third check is the one almost everyone in this category skips, and the fourth closes the gap right behind it - a pivot needs time to confirm, so without the fourth check a line could pass the first three and still be dead on arrival, already traded through in the bars since its own anchor. Of every pair that clears all four, the one nearest current price is the one drawn.
It keeps three lines per side by default - one at your Swing Strength setting, and two more at longer multiples of it - so a short, a medium and a long trendline can all be live on the same side at once, each resting on a different swing rather than three readings of the same one.
HOW A LINE LIVES AND DIES
A live line is maintained, not redrawn - its right edge follows price, and its label counts how many bars have touched it within your tolerance. It is retired, dimmed and kept on the chart, never silently deleted, for exactly one of two reasons: price violated it, or its anchor aged past your Bars to Apply setting. A retired line's colour, width and style are yours to set - the defaults reproduce a plain grey dotted line, but a violated line and an aged-out line both use the same styling, because both are "no longer live" and neither claims anything about what happens next.
When a side has nothing to show, an optional note names the refusal directly instead of leaving a blank chart that reads as broken - something like "No valid ascending line - recent pivot pairs failed the validity rule." It disappears the moment a line forms on that side.
THE TWO ALERTS
One alert per side, on one event: a line was violated and retired, on the bar that just closed. That is the whole alert surface.
It does not fire on a developing bar - only once a bar closes.
It does not fire when a line is retired for age. An aged line was not violated, and an alert saying it was would be a false statement about your chart.
It does not tell you what to do next. It names the event and points at the settings that produced it.
There is no alert for a line forming, for a touch, or for price approaching a line.
SETTINGS WORTH KNOWING FIRST
Swing Strength sets how many bars either side of a pivot must confirm it - higher means steadier, later pivots; lower means more of them, sooner and noisier. Pivots Searched sets how many recent pivots each length keeps in its pool to test pairs from. Pierce Tolerance and Touch Tolerance are both a multiple of ATR: Pierce is how far price may travel through a line before it counts as pierced or violated, and Touch is the separate band used only for counting touches. Bars to Apply bounds how old a line's anchor may get before it ages out - 0 means no limit.
Minimum Touches is worth reading twice, because it does not do what it sounds like. Requiring touches before a line can be drawn does not find a better line - it defers the same line's appearance into a later, shorter-lived part of its own life, since touches accrue before the line is drawn, not after. What it actually buys is recency: the lines that survive it are the ones price is currently working on.
Label position offers "Right of line" (default, floats along the line's own slope) or "Below, centered" (sits directly under the line's tip). Either way the label is a plain box with no pointer.
WHAT IT WILL NOT DO
It is not a signal tool. It does not grade a line's strength, does not rank one line against another, and does not name a target, a breakout, or a bounce - each of those is a claim about the bar after the one that just closed, and this script has no view on that. A touch count is a count of what already happened, shown with the tolerance that produced it, nothing more.
WHAT IS DISCLOSED RATHER THAN HIDDEN
A line appears late by design - its anchors are confirmed pivots, so a line shows up Swing Strength bars after the bar that anchors it. That lag is the price of not drawing lines that vanish a bar later.
Whether this script repaints has not been observed on a replay and is not claimed here either way. Its behaviour on a logarithmic price scale is likewise unobserved and unclaimed.
Zero request.*() calls of any kind - every calculation reads the chart's own series.
Open source under the Mozilla Public License 2.0. Indicator

STRX - Multi MA [Touch Detect]STRX - Multi MA is an overlay indicator that plots up to five independently configurable moving averages on the chart. Each moving average can use the chart timeframe or a selected custom timeframe through the Time Frame input, making it possible to combine local and higher-timeframe dynamic levels in a single view.
How it works
The script calculates up to five moving averages, each with its own visibility, length, type, color, touch marker setting, and timeframe selection. When the candle range intersects a moving average value, the script prints a small marker directly on that level to highlight the touch event without adding excessive visual noise to the chart.
Touch detection concept
A touch is detected when the candle’s high-low range crosses the moving average value. This marker is intended as a visual reference only: it helps identify moments when price interacts with a dynamic level, which can be useful for monitoring reactions, retests, confluence areas, or contextual confirmation.
Multi-timeframe structure
Each moving average can remain on the chart timeframe by leaving the Time Frame input empty, or it can be calculated from a custom timeframe. This allows traders to display, for example, higher-timeframe moving averages directly on lower-timeframe charts while keeping all selected averages inside the same overlay.
Inputs
Show MA: enables or disables each moving average.
Show Touch Marks: displays or hides touch markers for the selected moving average.
Length: defines the moving average period.
Type: selects the moving average method, including SMA, EMA, WMA, RMA, and VWMA.
Time Frame: uses the chart timeframe when empty, or a custom timeframe when specified.
Color: sets the display color of the moving average and its touch marker.
Use cases
This indicator can be used to monitor multiple moving averages at once, compare reactions across different dynamic levels, and keep higher-timeframe moving averages visible on lower-timeframe charts. It is designed to support chart reading and market context analysis rather than to function as a standalone entry or exit system.
Notes
Higher-timeframe values requested through the Time Frame input may update according to the source timeframe structure, so their behavior can differ from averages calculated directly on the chart timeframe. As with any analytical tool, this script should be used together with broader market structure analysis and risk management. Indicator

Indicator

Strategy

Strategy

Pivotal MomentsPivotal Moments draws lines for each of up to 500 pivot high and pivot low levels that have never been revisited at the present moment in time. After the Pivotal Moments indicator has been loaded onto chart and any of the subsequent realtime bars that are formed touch or cross a pivot level it is deleted. The duration for how long any touched or crossed pivot levels remain on chart before deletion may be extended by N bars or N units of time.
There are user selectable options for the following:
• Pivot Bars Left : the number of lower highs or higher lows that must be formed before a possible pivot bar can occur.
• Right : the number of lower highs or higher lows that must be formed after potential pivot to validate a pivot bar.
• Lines Show As : the choice of line style to use for the drawn pivot levels includes Dashed, Dotted, or Solid.
• Wide : the number of lines wide for how thick the drawn pivot levels are desired to be on the chart.
• Delay Removal : the number of units that touched or crossed pivot levels will persist on chart.
• Units : the choice of which delay unit type includes nBars, nSecs, nMins, nHrs, or nDays.
• Extend Right : the number of bars right of current bar to extend drawn pivot levels.
• Show : the number of maximum recent drawn pivot levels to keep on chart.
• Colors Used : the colors used for pivots high, low, and dual pivot bars.
• Show Price Labels : the choice whether to show prices for levels.
• On Right : the choice to move prices to right of pivot levels.
• Show Pivot Bars : the choice to colorize pivot bars.
If desired, alerts can be received for whenever new touches or crosses occur for both pivot highs and pivot lows by creating a single Alert. Note that these alerts are triggered by realtime bars which by their very nature are repainting prices, thus the alert creation window will warn of this with an orange exclamation symbol. For an illustration of how to create alerts for this indicator click the chart below:
Credit: this indicator was originally built for @Luckshury, who has graciously given me permission to publish it publicly.
NOTICE: This is an example script and not meant to be used as an actual strategy. By using this script or any portion thereof, you acknowledge that you have read and understood that this is for research purposes only and I am not responsible for any financial losses you may incur by using this script! Indicator

Indicator

Break/Reversal/Touch [Intromoto]This script shows the engulfing breaks, touches and potential reversals for when prices arrives at certain time frame closes.
On publishing it shows the crossovers of the 6 hour, Daily, Weekly, and Monthly time frames.
The candle main signals are contingent on crossing over the closing level, and engulfing the previous candle. Secondary signals occur when the candle low or high touch the closing levels, in the directional color, i.e. you'll get a bearish touch signal if the candle high touches the level, and it's a red candle. Reversals occur when the subsequent candle breaks a closing level, but the current candle engulfs the previous candle in the opposing direction.
If a candles low or high hits a daily, weekly, or monthly close level it also will plot a "D/W/M Touch" in the according direction.
Thanks Indicator

Strategy

Indicator
