已更新

Unbroke Auto Trendlines

343
TITLE:
Unbroke Auto Trendlines

DESCRIPTION (paste everything below this line):
Unbroke Auto Trendlines is a drawing aid that connects confirmed swing highs and swing lows into trendlines, marks when price closes through them, and counts what happened after each break compared with random bars.

What it does
  • Finds swing points with 10 bars on each side. A swing is used only once it is confirmed (10 bars later), so lines are drawn late and never repaint.
  • Connects the last two falling swing highs (down line) and the last two rising swing lows (up line). Lines steeper than 0.2 ATR per bar are skipped.
  • A break is a bar CLOSE through an active line. Breaks get a label; unbroken lines retire after 300 bars.
  • Active lines are projected 5 bars right; up to 12 old lines stay on the chart.


The Proof panel
  • For each break: did price run 1 ATR(14) in the break direction before 1 ATR against, within 24 bars? Random bars (5% per bar, seeded, 50/50 long/short) are scored with the same rule.
  • The panel (default Bottom Right) shows break count, the break and random rates, and the false-break share. All history is labelled descriptive; there is no verdict before the registered read.


In-sample (descriptive only)
On about 10 weeks of 5m data (Aug 16 - Oct 23, 2026) used while building it, breaks ran 1 ATR first about as often as random bars: NQ -0.5 points (95% CI -7.6 to +6.7), ES -1.8 points (95% CI -9.6 to +6.0), CIs from a CME-session bootstrap. Both intervals include 0, so no difference was shown. This data was seen during the build and is not a test.

Inputs
Swing length, slope filter, retire age, panel (position, offset, detailed, text size), horizon, random entry rate, seed, forward start, registered read, theme, glow, dotted anchor, break labels, old lines kept, label size, projection, keep last line, export.

Limitations
  • Lines appear only after a swing is confirmed (10 bars by default).
  • Trendlines are a drawing reference, not a prediction; many breaks reverse.
  • Results depend on the history your plan loads.


Forward test
Live forward test running on NQ1! 5m with default settings from Oct 26, 2026; results to be published on Oct 29, 2027 (16:00 ET).

Originality
Original Pine Script v6 code by Unbroke, open-source under MPL 2.0. No third-party code is used.

Educational, not financial advice. Past results don't predict future results.
發行說明
In simple terms: what it does and how to use it
  1. Add it to your chart. It draws trendlines for you by joining recent swing highs (the tops of price bumps) and swing lows (the bottoms of dips). A line only appears once a swing is confirmed, 10 bars later, so lines show up a bit late but never move or disappear after the fact.
  2. The up line runs under price along rising lows; the down line runs above price along falling highs. Use them as a quick map of where the trend has been.
  3. When a candle closes through a line, it is marked as a break. A break is a heads-up to look closer, not an order to buy or sell. Many breaks reverse.
  4. The Proof panel shows how often breaks moved your way compared with random moments on the same chart. In our tests they were about the same as random, so judge it on your own chart before relying on it.

Example chart:
Red line = a falling trendline drawn across recent tops; green line = a rising trendline drawn under recent bottoms. A BRK label marks the candle that closed through a line; watch whether price keeps going or snaps back, and check the panel to see how breaks compared with random moments.

Updated preview chart.

免責聲明

這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。