TradingView price scales

Logarithmic vs linear charts: compare the same prices

A linear chart gives equal vertical space to equal price differences. A logarithmic chart gives equal space to equal price ratios: 50 to 100 and 100 to 200 are both a doubling. Use linear spacing to compare price-unit changes and log spacing to compare proportional moves across positive prices. Changing the TradingView price scale changes the display, not the OHLC values of the same bar.

See the decision guide

One price series, two distance calculations

Assume hypothetical year-end prices of 50, 100, 150, and 200 in the same currency. Linear distance is proportional to the price difference. For an ordinary logarithmic axis, distance is proportional to ln(new price / old price), where ln is the natural logarithm. Log values below are rounded to six decimals. These are coordinate distances, not pixels or observed market results.

  • All three vertical steps are equal on a linear axis. On a log axis, the first step is largest and the third is smallest.
  • Compare 50 to 100 with 100 to 200 within that same series. Both ratios are 2, so their log distances are equal. Their linear distances are 50 and 100.
  • Equal percentage changes have equal log distances, but distance is not directly proportional to the simple percentage number. A 100% rise has ln(2) / ln(1.1) = 7.27 times the log distance of a 10% rise, not ten times.
  • Changing the logarithm base rescales every coordinate by the same factor. It does not change which ratios have equal spacing.
MovePrice differenceSimple changeLog distance
Year 0 to 1: 50 to 100+50+100.00%ln(2) = 0.693147
Year 1 to 2: 100 to 150+50+50.00%ln(1.5) = 0.405465
Year 2 to 3: 150 to 200+50+33.33%ln(4/3) = 0.287682

Trendlines: the same endpoints give different midpoints

Take an independent example with price 50 at time 0 and price 200 at time 2, with equal time units. A straight line on a linear axis follows P(t) = 50 + 75t. A straight line on an ordinary log axis follows P(t) = 50 × 4^(t/2). Both meet the endpoints, but one assumes a constant price increment and the other a constant proportional growth rate.

  • The linear midpoint is the arithmetic mean; the log midpoint is the geometric mean. At time 1, a price of 110 is below the linear path and above the log path.
  • This calculation describes two interpolation models. Do not assume every TradingView drawing, indicator, or alert adopts the log model when you switch the chart scale. Check the tool settings and its intermediate price coordinates.
  • Record both anchor times, both prices, and the intended calculation before turning a drawn line into a script condition.
  • Screen angle also depends on chart width, height, zoom, and the time axis. A steeper-looking line alone does not establish faster growth or a stronger signal.
TimeLinear interpolationLog interpolation
05050
1, halfway(50 + 200) / 2 = 125sqrt(50 × 200) = 100
2200200

Compare returns over matching periods

For the original 50, 100, 150, 200 series, the total price increase is 300%: 200 / 50 - 1 = 3. Multiplying the annual growth factors gives 2 × 1.5 × (4/3) = 4. Adding the annual percentage changes would give 183.33%, which is not the compounded result.

  • Log changes add: ln(2) + ln(1.5) + ln(4/3) = ln(4), approximately 1.386294. Convert back with exp(ln(4)) - 1 = 3, or 300%. A log change of 1.386294 is not a simple return of 138.63%.
  • The first doubling, 50 to 100, takes one year. The second doubling, 100 to 200, takes two years. Equal vertical log distances therefore have different slopes: their annualized growth rates are 100% and sqrt(2) - 1 = 41.42%.
  • Across all three years, the compound annual growth rate is 4^(1/3) - 1 = 58.74%. This is a price-only illustration without distributions, fees, or cash flows.
  • A decline from 200 to 100 is -50%; returning from 100 to 200 is +100%. Their log distances have equal magnitude and opposite signs. Equal visual distances do not imply equal signed simple returns.

Switch the TradingView scale and preserve the comparison

In Supercharts, open the price-scale menu by right-clicking the price axis or using its settings control. Select Logarithmic for the log view and Regular for the linear view. TradingView documents that turning Logarithmic off returns to Regular, even if Percent or Indexed to 100 was previously selected.

  • Select a closed standard-candle bar and record its timestamp, open, high, low, and close. Toggle only the price scale, then inspect the same bar again in the Data Window.
  • Keep the date range and panel size comparable. Auto scaling can change how much space the visible range occupies.
  • Check which scale an indicator uses. A separate indicator pane or another price scale may have its own display settings.
