RSI, MACD and Moving Averages Explained with Interactive Sliders

Moving Averages, RSI & MACD

Indicators are just formulas run on past prices. Move the sliders to see how each one is calculated on a made-up price series, and how a longer setting reacts more slowly.

How each one is calculated

  • Simple moving average (SMA): the average close of the last N days. Longer N = smoother line, more lag.
  • Exponential moving average (EMA): an average that gives recent days more weight (multiplier 2 ÷ (N + 1)).
  • RSI: 100 − 100 ÷ (1 + average gain ÷ average loss) over N days, using Wilder's smoothing. It runs from 0 to 100.
  • MACD: 12-day EMA − 26-day EMA. The signal line is a 9-day EMA of MACD, and the histogram is MACD − signal.
  • Each value only uses past prices, so it confirms moves after they start. Readings like RSI above 70 describe recent strength, and price can stay there a long time.