OPEN-SOURCE SCRIPT

Market Structure Pivots Trend

14 804
This indicator identifies and visualizes key market structure by plotting confirmed, non-repainting pivot points. It goes beyond simple markers by classifying the pivots, extending dynamic support/resistance lines, and providing a visual representation of the current trend state.

Key Features:

Non-Repainting Pivot Detection:

Uses a standard lookback method (left and right bars) to identify historical pivot points.

Note on Confirmation: Pivots are only confirmed after the Pivot Right Bars input has passed. This is essential for ensuring the signal is non-repainting, but it introduces an inherent lag.

Automatically classifies the sequence of pivots according to Dow Theory: Higher Highs (HH), Higher Lows (HL), Lower Highs (LH), and Lower Lows (LL).

Pivot Classification Filter:

Price Tolerance Filter: A user-defined percentage tolerance filters out insignificant market noise. A pivot is only classified as 'Higher' or 'Lower' if its price exceeds the previous one by more than the set tolerance, leading to more robust signals.

Equal Pivot Detection: The tolerance also enables the detection of Equal Highs (EH) and Equal Lows (EL), highlighting consolidation zones.

Dynamic Support & Resistance Lines:

When enabled, the indicator extends a horizontal line from the most recent confirmed pivot high and low.

These lines update in real-time, providing clear S/R levels.

Lines automatically terminate if the price decisively breaks through them or if a new pivot of the same type is formed.

Trend State Visualization:

A built-in state machine analyzes the sequence of pivots and breaks to determine the current market trend (Uptrend, Downtrend, or Neutral).

Plots a dynamic step-line based on recent highs/lows to visually represent the current trend state.

Full Customization & Alerts:

Display Options: Choose between simple triangles or detailed text labels that show the pivot type, price, and the absolute or relative change from the previous pivot of the same type.

Visual Styling: Full control over colors for all six pivot types (HH, LH, EH, LL, HL, EL) and line styles.

Comprehensive Alerts: Set up alerts for every new pivot formation (e.g., HH, LL), for S/R line breaks, and for changes in the overall trend state (Up, Down, Neutral).

DISCLAIMER

For Informational/Educational Use Only: This indicator is provided for informational and educational purposes only. It does not constitute financial, investment, or trading advice, nor is it a recommendation to buy or sell any asset.

Use at Your Own Risk: All trading decisions you make based on the information or signals generated by this indicator are made solely at your own risk.

No Guarantee of Performance: Past performance is not an indicator of future results. The author makes no guarantee regarding the accuracy of the signals or future profitability.

No Liability: The author shall not be held liable for any financial losses or damages incurred directly or indirectly from the use of this indicator.

Signals Are Not Recommendations: The alerts and visual signals (e.g., crossovers) generated by this tool are not direct recommendations to buy or sell. They are technical observations for your own analysis and consideration.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.