OPEN-SOURCE SCRIPT

Auction Structure Ledger [JOAT]

1 231
Auction Structure Ledger [JOAT]

Introduction

Auction Structure Ledger is an open-source Pine Script v6 indicator that transforms confirmed pivot behavior into structured auction zones. Instead of treating every swing high and swing low as equally important, the script looks for clustered defended pivots, measures how much volume-confluence exists at those prices, and converts the result into support and resistance shelves that persist, update, and eventually retire as price accepts or fails them.

The problem this indicator solves is structural ambiguity. Many charts contain repeated pivot noise that does not deserve equal visual weight. A single swing high does not automatically represent meaningful supply, and a single swing low does not automatically represent meaningful demand. Auction Structure Ledger filters pivot activity through clustering logic and local volume-confluence so the chart emphasizes defended areas where auction acceptance and rejection are more likely to matter.

The script is useful for traders who think in terms of accumulation, distribution, acceptance, and failure. It does not attempt to forecast the future from one oscillator reading. It organizes the chart around defended reference zones, tracks how price behaves around them, and summarizes the current auction state in a way that can support discretionary analysis or other rule-based systems.

Because it combines pivot clustering with a volume-confluence layer, the indicator is not simply painting boxes around old highs and lows. It is trying to identify where the market repeatedly acknowledged a price region and whether that region still behaves as support or resistance.

snapshot

Core Concepts

1. Pivot Confirmation And Structural Timing

The script uses `ta.pivothigh()` and `ta.pivotlow()` to confirm swing highs and lows with a symmetric lookback. This means zones are only created after the pivot is actually confirmed, which avoids the false certainty that comes from drawing structure before the right-side bars exist.

Pine Script®
float pivotHigh = ta.pivothigh(high, pivotLength, pivotLength) float pivotLow = ta.pivotlow(low, pivotLength, pivotLength)


This is deliberate non-repainting behavior. The structure appears later than the original pivot candle, but it appears only after the market has confirmed the swing.

2. Clustered Defense Rather Than Single-Pivot Noise

Once a pivot appears, the script scans a configurable cluster window to count how many nearby pivots formed within an ATR-based tolerance. That cluster count becomes part of the zone’s strength score.

This is what gives the ledger its auction logic. A zone becomes more meaningful when the market keeps defending the same approximate level rather than printing a one-off pivot and moving on.

3. Volume-Confluence Layer

The script builds a rolling volume distribution across the current price window and checks how much of that distribution sits at the pivot price. That reading is normalized into a confluence percentage.

In practice, this means a clustered pivot with low local volume-confluence is treated differently from a clustered pivot that sits in a high-activity price region. The first may represent weak structure. The second may represent a more meaningful auction shelf.

4. Support And Resistance Shelf Construction

When a pivot passes the cluster criteria, the script creates a zone with ATR-based width. Resistance shelves are built above price with an offered profile. Support shelves are built below price with a bid profile. Each shelf contains a body, a spine line through the midpoint, and an information label summarizing the zone.

The shelf width is not arbitrary. It scales with ATR so zones remain proportionate across different volatility conditions and instruments.

5. Acceptance And Failure Tracking

After a zone is created, the script continues monitoring it. If price trades within the zone and remains inside it, the shelf is counted as accepted. If price closes through the invalidation side of the shelf, it is counted as failed and eventually removed after a short lifecycle buffer.

That behavior matters because the market is not static. A valid shelf today can become irrelevant after repeated acceptance or a decisive failure.

snapshot

Features

  • Cluster-confirmed auction shelves: Builds zones only when pivots cluster within an ATR-based tolerance
  • Support and resistance separation: Maintains bid-side and offered-side structure independently
  • Volume-confluence scoring: Measures how much rolling price-volume concentration supports each shelf
  • ATR-scaled zone width: Keeps shelf geometry adaptive to volatility instead of fixed-width boxes
  • Acceptance and failure tracking: Continues scoring shelves after creation as price interacts with them
  • Confluence ribbon: Displays whether current price is trading in a high-confluence region of the rolling ledger
  • Nearest distance metrics: Shows the ATR distance to the closest active support and resistance shelves
  • Institutional dashboard: Summarizes support count, resistance count, acceptance rate, failure rate, bias, and strongest zone
  • Confirmed-bar alert set: Includes bullish ledger, bearish ledger, fresh support, and fresh resistance alerts
  • Data-window outputs: Exposes structure counts and confluence values for additional interpretation


