Structure Adaptive Trend [AlgoNorth]

9 407
Structure Adaptive Trend

Most trend lines are either too fast and flip on every pullback, or too slow and miss half the move. This one changes speed with the structure itself. Every BOS gives the line a push so it rides the breakout tight to price, then it eases off and lets the pullback breathe without flipping, even when price crosses the line, and the side only changes on a CHoCH. One smooth line that moves the way a structure trader reads the chart.

Beside the live bar, a swing map draws the structure the line is following: HH, HL, LH, LL, with the two levels that decide what happens next shaded as a hold zone. Close through one and the trend extends. Close through the other and it flips. A panel reads the live price against both levels and says, in plain words, what the next close would change.

Swings are confirmed pivots, every break is a candle close through a confirmed swing, and every change to the structure happens on bar close.

🔶 USAGE

🔸 Side. The line and the candles are green while structure is bullish and red while it is bearish. A CHoCH flips both. A candle across the line without a CHoCH gets a grey tether column, so you can see price has crossed the line while structure still holds.

🔸 Tether columns. One column from each candle to the line, brightest at the candle and fading towards the line. The further price pulls away, the longer the column, so the stretch from the line is visible at a glance.

🔸 CHoCH tags. A ring on the line marks the close that flipped structure, with a dotted stem off the wick tip out to a ▲ CHoCH or ▼ CHoCH tag that sits clear of the nearby candles.

🔸 Failed breaks. When a BOS is closed back through within a few bars, a dashed line at the broken level is tagged “failed break”. It is drawn on the close that reclaimed the level and runs back to the break.

🔸 Swing map. To the right of the live bar the last swings are drawn at their real prices and labelled HH, HL, LH or LL, with time between them squeezed to an even spacing. The first node carries ••• when the structure continues to the left, off the map. A dashed leg runs from the last confirmed swing to the live price, ending where the next node will appear once it confirms, and a NOW tag sits on the live price.

🔸 Hold zone. The shaded zone on the map spans the two live levels, each tagged with its price. In an uptrend a close above the top level is the next BOS and a close below the bottom level is the CHoCH; in a downtrend the roles swap. After a BOS or CHoCH the trend-side level is empty until the next swing confirms, and the panel says so.

🔸 Panel. The large line reads the live price against the two levels: HOLDING ABOVE THE HL, NEW HIGH FORMING, ABOVE THE HH · a close here = BOS, BELOW THE HL · a close here = CHoCH, and so on, with the sentence beneath it saying what a close would change. Below that are the two levels with their distance from price in ATR, the BOS count and age of the current trend, the average trend on this chart from CHoCH to CHoCH, how often past BOS held, and how often past CHoCHs went on to make a BOS. The averages and rates show their sample counts.

🔶 DETAILS

🔸 Structure. A swing high is confirmed when the Swing length bars either side (default 3) have lower highs, and a swing low the same way with higher lows. A close above the last unused swing high is a BOS in an uptrend and a CHoCH in a downtrend; a close below the last unused swing low is a BOS in a downtrend and a CHoCH in an uptrend. Each swing is used once. The first break on a fresh chart sets the initial side.

🔸 Line speed. The target length is the fast length on the break close and climbs to the slow length in equal steps over the ease-back bars. The actual length closes a fixed share of the gap to that target each bar, so the line has no kinks, and a short second smoothing keeps it one clean curve. With the default settings the line reaches about half the slow length before easing back; more ease-back bars let it get closer to the fast length.

🔸 Map labels. A swing is labelled against the previous swing of the same kind: a higher high is HH, a lower high is LH, a higher low is HL, a lower low is LL. Equal highs read LH and equal lows HL, since a swing only counts as a new extreme when it goes past the last one. The first swings on a chart, with nothing before them, are grey.

🔸 Structure scale. The map, hold zone and panel run on their own swing length. Left at the line’s swing length they show the same structure the line is following. Raise it and they track the larger swings and the bigger trend while the line, tether and CHoCH tags stay on the finer structure.

🔸 Failed-break window. A BOS fails when a close comes back through the broken level within the failed-break window (default 3 bars) after the break close; otherwise it held. The panel’s BOS held rate uses the same window, counted on closed bars only. A new BOS inside the window counts the previous one as held.

🔸 Trend stats. A trend runs from one CHoCH to the next. The panel’s average trend is the mean BOS count and length in bars over the completed trends on the chart; the first trend on a chart, which did not start with a CHoCH, is left out. CHoCH → BOS is the share of past CHoCHs that made at least one BOS in the new direction before the next CHoCH.

🔸 Panel state. The large line and the two level rows read the live price as it moves, so they update within the bar and settle on the close. Everything else, the line, the colours, the marks and every count, is set on closed bars only.

🔶 SETTINGS

🔸 Structure: swing length.

🔸 Trend line: fast length after a BOS, slow length when settled, bars to ease back, line smoothing.

🔸 Visuals: bullish, bearish and crossed colours, tether columns, colour candles by side.

🔸 Swing map: on or off, structure scale, swings shown, gap from the last bar, space between swings.

🔸 BOS / CHoCH: CHoCH tags, tag gap past the candles and gap between wick and stem in ATR, failed-break levels, failed if reclaimed within N bars.

🔸 Panel: on or off, position, text size.

🔶 NOTES

🔸 Three things on the chart follow the live price: the dashed forming leg and the NOW tag on the swing map, and the panel’s state and level rows, the same way a candle that is still open moves until it closes. Everything else is set on the close of the bar and stays fixed from then on. The line’s side, the candle colours, the swing structure and every count are placed once the bar has closed, a confirmed swing or break never moves, and the next map node is added only once its swing is confirmed, apart from the two drawings below.

🔸 A swing is confirmed after the next 3 bars (Swing length, default 3), so map nodes and new BOS or CHoCH levels appear a few bars after the high or low. A break needs a candle close through the level; a wick through it is not a break.

🔸 Two drawings finish over a few bars by design: a CHoCH tag can step further out if one of the next two candles reaches it, so it always sits clear of the candles, and a failed-break level appears on the close that reclaims the level and is drawn back to the break it marks.

🔸 The panel’s rates are this chart’s own history on the map’s structure scale, shown with their sample counts. They describe how structure has behaved on this chart, not what the next break will do. The script is a context tool for reading structure and the trend line, not a signal generator, and it does not give buy or sell signals.

🔸 The most recent 120 CHoCH tags and 100 failed-break levels are kept, and older ones are removed whole.

🔸 The preview has Colour candles by side turned on. It is off by default, and the line, tether and tags read the same with it off.

🔸 Built for standard candle charts, where every swing, break and count comes from traded prices. Other chart types are not supported.

🔶 SUMMARY

Structure Adaptive Trend is a trend line that changes speed with the structure. Every BOS gives it a push so it rides the breakout tight to price, then it eases off and lets the pullback breathe without flipping, and the side only changes on a CHoCH. Beside the live bar a swing map draws the structure the line is following, with the two levels that decide what happens next shaded as a hold zone: close through one and the trend extends, close through the other and it flips. A panel reads the live price against both levels and says what the next close would change.

免责声明

这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。