OPEN-SOURCE SCRIPT

Foundry Range Ledger [JOAT]

748
Foundry Range Ledger [JOAT]

Introduction

Foundry Range Ledger is an open-source range and auction-structure indicator that maps active supply, active demand, and the live auction corridor between them.

The script is built for traders who need to know where the market is being offered, where it is being defended, and whether price is rotating cleanly between those two points or breaking away from them.

Instead of relying on a large dashboard to explain everything, Foundry is designed so the main value is visible directly on the chart.

The indicator draws split supply and demand boxes, top and bottom rails, an equilibrium reference, an auction corridor, and candle-state coloring so the structure can be read without hunting through text.

The problem Foundry solves is range readability.

Many range indicators either mark too little and disappear once the first break occurs, or they mark too much and become unreadable.

Foundry focuses on a smaller number of cleaner, higher-visibility structures so the trader can immediately understand whether the market is boxed, rotating, absorbing, rejecting, or releasing through an active zone.

snapshot

Core Concepts

1. Pivot-Derived Supply and Demand Seeding

Foundry begins with confirmed pivot highs and pivot lows.

Each confirmed pivot can seed a new zone.

If a new pivot forms close enough to the prior pivot of the same type, the zone is treated as a stronger cluster rather than as unrelated noise.

This lets the script represent repeated defense or repeated supply more clearly than a single-touch model.

2. Split-Zone Construction

Each zone is drawn as a body with two internal halves.

For supply, the upper half represents the more aggressive offer side and the lower half represents the response pocket below it.

For demand, the lower half represents the more aggressive bid side and the upper half represents the response pocket above it.

This creates a cleaner institutional-style visual than a single flat rectangle.

3. Top, Bottom, and Equilibrium Rails

Foundry does not leave the zone as only a filled box.

Each active zone has clear rails at its boundary and a dashed equilibrium line through its center.

These rails make it easier to judge exactly where price is entering, holding, or releasing from the zone.

4. Participation Inside the Zone

The indicator tracks directional participation inside the active zone.

Touches are counted only when price actually interacts with the zone.

Buy-side and sell-side participation are then compared to determine whether the zone is absorbing or rejecting.

This information drives both state text and the internal color emphasis of the split halves.

5. Auction Corridor Logic

When both an active supply zone and an active demand zone exist at the same time, Foundry calculates the live auction corridor between them.

That corridor is the space where price is rotating between opposing areas of interest.

The script highlights that corridor directly on the chart and adds an equilibrium reference so range traders can see where the market is most balanced.

6. Release and Post-Break Behavior

A zone is not immediately forgotten once price breaks it.

Foundry can keep released zones visible as post-break context, allowing the trader to study whether price is cleanly escaping or coming back to retest the released area.

This is important because the first break is often only part of the story.

The retest frequently matters more than the break itself.

7. Candle-State Coloring

Candles are recolored based on where price is interacting.

If price is trading inside active supply, the candles reflect offer pressure.

If price is trading inside active demand, the candles reflect bid pressure.

If price is rotating in the live corridor, the candles shift toward the neutral response color.

This creates immediate chart feedback without cluttered shapes.

snapshot

Features

  • Confirmed supply and demand zones: Zones are seeded from confirmed pivots rather than unconfirmed intrabar motion
  • Cluster-aware strengthening: Repeated pivots near the same level strengthen the visual and informational quality of the zone
  • Split zone bodies: Each supply and demand box is divided internally for cleaner auction reading
  • Boundary rails and midpoint rail: Top, bottom, and equilibrium references remain visible directly on the chart
  • Auction corridor cloud: When both sides are active, the space between them is highlighted as a live range environment
  • Stateful release behavior: Broken zones can remain visible as post-break structure instead of vanishing instantly
  • Retest labels: Optional tags mark when price revisits released structure
  • Zone interaction candle coloring: Price bars reflect supply interaction, demand interaction, or corridor rotation state
  • Six-row dashboard: Only the highest-value summary fields remain, keeping the chart as the primary information surface
  • Confirmed-bar alerts: Alerts are available for releases, retests, active auction states, and balanced corridor conditions


Input Parameters

Range Construction:
  • Pivot Length: Number of bars required on each side to confirm a pivot
  • Cluster Tolerance ATR: Distance allowed between repeated pivots before they are treated as one stronger cluster
  • Zone Width ATR: ATR-scaled depth of each zone
  • Forward Extend Bars: Number of bars the active zone projects forward on the chart
  • Minimum Zone Age: Minimum number of bars before a break qualifies as a meaningful release


Context and Behavior:
  • Show Auction Cloud toggle
  • Keep Broken Zones toggle
  • Show Retest Tags toggle
  • Show Zone Labels toggle
  • Recolor Candles toggle
  • Broken Zone Fade Bars: Controls how long released zones remain visible when historical persistence is disabled
  • Break Body Quality and filter toggle: Prevents weak-body candles from being treated as high-quality releases


How to Use This Indicator

Step 1: Identify Whether Supply, Demand, or Both Are Active

If only supply is active, the market is currently capped from above.

If only demand is active, the market is currently supported from below.

If both are active, price is trading inside a live auction corridor.

That is the first and most important read.

Step 2: Read the Box Geometry, Not Just the Labels

The top and bottom rails define the actual interaction edges.

The dashed midpoint shows the local equilibrium of the zone.

When price enters the zone, watch where it spends time, where it rejects, and whether the candles recolor in the expected direction.

Step 3: Use the Corridor as a Rotation Map

When both zones are active, the space between demand top and supply bottom becomes the tradable balance corridor.

That space is where mean-reversion and auction-style logic are most relevant.

A clean release out of that corridor changes the context immediately.

Step 4: Watch Release Quality

Foundry does not treat every poke outside a zone as equally important.

Body quality can be used as a filter so weak noise does not count the same as committed expansion.

This helps reduce false structural releases.

Step 5: Retests Matter

A released zone that price retests cleanly can be more informative than the initial break itself.

Use the retest labels and the remaining zone structure to judge whether the prior range is truly being left behind or simply probed.

Indicator Limitations

  • Pivot-based zones confirm only after the pivot is complete, so the script will always favor non-repainting structure over earliest possible marking
  • If price trends strongly without forming relevant repeat pivots, the indicator may show fewer zones than a more aggressive retail-style detector
  • A zone is contextual, not predictive; price can ignore supply or demand completely when momentum is strong enough
  • Balanced corridor conditions do not guarantee rotation and can still resolve into directional continuation
  • The recolored candle state is contextual feedback, not an entry signal by itself


Originality Statement

Foundry Range Ledger is original in the way it combines pivot-seeded supply and demand bodies, split internal zone construction, visible auction corridor rendering, participation-aware state handling, and post-break structural persistence into one chart-first overlay.

The script is designed to make range structure visually readable, not to hide it behind a large panel or reduce it to generic rectangles.

Disclaimer

This indicator is provided for educational and informational purposes only.

It does not provide financial advice or trading recommendations.

Supply and demand zones can fail, release, or be ignored entirely by price.

Balanced ranges can break violently without warning.

Always use independent confirmation and risk management.

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.