OPEN-SOURCE SCRIPT

Round Number Levels - Response and Control

128
Round Number Levels - Response and Control

Round Number Levels - Response and Control draws a fixed round-number grid and examines what confirmed closes do after price contacts its levels. Two shifted reference grids provide a comparison, using contacts matched by time, approach direction and pre-contact market context.

Use it to keep price levels visible and investigate whether their observed response differs from nearby, equally spaced references. Negative differences, disagreement between the references and insufficient data are all possible results. The indicator does not assume that round numbers must act as support or resistance.

GETTING STARTED

Use a standard time-based chart and check the Interval value before interpreting any statistics. The default interval is 200 minimum ticks, not 200 pips and not a universal setting for every market. This equals 0.200 when the minimum tick is 0.001, or 0.00200 when the minimum tick is 0.00001. Manual price mode lets you specify the interval directly in price units, rounded to whole minimum ticks.

Keep the Compact panel for the main comparison. Standard adds coverage information; Research exposes the detailed sample, individual references and exact-level history. Hover over panel rows and badges for definitions and counts. A Low N or Partial status is information about the available sample, not an instruction to search for settings that produce a preferred result.

For a repeatable study, set the price interval, date window and observation rules before evaluating the displayed differences. Display-only settings, including badge sizes, colors, marker limits and panel detail, do not change the research.

THE FIXED PRICE GRID

ROUND levels are integer multiples of the chosen interval, measured from price zero. The levels are defined before their reactions are observed; the script does not move them toward historical pivots or keep only levels that previously worked.

By default, cyan marks ordinary levels, yellow emphasizes every fifth interval, green marks the enclosing lower level, and pink marks the enclosing upper level. The enclosing colors take priority when a level also qualifies as a major level. The panel shows the exact enclosing prices, tick distances and position within that interval. Optional half-interval guides appear only when the interval contains an even number of ticks. These subdivisions and visual emphasis do not create additional research cohorts.

The opaque price badges use compact, bold monospace digits: 13 points for ordinary round numbers and 14 points for major or enclosing levels. Their fill follows the level color, with automatically selected black or white text. An opaque dark background is also available. Font sizes remain independently adjustable. The default text contains the price only; L/U and major-level prefixes can be restored.

Badges retain the exact level in their text even when displaced for readability. Optional connectors join them to the corresponding horizontal line. The default position is to the left of the line segment, with an additional twelve-bar horizontal gap and a small vertical offset. Badge placement does not change the line price. Very tight spacing or strong chart compression can still cause visual overlap.

Two automatic preview modes choose a 1-2-5 interval once from the first usable prior range or price context. The panel explicitly identifies PREVIEW because the choice can change with the loaded starting history. Copy its displayed interval into Manual price to fix the interval for a repeatable study.

REFERENCE A AND REFERENCE B

Reference A is shifted by 37% of the interval by default, rounded to minimum ticks. Reference B uses the exact complementary tick offset, normally close to 63%. Both references have the same spacing as ROUND. Their lines are optional and hidden by default, but research continues while they are hidden.

All three contact bands must be separate. Overlapping bands pause the comparison rather than creating indistinguishable cohorts. Shifted prices can still be round numbers at a finer scale. These are observational reference grids, not randomized placebos.

CONTACTS AND CONFIRMED OUTCOMES

A contact occurs when a candle's high-low range intersects the band around one grid level. The default half-width is 4% of the interval, with a one-tick minimum. The preceding close must be outside that band by the required clearance; the default clearance is 12% of the interval, with a minimum of one tick beyond the band.

The same bar-quality exclusion applies to all grids. If the opening gap crosses an entire band in any grid, or the candle touches more than one level band in any grid, none of the three grids admits a new contact on that bar. Already active observations continue. This avoids assigning a precise new contact to ambiguous OHLC data.

Every eligible contact is tracked, including contacts that start while earlier ones are unresolved. There is no outcome-dependent busy state or cooldown. A contact is not discarded merely because an earlier observation is taking longer to resolve.

The response distance is fixed at contact. It can be a fraction of the grid interval or a multiple of the preceding finite mean true range. The default is 20% of the interval. The threshold is at least one tick beyond the contact band and does not move with subsequent volatility.

