TradingView chart workflows

Round-number indicator: tick size, grid steps and alerts

A round number indicator draws a price grid at a chosen interval, such as every 5 dollars or 0.0050 on a currency pair. The interval must fit the symbol's minimum tick size. Measure proximity in price units or ticks and specify when to evaluate it. A horizontal grid identifies numerical levels; it does not show resting orders, prove support or resistance, or predict a reversal.

See the decision guide

Convert quote units into valid ticks

Let t be the minimum tick size and S the desired grid step in quoted price units. Require S > 0 and S / t to be a whole number. With a zero anchor, the grid is ..., -S, 0, S, 2S, ... . For a tick-aligned price P, the nearest grid level is round(P / S) × S. The script below carries out the distance comparison in integer ticks to reduce decimal rounding errors.

  • Read the quote currency and tick size for the exact dataset. A price point is not necessarily a dollar of profit: futures contract value also depends on the contract multiplier.
  • For a 0.25 tick, a 10-point grid contains 40 ticks. A 0.30-point step is invalid because it contains 1.2 ticks; reject it rather than silently changing the grid.
  • A zero anchor is a convention. An offset grid would require a tick-aligned anchor A and levels A + k × S, and is outside this example.

Stock, forex and crypto steps use different units

These are hypothetical configurations and prices, not live quotes or recommended settings. Forex pip size and a feed's minimum tick are separate concepts. For the EUR/USD example only, one pip is defined as 0.0001; a five-decimal feed has ten ticks per pip.

  • Do not enter 50 into a quote-unit input when you mean 50 EUR/USD pips; the example requires 0.0050. JPY-quoted pairs use a different pip convention, so convert explicitly.
  • Crypto precision varies by venue and instrument. Use the current symbol's tick value instead of applying the assumed $0.01 from this table to every coin.
  • A finer grid draws more nearby levels but does not add evidence that those levels matter. A wider grid and fewer visible lines can make the chart easier to inspect.
Illustrative marketAssumed tick and selected stepPrice → nearest levelDistance and selected tolerance
USD stockt = $0.01; S = $5 = 500 ticks$104.98 → $105.002 ticks = $0.02; within a 2-tick tolerance
EUR/USDt = 0.00001; S = 0.0050 = 500 ticks (50 pips)1.10490 → 1.1050010 ticks = 0.00010 (1 pip); within 10 ticks
BTC/USD on an assumed feedt = $0.01; S = $500 = 50,000 ticks$67,490 → $67,5001,000 ticks = $10; within 1,000 ticks

Use price distance instead of visual contact

Define distance d = |P - L| / t, where L is the nearest level, and qualify proximity when d ≤ N ticks. A zero tolerance requires an exact tick-aligned match. Keep N below half the step in ticks so adjacent proximity zones cannot overlap. Pixel width, zoom and line thickness do not belong in this calculation.

  • With S = $5, t = $0.01 and N = 2, the zone around $105 is $104.98 through $105.02, inclusive. A $104.97 close is outside; $104.98 is inside.
  • The example signals when a confirmed close first enters a zone after the previous close was outside, or when it finishes near a different grid level. Remaining near the same level does not repeat the signal.
  • A wick can pass through $105 and close at $104.90 without qualifying. A gap from $104.90 to $105.10 also fails this close-distance rule, even though the price moved across the level.
  • Testing whether a bar range overlaps a zone answers a different question. OHLC bars cannot establish every trade or the intrabar sequence, so do not label a range overlap as a verified fill.

Copy a Pine Script v6 grid with a close-distance alert

Paste this indicator into Pine Editor, add it to a standard candlestick chart and set the quote-unit step and tick tolerance for that symbol. The default 5.0 step and 2-tick tolerance are demonstration inputs. Invalid steps or overlapping tolerance zones stop the script with an explanatory error.

  • The seven blue lines surround the latest nearest level and move as the current price changes. Their backward extension is a display of the current grid window, not a historical record of which seven levels were visible.
  • The Data Window shows the nearest level and distance in ticks. Historical circles show close-based zone entries after the first bar; they are observations, not trade entries or backtest results.
  • At a midpoint, the rounding convention selects the higher grid level. The required tolerance below half a step prevents the midpoint from becoming a proximity signal.
  • The script reads chart prices, which can be synthetic on Heikin Ashi or Renko. Use standard candles for the stated interpretation.
Seven nearby horizontal levels; integer-tick proximity; confirmed-close entry condition. Syntax checked on 2026-10-17.pinescript
//@version=6
indicator("Round-number grid and distance", overlay=true, max_lines_count=7)
stepPrice = input.float(5.0, "Grid step in quote units", minval=0.00000001)
toleranceTicks = input.int(2, "Proximity in ticks", minval=0)
tick = syminfo.mintick
stepTicks = int(math.round(stepPrice / tick))
if barstate.isfirst
    if stepTicks < 1 or math.abs(stepPrice / tick - stepTicks) > 0.000001
        runtime.error("Grid step must be a positive whole number of ticks.")
    if toleranceTicks * 2 >= stepTicks
        runtime.error("Proximity must be less than half the grid step.")