ScaleWhat the axis expressesComparison to make
RegularAbsolute price levels with linear spacingEqual price differences
LogarithmicPrice levels spaced by proportional changesEqual ratios between positive prices
PercentLinear percentage changes from a reference pointChange relative to the displayed reference
Indexed to 100A reference value rebased to 100Relative paths from a common base

Audit the OHLC and change calculation in Pine

This Pine Script v6 diagnostic exposes the bar prices and a configurable lookback change in the Data Window. It does not place trades. On the same closed bar, changing only Regular to Logarithmic should leave these numeric outputs unchanged. The script computes its percentage and log changes explicitly; the axis setting does not supply those transformations.

  • With a base close of 50 and a current close of 100, expected outputs are 50 price units, 100 percent, and 0.693147 log change. With 100 and 150, they are 50, 50, and 0.405465.
  • The first lookback bars lack the required base close. Zero or negative prices deliberately produce na for both relative outputs in this diagnostic; the absolute difference remains available when both bars exist.
  • If values differ, check the selected bar, live-bar updates, input length, chart type, session, and adjusted-data settings. Switching to a synthetic chart type or changing data adjustments is a separate operation that can change input data.
  • A price-based moving average does not become an average of logarithms just because the price axis is logarithmic. To test a different formula, change the script explicitly. Scripts that depend on visible chart range also require that range to stay fixed.
Add to standard candles and compare one closed bar before and after toggling the scale.pinescript
//@version=6
indicator("Price scale data audit", overlay=true, precision=6)
lookback = input.int(1, "Lookback bars", minval=1, maxval=500)
basePrice = close[lookback]
absoluteChange = close - basePrice
positivePrices = close > 0 and basePrice > 0
percentChange = positivePrices ? 100 * (close / basePrice - 1) : na
logChange = positivePrices ? math.log(close / basePrice) : na
plot(open, "Open", display=display.data_window)
plot(high, "High", display=display.data_window)
plot(low, "Low", display=display.data_window)
plot(close, "Close", display=display.data_window)
plot(absoluteChange, "Price change", display=display.data_window)
plot(percentChange, "Simple change percent", display=display.data_window)
plot(logChange, "Log change", display=display.data_window)

Handle zero, negative prices, and small price ranges

The ordinary real-valued transformation ln(P) requires P > 0. Zero has no finite log coordinate, and negative prices have no real log coordinate. This mathematical boundary is separate from how a chart platform handles such values for display. If a platform draws zero or negative labels in a log mode, do not apply the positive-price distance model across them.

  • For 10 to -5, the absolute move is -15 and the algebraic simple price change is -150%. ln(-5/10) is undefined over the reals. Inspect the signed prices on a linear axis.
  • For -10 to -5, the price rises by 5, but the ordinary simple-change formula returns -50% because the denominator is negative. Even though ln((-5)/(-10)) can be calculated, ln(-10) and ln(-5) cannot define an ordinary log-price chart.
  • Near one positive price level, the views can look similar: ln(101/100) = 0.009950, close to the simple fractional change of 0.01. Their difference becomes more visible over larger ratios.
  • Adding a constant to make a negative series positive changes its ratios. Do not present that shifted chart as the original percentage history.

Specify the rule or screenshot you want reviewed

For a script review, give Pineify the formula, lookback, source series, and zero-price policy. A condition requiring a rise of 5 price units differs from one requiring 5%: from 50 to 54, the changes are 4 units and 8%, so only the percentage threshold passes.

  • Ask the Pine Script AI Coding Agent to display both calculations and their Boolean results for inspection. Review its generated source and compare closed bars before using the condition.
  • For AI Chart Analysis, upload a chart with readable axes and label the scale, symbol, timeframe, and capture time. Keep the same date range when comparing two screenshots. A picture cannot establish an exact formula or future outcome.
Where Pineify fits

Pine Script AI Coding Agent

Turn an explicit price-unit or percentage condition into editable Pine Script, then compare the generated calculations with known examples.

Also useful: AI Chart Analysis. Submit a chart image for review with its price scale and timeframe clearly labeled. Verify observations against the underlying prices.

Compare price conditions with Pineify

Frequently asked questions

Educational chart and calculation examples, not investment advice. Hypothetical prices do not represent backtest results. Chart scale, line fit, and image analysis do not establish future returns or execution prices.

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.