The contact candle is excluded from outcome testing. Subsequent confirmed closes determine the result:

R, Return: the configured number of consecutive closes is at or beyond the threshold on the side from which price approached.

T, Through: the configured number of consecutive closes is at or beyond the threshold on the opposite side.

U, Unresolved: neither condition has been confirmed by the end of the full observation horizon.

Each consecutive-close counter resets when its own condition is not satisfied. The first confirmed R or T result is fixed. A confirmation on the last allowed bar takes precedence over U. Defaults are two consecutive closes within twelve bars after contact; the effective horizon is never shorter than the confirmation count.

These outcomes are not intrabar first touches, executions or trade returns. No entry, stop, target, spread, fee or position-sizing model is applied.

HOW THE MATCHED COMPARISON IS BUILT

The panel does not compare three independently truncated latest-N lists. Its main sample consists of triplets containing one ROUND contact, one A contact and one B contact.

Time is divided into fixed elapsed-time blocks anchored to the Unix epoch. The default block is 128 chart periods, equivalent to 640 elapsed minutes on a five-minute chart. Blocks are not exchange sessions and do not count only traded bars. Loading more preceding history does not move their boundaries. Weekly and monthly chart periods use the platform's seconds conversion rather than calendar-aligned week or month boundaries.

Within a block, contacts are grouped by approach side and optional prior context. The default Side + range + trend mode uses three range groups and three trend groups, separately for approaches from above and below. Side only and Side + range are also available.

Range grouping uses the preceding finite mean true range divided by the fixed interval, with default boundaries of 0.25 and 0.75. Values below 0.25 enter the low group, values from 0.25 to below 0.75 enter the middle group, and values at or above 0.75 enter the high group.

Trend grouping uses the preceding close minus the close ten bars before it. The default neutral band is plus or minus 0.5 times the preceding mean range; values on either boundary remain neutral. All context inputs come from preceding bars, not subsequent outcomes.

Inside each block and context group, the first eligible ROUND, A and B contacts are assigned together, then the second contacts, and so on. The default matching cap is the first eight contacts per grid, context group and block. Later contacts are still observed and exported, but do not enter matching. Their exclusion is counted separately.

A complete triplet must satisfy a fixed maximum spread between its earliest and latest contact times, defaulting to half a block. Failed triplets are not reassigned to different partners. Neither matching nor this time filter consults R/T/U results or resolution speed.

EVERY CONTACT RECEIVES THE SAME HORIZON

Early confirmation does not produce early inclusion in the comparison. Every observation must receive the full configured horizon before contributing, including results already known after only a few bars.

Only complete time blocks whose contacts have all had that horizon enter the panel. Blocks cut by the study dates or the beginning of usable history are excluded. The default window contains the latest twenty-four mature elapsed-time blocks. The study start is inclusive and the study end is exclusive; already admitted contacts continue to receive their horizon after the end date.

Matching gives the three cohorts identical counts by time block, approach side and context group. It does not make their price paths identical. Context groups remain broad, contact horizons can overlap, and unmeasured conditions can differ. Standard and Research show how much of the full contact population the matched sample covers.

READING THE COMPACT PANEL

The default panel has fourteen rows. The MATCHED section uses the same triplets for every main-sample percentage and difference.

N each grid shows the actual denominator: ROUND on the left and A / B on the right. All three numbers are equal. They are neither storage capacities nor counts of visible markers.

Return, Through and Unresolved show the ROUND share and the arithmetic mean of the A and B shares. U stays in the denominator. Hover over a row to see the separate A and B values and underlying counts.

R delta A / B shows ROUND's return share minus A's on the left, and ROUND's return share minus B's on the right. Values are percentage points, not percentage changes or predicted probabilities.

Mean / A-B shows the arithmetic mean of those two differences and their sign relationship. Both + means both are positive; Both - means both are negative. SPLIT means they have opposite signs. Has zero means one or both differences is exactly zero. A positive mean never hides a SPLIT. These labels describe signs, not statistical significance or confidence.

Early / Late splits the retained clock window into two contiguous halves. Each half has its own smaller matched denominator, shown in the tooltip. This is a historical period comparison, not a held-out test.