priceTicks = int(math.round(close / tick))
nearestTicks = int(math.round(float(priceTicks) / stepTicks)) * stepTicks
nearestPrice = math.round_to_mintick(nearestTicks * tick)
distanceTicks = math.abs(priceTicks - nearestTicks)
near = distanceTicks <= toleranceTicks
entered = bar_index > 0 and near and (not near[1] or nearestTicks != nearestTicks[1])
signal = barstate.isconfirmed and entered
var grid = array.new_line()
if barstate.isfirst
    for i = 0 to 6
        array.push(grid, line.new(bar_index, close, bar_index + 1, close, extend=extend.both, color=color.new(color.blue, 55)))
if barstate.islast
    for i = 0 to 6
        level = math.round_to_mintick((nearestTicks + (i - 3) * stepTicks) * tick)
        levelLine = array.get(grid, i)
        line.set_xy1(levelLine, bar_index, level)
        line.set_xy2(levelLine, bar_index + 1, level)
plot(nearestPrice, "Nearest grid level", display=display.data_window)
plot(distanceTicks, "Distance in ticks", display=display.data_window)
plotshape(signal, title="Entered proximity at close", style=shape.circle, location=location.belowbar, color=color.blue, size=size.tiny)
alertcondition(signal, "Entered round-number proximity", "Close entered a round-number zone. Check the chart and saved settings.")

Create the alert and check its boundaries

After configuring the indicator, open Create Alert in TradingView, select this indicator and the Entered round-number proximity condition, then choose Once Per Bar Close. Code exposes a condition; you must create the running alert in TradingView. Alerts apply to realtime bars and do not send a backlog of historical circles.

  • Check the alert name, symbol, timeframe, inputs and notification destination before creating it. Changing the script or chart inputs does not update a running alert; recreate the alert for the new configuration.
  • For the $105 example, a sequence of closes 104.97, 104.98, 105.01, 105.03, 105.02 produces entry observations on the second and fifth closes. This is a formula check, not a live alert-delivery test.
  • A jump from inside one zone to inside a different zone produces a new observation. A jump that ends outside every zone does not.
  • Close confirmation delays the observation until the bar finishes. This reduces intrabar flicker but intentionally misses temporary approaches that disappear before the close.

Keep psychological levels as a testable hypothesis

Psychological levels trading refers to interpreting memorable prices as potential decision points. This grid supplies no order-book or participant-position data. A claim that orders cluster at a particular level needs separate evidence, and a level can be crossed repeatedly without a useful reaction.

  • Before collecting observations, define what would count as a reaction: for example, the next three closed bars reaching a fixed distance away before a fixed distance through the level. Choose the distances and horizon beforehand.
  • Record every qualifying event, including immediate failures and no-reaction cases. Preserve the grid settings and a chart screenshot or reference alongside the observation time.
  • Changing the spacing after seeing the outcome changes the hypothesis. Keep that trial separate and test it on later data. Fees, spread and execution would need their own rules before turning observations into a strategy.

Turn the measured condition into a reviewable workflow

Give the Pine Script AI Coding Agent the symbol context, grid anchor, step units, tolerance and timing rule when requesting changes to this example. Review the generated source and validate it on TradingView before relying on its alerts. The agent can help write or revise chart logic; a grid cannot recover missing order data.

  • A useful request states: zero-anchored grid, step in quote units, tolerance in ticks, one observation per confirmed-close zone entry, and no trade execution.
  • Use Trading Journal notes or diary entries to retain the hypothesis, settings and review. Include a chart screenshot link in the review; distinguish an observed approach from an executed trade.
  • Record missed and failed cases as well as apparent reactions. A syntax-valid script and a selected chart screenshot do not establish predictive accuracy.
Where Pineify fits

Pine Script AI Coding Agent

Describe your grid and distance conditions, then inspect and revise the generated Pine Script. Verify chart behavior and alert settings separately from syntax.

Also useful: Trading Journal. Keep the settings, hypothesis and dated review beside your trading records so later observations can be compared with the original rule.

Explore the Pine Script AI Coding Agent

Frequently asked questions

Educational information, not investment advice. All prices and configurations are hypothetical. This indicator does not place orders or establish profitability, and no live alert-delivery test is claimed.

Sources and verification

Published by Pineify. Pineify is an independent product and is not affiliated with TradingView. Sources support the technical explanations; examples do not establish trading performance.