Worked example: Bollinger Bands and RSI (with full assumptions)

Explore What is a worked: mechanics, differences, limitations, and practical checks.

What is a worked example of Bollinger Bands and RSI?

A worked example is a step-by-step numerical calculation using assumed input data, so you can recreate the indicator values yourself. Here’s one self-contained scenario that calculates (1) Bollinger Bands and (2) RSI on the same assumed price series, using clearly stated settings and formulas.

Assumptions (stated upfront):

  • We use 20 periods for Bollinger Bands (common setting).
  • We use a 14-period lookback for RSI (common setting).
  • We use simple moving average (SMA) for the Bollinger middle band.
  • We use population standard deviation (divide by N) for the Bollinger band width.
  • We use the classic RSI “average gains/average losses” approach with Wilder-style smoothing not applied (we compute the first RSI value from raw averages).

No live market data is used. Any “signal” meaning is intentionally excluded; only the indicator values are computed.

How does a worked example of Bollinger Bands and RSI work?

Mechanism or definition

Bollinger Bands produce three lines from a chosen moving window of closing prices:

  • Middle band = SMA over the last N closes.
  • Upper band = Middle band + (k × standard deviation).
  • Lower band = Middle band − (k × standard deviation).

Typical parameter: N = 20, k = 2.

RSI (Relative Strength Index) is a momentum oscillator scaled from 0 to 100:

  • Compute gains and losses between consecutive closes over a chosen lookback period.
  • Average gains and average losses are calculated over the lookback.
  • Relative Strength (RS) = avg_gain / avg_loss.
  • RSI = 100 − (100 / (1 + RS)).

Typical parameter: lookback = 14.

Evidence or example (fully numerical)

We start from 21 closing prices so we can compute one 20-period Bollinger Bands set at the last close. For RSI we need 15 closes to compute one 14-step RSI value.

Assumed closes (oldest → newest):

  1. 100, 2. 101, 3. 102, 4. 101, 5. 103, 6. 102, 7. 104, 8. 105, 9. 106, 10. 105, 11. 107, 12. 108, 13. 109, 14. 108, 15. 110, 16. 111, 17. 112, 18. 111, 19. 113, 20. 114, 21. 115.

Step A: Bollinger Bands at the last close (period 21)

Use the last 20 closes: periods 2 to 21.

  • These 20 values sum to 2102, so the SMA = 2102 / 20 = 105.10.
  • Compute the standard deviation σ over those 20 closes using the assumed rule (population standard deviation).
    • For these numbers, the resulting standard deviation is approximately 4.26.
  • With k = 2:
    • Upper band = 105.10 + 2×4.26 ≈ 113.62.
    • Lower band = 105.10 − 2×4.26 ≈ 96.58.

So the worked Bollinger Bands snapshot is approximately:

  • Middle: 105.10
  • Upper: 113.62
  • Lower: 96.58

Step B: RSI at the last close (period 21)

To compute RSI(14) at the last close, we use closes from periods 7 to 21 (15 closes). This yields 14 consecutive differences.

We compute day-to-day changes (new close − old close):

  • 104→105: +1
  • 105→106: +1
  • 106→105: −1
  • 105→107: +2
  • 107→108: +1
  • 108→109: +1
  • 109→108: −1
  • 108→110: +2
  • 110→111: +1
  • 111→112: +1
  • 112→111: −1
  • 111→113: +2
  • 113→114: +1
  • 114→115: +1

Now compute the average gain and average loss over the 14 steps:

  • Total gains = 1+1+2+1+1+2+1+1+2+1+1 = 14.
  • Total losses (absolute) = 1+1+1 = 3.
  • Avg_gain = 14/14 = 1.00.
  • Avg_loss = 3/14 ≈ 0.2143.

Then:

  • RS = 1.00 / 0.2143 ≈ 4.6667.
  • RSI = 100 − (100 / (1 + 4.6667))
  • RSI ≈ 100 − (100 / 5.6667) ≈ 100 − 17.647 ≈ 82.35.

So the worked RSI snapshot is approximately 82.35.

Putting them together (without claiming direction)

At the last close (115), the Bollinger Bands upper band is around 113.62, so the assumed close is above the upper band. The RSI is around 82.35, which indicates strong recent gains relative to losses within this constructed window.

This is only a numerical relationship in one example dataset; it is not a standalone trading signal.

What are the relevant limitations and risks?

  1. **Different calculation conventions change outputs. **
    • Bollinger Bands depend on the moving average type (SMA vs EMA), standard deviation definition (population vs sample), and the band multiplier k. - RSI depends on how averages are computed and whether Wilder’s smoothing is used.
Trading foreign exchange and CFDs involves substantial risk. Information on FoxiForex is educational and is not personal financial advice. Sponsored placements are labelled clearly.