Volatility · Unit conversion · Existing implementation

ATR Pips: verify the unit before using the number

The Pineify indicator named ATR Pips multiplies ATR by point value and a scale factor, then rounds down. This is not a general conversion to pips. A correct pip-distance calculation needs the instrument's pip size; confusing that size with a contract multiplier can produce a materially different result.

Pip size and point value answer different questions

TradingView's chart-information documentation defines syminfo.pointvalue as a multiplier of instrument price for the value of a single contract. It separately defines syminfo.mintick as the minimum price increment. Neither is a universal forex pip-size field.

OANDA's pip explanation distinguishes conventional pip movements from fractional pips. Many currency pairs use 0.0001 as one pip and yen-quoted pairs commonly use 0.01. Confirm the convention for the exact instrument and provider; a fifth decimal may be a pipette, not a whole pip.

Pip distance = ATR / pipSize
Scaled pip distance = multiplier × ATR / pipSize
Existing scaled output = floor(pointvalue × multiplier × ATR)

The existing output would match a rounded scaled pip count only when pointvalue happens to equal 1/pipSize, with matching units. That equality must be verified; it does not follow from the field's name.

Synthetic inputsFull pip distance70% pip distanceExisting formula with assumed pointvalue = 1
ATR 0.0020, pip size 0.00012014floor(0.0014) = 0
ATR 0.25, pip size 0.012517.5floor(0.175) = 0

The assumed point value of 1 is an arithmetic test input, not a claim about every TradingView forex feed. With point value 100,000, the first existing calculation instead yields 140. That is still not 14 pips; under an appropriate linear contract convention it may represent a scaled monetary amount.

A five-decimal minimum tick of 0.00001 would convert ATR 0.0020 to 200 ticks. At ten such ticks per pip, this is 20 pips. Keep the tick and pip labels separate.

What the retained function actually computes

  1. Calculate Wilder ATR over the selected ATR length.
  2. Test whether pointvalue is exactly zero. If it is, return an unavailable selected series.
  3. Otherwise, choose raw ATR when showActualAtr is true. In scaled mode, floor the product of point value, multiplier and ATR.
  4. Calculate an SMA and population standard deviation of that selected series. Plot basis plus and minus the band multiplier times that deviation.

The zero-point-value check runs before raw-mode selection. Changing to raw mode therefore does not recover values on that branch. Missing ATR during initialization or another unavailable value is also not the same as a zero reading, and the red Invalid flag specifically tests equality with zero; it is not a complete data-validity test.

Flooring changes the series. An unrounded result of 0.9 becomes 0, and 1.9 becomes 1. A smooth change can become a step, and multiple positive ATR values can map to the same integer. Increasing the multiplier from 0.7 to 1 scales the unrounded value by 10/7, but the rounded output need not increase by that ratio.

The displayed call uses ATR length 20, multiplier 0.7, raw mode false, band window 34 and deviation multiplier 2. These are configuration defaults, not validated optimal settings. The surrounding bands describe the selected volatility series, not a price channel.

Pine Script with the existing calculation

The algorithm below is retained for comparison with Pineify's current indicator. The explanatory comments identify the point-value scaling; they do not claim a universal pip conversion. The source contains no input declarations, trade orders or alert conditions.

Pine Script v6
//@version=6
indicator(title="ATR Pips", overlay=false, max_labels_count=500)

// Existing point-value-scaled ATR with an enclosing statistical band
p_ta_atr_pips(simple int atrLength, simple float pctMultiplier, simple bool showActualAtr, simple int bbLength, simple float bbMultiplier) =>
    _atr = ta.atr(atrLength)
    _isInvalid = syminfo.pointvalue == 0
    _series = _isInvalid ? na : (showActualAtr ? _atr : math.floor(syminfo.pointvalue * pctMultiplier * _atr))
    _basis = ta.sma(_series, bbLength)
    _dev = bbMultiplier * ta.stdev(_series, bbLength)
    _upper = _basis + _dev
    _lower = _basis - _dev
    [_series, _basis, _upper, _lower, _isInvalid]

// 20-period ATR, point-value scale times 0.7, and a 34-period envelope
[p_ind_1_atrLine, p_ind_1_basis, p_ind_1_upper, p_ind_1_lower, p_ind_1_invalid] = p_ta_atr_pips(20, 0.7, false, 34, 2)

