OPEN-SOURCE SCRIPT
已更新 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.
發行說明
- 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.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
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
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
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
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。