OPEN-SOURCE SCRIPT
Diupdate Trendline Breakouts

Draw a trendline by hand and you will always find one that fits. That is the problem, not the skill.
This script does not let you go looking for it. It builds every line from real swing highs, keeps only the ones a later high confirms, and deletes any line that price has already traded through. The same rule runs on every chart, every timeframe, every time you load it.
How a line earns its place
Two swing highs propose a line. A third high has to land on it, inside the tolerance you set. If any bar in between traded through the line, the line never existed. Nothing here is drawn by eye and nothing is fitted after the fact.
The break ⚡, and what came after it
The first bar that trades above the line closes it and gets a triangle. From there the script assumes an entry at the break level and your stop distance below it, then measures the best move that break went on to produce before the stop was lost. The figure is printed next to the break.
What you control
The touch tolerance, how much slack a line may absorb before it is invalidated, how far price must travel to confirm a break, when a quiet old line fades, and your stop. Tighten it for textbook lines. Loosen it and see how much structure survives.
📊 The panel
Lines found, how many are still unbroken right now, the risk you chose, and the average peak gain across the breaks on screen, always next to the number of breaks behind it. An average without its sample size tells you nothing.
⚠️ Read this part too
The peak gain is the best excursion after the break, not a realised return. It assumes you sold at the exact high, which you will not. Everything is recomputed on the bars you can see, so panning and zooming change the picture. This build measures on a linear price scale and reads bullish structure only.
I hope this helps you to finally draw lines properly so you can trade them confidently.
This script does not let you go looking for it. It builds every line from real swing highs, keeps only the ones a later high confirms, and deletes any line that price has already traded through. The same rule runs on every chart, every timeframe, every time you load it.
How a line earns its place
Two swing highs propose a line. A third high has to land on it, inside the tolerance you set. If any bar in between traded through the line, the line never existed. Nothing here is drawn by eye and nothing is fitted after the fact.
The break ⚡, and what came after it
The first bar that trades above the line closes it and gets a triangle. From there the script assumes an entry at the break level and your stop distance below it, then measures the best move that break went on to produce before the stop was lost. The figure is printed next to the break.
What you control
The touch tolerance, how much slack a line may absorb before it is invalidated, how far price must travel to confirm a break, when a quiet old line fades, and your stop. Tighten it for textbook lines. Loosen it and see how much structure survives.
📊 The panel
Lines found, how many are still unbroken right now, the risk you chose, and the average peak gain across the breaks on screen, always next to the number of breaks behind it. An average without its sample size tells you nothing.
⚠️ Read this part too
The peak gain is the best excursion after the break, not a realised return. It assumes you sold at the exact high, which you will not. Everything is recomputed on the bars you can see, so panning and zooming change the picture. This build measures on a linear price scale and reads bullish structure only.
I hope this helps you to finally draw lines properly so you can trade them confidently.
Catatan Rilis
- New "Chart scale" input at the top of group 1: Regular or Logarithmic, same names TradingView uses on the price axis. On a log scale the slope, the touch check and the break check are all done on log(price), so a straight line on a log chart is treated as a straight line.- The old read-only "Price scale" marker in group 4 is gone; the switch replaces it.
- The panel now shows which chart scale the maths is using.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Most days the market gives you nothing worth playing.
A few times a month it hands you two aces ♠️♦️.
I tell you when that happens & why, after studying more than 8 million patterns across 30 years.
👉topchartpatterns.substack.com/embed
A few times a month it hands you two aces ♠️♦️.
I tell you when that happens & why, after studying more than 8 million patterns across 30 years.
👉topchartpatterns.substack.com/embed
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Most days the market gives you nothing worth playing.
A few times a month it hands you two aces ♠️♦️.
I tell you when that happens & why, after studying more than 8 million patterns across 30 years.
👉topchartpatterns.substack.com/embed
A few times a month it hands you two aces ♠️♦️.
I tell you when that happens & why, after studying more than 8 million patterns across 30 years.
👉topchartpatterns.substack.com/embed
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.