This text specifies a hypothetical range-position indicator for a private documentation exercise. No Pine implementation or TradingView chart run is supplied here. Copy the whole draft for planning, then reconcile every statement with your actual source and observations. The standard range-position formula alone does not justify a new public or protected publication.
Unpublished v1.1 description draft; no performance or runtime validation is claimedtext
Title: Closed-bar Range Position Audit
STATUS AND PURPOSE
Private documentation exercise, version 1.1. This draft specifies an indicator for checking where a completed bar closes inside its recent high-low range. It is not a strategy, trading signal service, or public release. No Pine implementation has been validated for this example.
CALCULATION
For a lookback of N chart bars, including the current bar, H is the highest high and L is the lowest low. On a completed bar with N valid OHLC bars and H > L:
Range position = 100 * (close - L) / (H - L).
A value of 0 means a close at L; 100 means a close at H. A value of 50 means the midpoint of this observed range, not a 50% probability of a price move. Before N valid bars are available, or when H = L, the specified output is unavailable. Missing OHLC data also makes the output unavailable.
INPUTS AND OUTPUTS
Lookback bars: integer, default 20, allowed 2 through 500.
Show reference levels: boolean, default true; display only.
Price source: the chart's close, fixed rather than selectable.
The intended pane contains a range-position plot and optional levels at 0, 50, and 100. The current unfinished bar is unavailable; a completed value belongs to that same bar without a negative plot offset.
HOW TO USE
Use standard time-based candles. Start with the default inputs. On a completed bar, inspect the last N highs and lows and reproduce the formula. Compare the result with the Data Window. A high value describes location within the measured range; it does not tell you to buy, sell, or place an order. Changing N changes the question being measured.
ORIGINALITY AND SOURCE HISTORY
The formula is the familiar unsmoothed stochastic range position. This exercise adds a documentation contract for completed bars, unavailable values, and regression checks; it makes no claim of a novel trading method. No third-party script source is reproduced in this draft. If an implementation reuses code, its author must add the actual source, credit, license, and permission details before publication. The exercise is intended to remain private.
REPAINTING AND DATA
The specified output waits for bar close. It makes no higher-timeframe requests and uses no future bars or back-plotted signals. An implementation must be checked against this specification. Reloads, vendor corrections, changed sessions, changed chart types, or changed inputs can still alter the dataset or resulting values. This draft does not certify a script as non-repainting.
LIMITATIONS
A flat range has no defined percentage. Warm-up and missing-data periods are unavailable, not zero. The formula has no fees, fills, trade rules, or return calculation. Synthetic chart prices change its meaning; this exercise excludes them. Closed-bar values arrive later than intrabar estimates. No cross-market, live-alert, or profitability claim is made.
VALIDATION RECORD
Synthetic arithmetic was checked on 2026-10-18: H=110, L=100, close=107 gives 70; close=100 gives 0; close=110 gives 100. H=L=100 gives unavailable in v1.1.
Still pending for an actual implementation: compiler validation, default chart screenshot, warm-up behavior, minimum/maximum input behavior, a live bar closing, reload comparison, and symbol/session/timeframe changes. No live-market test or screenshot is represented as completed.