Main differences require at least thirty matched triplets, five from each approach side and three contributing blocks by default. Half-window comparisons use their own smaller guards. Below the requirements, counts and outcome shares remain visible while the affected differences are withheld. The guards prevent very small comparisons from looking definitive; they are not significance tests.

Standard has twenty-two rows and adds all mature contacts, matched coverage, over-cap contacts, contributing blocks, time spread and window coverage. Research has thirty-two rows and adds matched history at the exact enclosing levels, side counts, separate A/B outcomes, shared exclusions and reproduction details.

MARKERS, LIVE CONTEXT AND ALERTS

R/T/U markers appear on the confirmed bar when an outcome becomes known. Their time is never moved back to the contact bar. Default placement is outside the outcome candle and two preceding candles, plus a range-based margin. The vertical location is for readability, not the studied price or an execution price.

Several outcomes can resolve on one bar. The displayed badge represents the oldest contact resolving there; a plus sign, such as R+, means additional outcomes exist. The tooltip lists the R/T/U counts for that bar. Marker thinning and the maximum marker count affect drawing only.

Markers describe eligible ROUND outcomes before matching. The panel describes matched, fully mature triplets. Counting the chart markers therefore cannot reproduce the panel denominator. Optional threshold lines show only the latest unresolved ROUND contact to limit clutter; other observations continue independently.

The live reference price, enclosing levels, distances and cell shading can update during an open candle. Observation results are updated only on confirmed bars. The panel's matched sample uses closed, fully mature clock blocks, so it does not necessarily change on every new candle.

Four alert conditions are available: a newly admitted ROUND contact, one or more confirmed Return outcomes, one or more confirmed Through outcomes, and one or more Unresolved outcomes. They describe observation events rather than trade instructions. More than one outcome type can occur on the same bar, independently of which representative marker is visible. Create the required alerts in the alert dialog. Recreate existing alerts after changing research settings so that they use the intended configuration.

REPRODUCIBILITY AND NUMERIC RECORDS

Research uses a finite simple mean of tick-quantized true range rather than recursively seeded Wilder ATR. With manual spacing, the same settings and sufficient identical preceding OHLC, extra earlier history does not shift the later context calculations or epoch-based block boundaries. Data revisions, sessions, price adjustments and missing bars can still change results.

Require full start-date context pauses research unless loaded history crosses the requested start with adequate preceding context. Otherwise, the initial partial block is excluded and incomplete coverage is reported. Fixed / full describes coverage of the displayed window; it does not certify the entire requested history or statistical validity.

The RN6_ Data Window outputs retain research protocol 6001. They expose the settings, reported clock window, actual matched N, A/B differences, their mean, sign status and a non-cryptographic OHLC checksum. Equivalent records are emitted for all three grids: contact time, level in ticks, approach side, fixed threshold, result, first confirmation age, context group and ordinal.

Each record is emitted exactly H bars after contact. This permits at most one complete record per grid per bar, even when several early outcomes resolve together. Unmatched and over-cap contacts are still recorded. A negative ordinal marks a partial or date-cut block excluded from panel statistics. Pending contacts are not presented as completed records.

For recomputation, preserve the source, settings and native OHLC export, including sufficient context before the window and the following horizon. The checksum helps identify differences in included data; it is not a cryptographic signature. The optional Pine Logs recipe is a convenience for personal editor copies, not a requirement for using the published indicator.

DESIGN PURPOSE AND LIMITATIONS

The research layer is designed to test a fixed price reference rather than select levels after seeing their reactions. Its contribution is the combination of concurrent observation, shared admission rules, prior-context ordinal matching, a time-spread limit, uniform maturity, identical displayed denominators, explicit disagreement between two references, and symmetrical records for independent recomputation.

This remains observational analysis. Repeated contacts are not independent trials; matching can retain only part of the full population; the first-K limit and context boundaries affect the subset being studied. Changing the interval, period or rules after inspecting results introduces selection risk. Small, negative or inconsistent differences are legitimate findings.

The indicator is free and open-source. It places no orders, fetches no external data and requires no external service. Research is limited to standard time-based charts. Non-standard and tick charts retain the price grid without the research comparison. Neither a positive difference nor a Both + status proves a causal round-number effect, forecasts a future reversal or establishes a profitable trading strategy.

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.