plotshape(p_ind_1_invalid ? 0 : na, style=shape.cross, color=color.rgb(229, 57, 53, 0), text="Invalid", location=location.absolute, title="ErrorText")
plot(p_ind_1_upper, color=color.rgb(158, 158, 158, 0), linewidth=2, title="Upper")
plot(p_ind_1_lower, color=color.rgb(158, 158, 158, 0), linewidth=2, title="Lower")
plot(p_ind_1_basis, color=color.rgb(255, 167, 38, 0), linewidth=2, title="Middle")
plot(p_ind_1_atrLine, color=color.rgb(30, 136, 229, 0), linewidth=2, title="ATR/Pips")

Open TradingView's Pine Editor from the Pine icon on the right toolbar. Compile the complete source and compare a completed bar's raw ATR, point value and unrounded product before interpreting the plotted number. Syntax validity does not establish unit correctness.

ATR Pips chart preview with its volatility series and enclosing bands

The blue line is the selected output, orange is its rolling mean and gray lines form its envelope. A red cross at zero marks the explicit zero-point-value condition; it is not an output of zero volatility. The copied example always plots all bands, although Pineify's indicator configuration has a separate display option.

The enclosing bands are not price targets

For a short, synthetic three-value selected series [10, 12, 14], the basis is 12 and the population standard deviation is √(8/3) ≈ 1.632993. At multiplier 2, upper is approximately 15.265986 and lower is 8.734014. These values share the selected series' units. The displayed script uses a 34-value window; three values are used here only to expose the arithmetic.

A lower statistical band can be negative even when every selected value is nonnegative. For [0, 0, 3], the basis is 1 and deviation is √2; a two-deviation lower band is about −1.828427. It is a constructed envelope, not negative observed ATR or a predicted price.

A value above the envelope does not identify market direction, a future return or a calibrated probability. A series can remain above its mean while falling. Compare changes with previous values separately from comparisons with the mean.

For a genuine 20-pip distance with pip size 0.0001, the price distance is 0.0020. An illustrative long entry of 1.1000 with that initial distance has a reference at 1.0980. Subtracting the number 20 directly from 1.1000 would mix units. A target based on the distance between an asset entry and this indicator's mean would have the same problem.

For a fixed loss budget, a larger price-distance assumption generally reduces the permitted quantity before rounding; it does not require a larger position. Cash value per pip, account-currency conversion, spread and actual fills remain separate calculations.

Publication history and a verification workflow

LazyBear's ATR Pips publication is dated May 18, 2015 and describes optional enclosing bands and raw ATR. That publication establishes the named script's history. It does not establish that the present Pineify port correctly converts every instrument to pips, and the source shown here is not presented as a verbatim original.

  1. Record the full provider-specific symbol, timeframe, session, raw ATR, pointvalue, mintick and intended pip size.
  2. Check pip distance by division independently, then compare it with the existing point-value-scaled result and its floor.
  3. Check zero point value, raw mode, unavailable warm-up values and a positive product below 1. Verify the selected series before checking its bands.
  4. For a requested adaptation, require an explicit positive pip-size input and clearly label raw price units, ticks, pips or monetary values. Verify any automatic symbol convention rather than inferring it solely from the ticker name.
  5. If adding a strategy, specify entry, exit, costs and timing separately. The existing line and bands supply no win-rate estimate.

Pineify's ATR Pips configuration is marked as a paid indicator. Review account access and usage before requesting an adaptation. Generated changes still need compilation and numerical comparison.

Discuss a unit-explicit adaptation

ATR Pips questions

No. Its scaled mode floors pointvalue × multiplier × ATR. TradingView defines pointvalue as the contract-value multiplier, not the price size of a pip. A pip distance requires division by a verified pip size. The indicator name alone does not establish the output unit.

Pip size is the price movement used as one pip for that instrument. Tick size is the minimum quoted price increment. Point value is the multiplier used in contract valuation. They have different meanings; none is a universal replacement for the others.

No. The source checks pointvalue == 0 before choosing raw or scaled output. When that check is true, both modes return unavailable values and the red cross is plotted at zero. That marker is not an ATR reading of zero.

Scaled mode rounds down to an integer. Any nonnegative scaled value below 1 becomes zero. Repeated zero outputs can make the enclosing bands collapse even though the underlying ATR is positive. Inspect the unrounded value and units before interpreting a quiet line.

No. The basis and bands are calculated from the selected ATR-derived series, not asset prices. Subtracting a band value from an asset entry price without reconciling units does not produce a meaningful target or risk distance.

The displayed call fixes ATR length 20, multiplier 0.7, raw mode false, band length 34 and band multiplier 2. It has no input declarations. Pineify configuration provides parameters, but this copied example must be edited or adapted to expose them.