OPEN-SOURCE SCRIPT
Cập nhật

Adaptive Hurst Cycle Engine [SpokoStocks]

680
Adaptive Hurst Cycle Engine measures the cycles that are actually present in price, reads where the market sits inside each of them right now, projects the combined cycle forward, and scores its own cycle lows against real price lows so you can see on the chart how well it is doing. Nothing is drawn with hindsight and nothing moves once it is on the chart.

WHAT YOU SEE ON THE PRICE CHART
• A cycle-model line: price with the noise removed and the measured cycles kept. Where it hugs price, the cycles explain the movement; where it drifts, they do not.
• A dashed projected path continuing that model forward from the last bar, built from the current amplitude and phase of each cycle.
• Bars coloured by cycle position, from teal at a trough through violet to crimson at a peak.
• Composite lows scored after the fact: a teal triangle where the composite low landed on a real price low, a small grey triangle where it missed. The dashboard reports the hit rate on the chart you are looking at.

WHAT YOU SEE IN THE PANE
• The composite cycle, the sum of the measured components, with a two-tone fill.
• A diamond at each composite low, placed one bar after the turn and never moved.
• A dashed projection of the composite with the next projected low labelled.
• A background shade when two or more cycles are near a trough at the same time.
• The individual components can be switched on behind a toggle.

DASHBOARD
For each cycle: measured period, spectral power, whether it is rising or falling, and the bar count and date of its next low. Below that: the dominant period, how many cycles are synchronised near a trough, the projected composite low, and the low-accuracy score.

HOW IT WORKS
1. A roofing filter, a high-pass at the longest period and a super-smoother at the shortest, isolates the band in which cycles can exist. Both filters are from John Ehlers' published work.
2. An autocorrelation periodogram, also after Ehlers, measures spectral power for every period in the range on every bar and smooths it over time, so the spectrum reflects persistent cycles rather than single swings. Power is normalised so 100% is the strongest period seen recently.
3. The cycle set is either the strongest spectral peaks above your minimum power (Measured peaks) or Hurst's nominal model built from the dominant period in 2:1 ratios (Harmonic set). Periods are smoothed to prevent jitter. If no peak clears the threshold, the dominant period is used so the chart is never empty.
4. Each cycle is extracted with a band-pass filter tuned to its period. The output and its quadrature give the phase, which tells the script how many bars remain to the next low and peak, and the amplitude.
5. The composite is the sum of the components, Hurst's principle of summation. The projection extends each component as a cosine from its current phase and amplitude and adds them; on the price chart the same projection is placed on top of the trend with its recent slope.
6. Accuracy scoring: when the composite turns up, the previous bar is a composite low. Once the bars on both sides are known, that bar's low is compared with the lowest low of the surrounding window. A match within a quarter of an ATR is a hit. Hits and total are accumulated and shown as a percentage.

HOW TO USE IT
• Check the hit rate first. It tells you, on this symbol and timeframe, how often the composite lows have coincided with price lows.
• Read spectral power per cycle. Below about 50% a cycle is weak on this chart and its dates deserve less weight.
• The next-low column is the working forecast for each cycle; the composite low is where they combine, and the confluence shade marks the windows Hurst's model treats as the most important lows.
• Use the projected path as an expectation, and the bar colours to see at a glance which side of the cycle the market is on.

NON-REPAINTING AND LAG
All filters are recursive and use only closed bars. Composite-low diamonds are confirmed one bar after the turn and fixed. The projection is a forecast redrawn only forward of the current bar. Every causal cycle filter carries a delay of one to two bars; the phase readout and the projection exist to give notice of a low before it happens rather than to remove that delay. The hit and miss triangles are the one deliberately delayed element: they are a scorecard drawn once the surrounding window has closed, not a live signal.

LIMITATIONS
• The spectrum needs roughly twice the longest period of history to settle; the first bars on a chart are unreliable.
• Dates in the dashboard count chart bars and ignore weekends and closed sessions.
• Cycles change; a projection is only as good as the persistence of the cycles behind it.
• The hit rate is descriptive, not a guarantee, and depends on the accuracy window you set.

The roofing filter and autocorrelation periodogram follow John Ehlers, Cycle Analytics for Traders (2013). The cycle-set selection, phase-based low forecasts, composite projection on price, phase colouring and on-chart accuracy scoring are original to this script.
Phát hành các Ghi chú
Version 2

CHANGES
• Added leading trough and peak zones on the price chart and in the pane. They come from the composite's phase and appear as the cycle enters its bottoming or topping window, ahead of the turn.
• Added a single composite-low triangle on the price chart, placed the bar after the composite turns up and never moved.
• Dashboard now shows the live phase reading (rising or falling, degrees to the next peak or trough).
• New alerts: entered trough zone, entered peak zone.
• The low-accuracy score remains in the dashboard as a number, computed from past lows.

NON-REPAINTING AND LAG
All filters are recursive and use only closed bars. The trough and peak zones appear before the turn. The low marker is placed the bar after the composite turns up, which is the earliest a turn can be known without using future bars. The projection is a forecast redrawn only forward of the current bar. The hit rate is a number only; nothing on the chart waits for it.

Thông báo miễn trừ trách nhiệm

Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.