Guides, manuals and platform references.
Published November 23, 2026 · View Markdown
Two oscillators can share a scale of 0 to 100 and still answer different questions. RSI compares smoothed gains with smoothed losses in closing prices. Standard stochastic asks where the latest close sits inside a recent high-low price range. Agreement is possible; equivalence is not.
That difference matters in TradingView automation. Replacing an RSI condition with a stochastic condition changes the information that can trigger an order. Before connecting an indicator through AlgoWay's indicator-to-execution workflow, specify the calculation, plotted line and event you intend to trade. A matching number is not a matching rule.
For close-based RSI, separate each closing-price change into a positive gain or a positive loss, then smooth the two series using Wilder's moving average. With a nonzero average loss, RS is average gain divided by average loss, and RSI is 100 - 100 / (1 + RS). TradingView documents this calculation in its RSI reference. A 14-period setting is a smoothing parameter, not a simple ranking of the latest close within 14 candles.
The raw stochastic value is 100 * (close - lowest low) / (highest high - lowest low) over the chosen lookback. TradingView's standard Stochastic indicator can smooth that value into %K, then average %K into %D. Its documented defaults are 14 for the range, 3 for %K smoothing and 3 for %D. Setting %K smoothing to 1 exposes the unsmoothed range calculation.
Consider two hypothetical versions of a price history. Every closing price is identical in both, including a latest close of 108. The histories differ only in one candle's upper wick within the stochastic lookback. This is an arithmetic illustration, not a backtest.
| Input or result | History A | History B |
|---|---|---|
| Latest close | 108 | 108 |
| Lowest low in window | 100 | 100 |
| Highest high in window | 110 | 120 |
| Raw stochastic | 100 × 8 / 10 = 80 | 100 × 8 / 20 = 40 |
| Close-based RSI | Same as B | Same as A |
RSI receives exactly the same closing-price changes, so with identical settings and initialization it stays identical. Raw stochastic falls from 80 to 40 because the high-low range expanded. The larger wick changed the ruler, not the latest close.
The table does not establish an absolute RSI value. That needs the preceding gain/loss history. Nor does it claim that a smoothed %K or %D must equal 80 or 40: those lines also need earlier raw readings. Comparing an unsmoothed calculation with a smoothed chart is an efficient way to spend an afternoon finding a bug that is not there.
RSI's familiar 70/30 levels and stochastic's 80/20 levels are conventions, not a conversion table. An RSI of 70 does not imply a stochastic of 80. Neither an overbought label nor an oversold label guarantees that the next price move reverses.
Stochastic RSI adds a third question: where RSI sits within its own recent range. It does not use the price high-low range in the table above. See Stochastic RSI versus RSI if that is the indicator on your chart. The similar names are doing traders no favors.
A useful specification might say: on completed candles, record the first %K crossing above %D while %K is below 20. A different specification might record RSI crossing back above 30. These are illustrative events for comparison, not recommended entries. Define whether the threshold restriction applies to the current candle, the previous candle or both.
If you require both indicators to agree, document the combined condition explicitly. Shared price inputs mean two agreeing oscillators are not automatically two independent pieces of evidence. Keep the rule that answers your actual question, then test what it changes.