OPEN-SOURCE SCRIPT
Обновлено

Trendline Breakouts

663
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.
Информация о релизе
- 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. Подробнее читайте в Условиях использования.