Visual Elements

  • Auction shelves: Each zone is rendered as a structured body rather than a simple line so the user can read width and tolerance clearly
  • Shelf spine: A dotted midpoint line marks the internal balance area of each shelf
  • Confluence ribbon: The ribbon around price shows whether the current location overlaps with strong rolling confluence
  • Responsive color logic: Support, resistance, touched, and failed states each alter the way the shelf is displayed
  • Compact info labels: Each zone carries its own context label so the chart remains interpretable without opening settings


Best Practices

  • Give more weight to shelves that combine both repeated pivot defense and strong volume-confluence
  • Watch how price behaves on the first return to a new shelf before assuming the level is strong
  • Treat accepted zones and failed zones differently because they tell very different auction stories
  • Use nearest support and resistance ATR distances to understand whether price is extended or structurally balanced
  • Combine the ledger with your own trigger logic rather than assuming shelf presence alone is a complete trade plan


Input Parameters

Structure Engine:
  • Pivot Length: Sets how many bars are required on each side of a pivot to confirm it
  • ATR Length: Controls the volatility measure used for zone sizing and tolerance logic
  • Shelf ATR Width: Sets the width of each auction shelf relative to ATR
  • Cluster Window: Defines how far back the script scans for repeated nearby pivots
  • Cluster ATR Tolerance: Determines how close pivots must be to count as the same structural cluster


Volume Confluence:
  • Volume Window: Sets the rolling price-volume study range
  • Volume Bins: Controls the granularity of the confluence distribution
  • Confluence Strength Threshold: Defines when the ribbon should represent strong price-volume overlap
  • Show Confluence Ribbon: Toggles the contextual ribbon around price


Display:
  • Show Dashboard: Enables the top-right structural summary
  • Color inputs: Allow independent styling for support, resistance, neutral, and panel colors


How to Use This Indicator

Step 1: Start With The Bias Row
The dashboard summarizes whether active support shelves outnumber resistance shelves, whether the market is balanced, and how strong the current ledger looks. This gives immediate context before focusing on individual zones.

Step 2: Identify The Strongest Active Shelf
Check the strongest zone reading and visually locate the shelf with the most emphasis. This is often the most useful structural reference when price approaches an auction boundary.

Step 3: Watch Acceptance Versus Failure
Acceptance means price is interacting with the zone without invalidating it. Failure means price has moved through the wrong side of the shelf. A high failure rate weakens the reliability of the current ledger.

Step 4: Use The Nearest ATR Distances
The dashboard shows the ATR distance to the nearest support and resistance shelves. That helps frame whether price is sitting directly on a structure reference or is trading between meaningful levels.

Step 5: Combine With Your Own Execution Model
Auction Structure Ledger is most useful as a context layer. It defines where defended structure exists. It does not decide entries or exits for you. Use the zones to frame reactions, continuation decisions, or risk placement inside your own process.

Indicator Limitations

  • Pivot-based structure is inherently delayed because the script waits for right-side confirmation before creating a shelf
  • A clustered pivot region can still fail immediately if broader market flow overwhelms the local auction structure
  • Rolling volume-confluence is context-dependent and can shift as the lookback window evolves
  • Zones are analytical references, not guarantees that support or resistance will hold on the next test


Originality Statement

Auction Structure Ledger is original in the way it turns clustered pivot defense and rolling volume-confluence into a persistent auction map. This is more than a standard support and resistance overlay:

  • It requires repeated pivot behavior before treating a level as meaningful structure
  • It combines cluster count and volume-confluence into a unified strength score for each shelf
  • It tracks acceptance and failure after creation so zones remain part of a living ledger rather than a static drawing layer
  • It presents the structure through a bias dashboard and confluence ribbon that helps translate zone behavior into usable chart context


Disclaimer

This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Support and resistance shelves represent historical auction behavior, not guaranteed future turning points. Markets can accept, reject, or ignore any level without warning. Always use independent judgment and appropriate risk management.

-Made with passion by jackofalltrades

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.