Skip to content
Stock Market

How to Use Technical Indicators in Practice: SMA and RSI With an Interactive Chart Lab

Learn to use the SMA and RSI in practice: formulas, crossovers, overbought and oversold levels, false signals, plus a live chart you can change yourself.

S
Written bySherjeel Islam
Published • 29 min read• Founder & Lead Developer
Facts last checked 21 November 2026

Most investors meet technical indicators as a few coloured lines on a chart. This guide explains what those lines actually calculate, how to read the two most common ones, the simple moving average (SMA) and the relative strength index (RSI), and where they fail. In the middle of the page is an interactive lab: change the scenario, the settings and a “what if the price jumps tomorrow” slider, and watch the chart and signals recalculate. If you are new to charts, read our technical analysis basics first. This article is the practical follow-up.

What indicators measure, and what they do not

An indicator is a formula applied to past prices, and sometimes volume. It does not know about earnings, policy changes or news. That makes two things clear straight away:

  • Every indicator is backward-looking. Some are called “lagging” because they follow price, like moving averages. Others are called “momentum” indicators because they measure the speed or strength of recent moves, like RSI. Momentum indicators react sooner, but they are still computed from past data.
  • Context decides meaning. The same reading can be a warning in a sideways market and an ordinary event in a strong trend. Always ask first: is the market trending, ranging, or reacting to news?

Pakistan-specific context also matters. Individual PSX shares have daily price limits (circuit breakers), which were being raised in steps toward 10% in 2024, so check the current limit. When a share hits its limit, a single day’s close may not show the full move, which can delay or blur a signal. Thin trading also makes charts erratic, so indicators on illiquid shares deserve extra caution.

The simple moving average (SMA)

Formula: SMA(N) = the sum of the last N closing prices divided by N. Each day the oldest price drops out and the newest enters.

Worked example. Closes of Rs 100, 102, 101, 104 and 107 give a 5-day SMA of (100 + 102 + 101 + 104 + 107) / 5 = Rs 102.8.

Why it lags. An N-day average is, on average, about half its window behind the current price. A 20-day SMA reflects prices from roughly ten days ago. The chart below shows a one-off jump from Rs 100 to Rs 110: the 5-day average catches up in five days, the 20-day average takes twenty.

Lag in action: a one-off jump from 100 to 110 on day 31
Lag in action: a one-off jump from 100 to 110 on day 31The 5-day SMA catches up with the new price in 5 days. The 20-day SMA needs 20 days. Faster averages react sooner but jump around more.1001021041061081102125293337414550Trading day
  • Price (Rs)
  • 5-day SMA
  • 20-day SMA

The 5-day SMA catches up with the new price in 5 days. The 20-day SMA needs 20 days. Faster averages react sooner but jump around more.

Hypothetical prices for teaching. Averages assume the price was Rs 100 on the days before day 21.

View the data table
Trading dayPrice (Rs)5-day SMA20-day SMA
21100100100
22100100100
23100100100
24100100100
25100100100
26100100100
27100100100
28100100100
29100100100
30100100100
31110102101
32110104101
33110106102
34110108102
35110110103
36110110103
37110110104
38110110104
39110110105
40110110105
41110110106
42110110106
43110110107
44110110107
45110110108
46110110108
47110110109
48110110109
49110110110
50110110110

Common settings

SettingTypical use
10-day and 20-day SMAShort-term trend and swing trading
50-day SMAMedium-term trend
200-day SMALong-term trend

How to read it

  1. Price versus the average. Price above a rising SMA suggests an uptrend. Price below a falling SMA suggests a downtrend.
  2. Slope. A flat average means no trend. A steep one means a strong move.
  3. Crossovers. When a faster SMA rises through a slower one, it is a bullish crossover. When it falls through, it is a bearish crossover. The best-known version uses the 50-day and 200-day averages and is called a golden cross (bullish) or death cross (bearish). Sources note that a crossover mainly shows that a trend has already changed and does not reliably predict what comes next.

The relative strength index (RSI)

RSI was introduced by J. Welles Wilder in his 1978 book. It compares the size of recent gains with recent losses.

Formula:

  • RS = average gain / average loss over the last N periods (default N = 14), with losses counted as positive numbers.
  • RSI = 100 - 100 / (1 + RS).
  • After the first average, Wilder smooths it: new average = (previous average x 13 + today’s value) / 14.

Worked example. If the average gain is Rs 2.0 and the average loss is Rs 1.0, then RS = 2 and RSI = 100 - 100 / 3 = 66.7. If there were no losses at all, RSI would be 100.

Levels and how to read them

  • Above 70: overbought. Recent gains have been large relative to losses.
  • Below 30: oversold. Recent losses have been large relative to gains.
  • Around 50: balanced. In uptrends RSI tends to hold above 50, and in downtrends it tends to stay below.
  • Trend ranges. One well-known observation is that RSI often ranges between about 40 and 90 in a bull market and between about 10 and 60 in a bear market. So “overbought” in a strong uptrend may simply mean “strong”.
  • Divergence. A bullish divergence is when price makes a lower low but RSI makes a higher low, which suggests selling pressure is fading. A bearish divergence is a higher high in price with a lower high in RSI. Divergences can appear repeatedly in a strong trend before a real turn, so treat them as a prompt to look closer.

All together on one chart

The diagram below uses invented prices. Price falls, RSI dips below 30 (1), price recovers and the 10-day SMA crosses above the 20-day (2), RSI later passes 70 (3), and after price turns down the 10-day SMA crosses below the 20-day (4).

Sample price chart with a 10-day and 20-day simple moving average and a 14-day RSI Illustrative data. Price falls, RSI drops below 30, then price recovers and the 10-day average crosses above the 20-day average. RSI later rises above 70, and after the price turns down the 10-day average crosses below the 20-day average. Price10-day SMA20-day SMARSI (14)Buy signalSell signal 125 130 135 140 145 150 155 160 165 170 Price (Rs) RSI (14): momentum, 0 to 100 0 30 50 70 100 Overbought (above 70)Oversold (below 30) 1 11 21 31 41 51 61 71 Trading day (illustrative data, not a real stock) 1Oversold: early buy watch 2Buy: bullish crossover 3Overbought: sell watch 4Sell: bearish crossover
Illustrative data. Swipe sideways on a small screen. 1 = RSI below 30 (early buy watch), 2 = bullish crossover (buy signal), 3 = RSI above 70 (sell watch), 4 = bearish crossover (sell signal).

Reading the numbers: (1) RSI below 30 is an early prompt to watch for a turn, not a purchase order. (2) The crossover confirms the turn only after price has already risen, which is the lag at work. (3) RSI above 70 warns that the rise is stretched. (4) The bearish crossover arrives well after the top.

Signal reference table

SignalWhat you seeUsual readingCommon trap
Price above rising SMAPrice over a sloping-up averageUptrend intactLate entry after a long run
Bullish crossoverFast SMA rises through slow SMATrend may be turning upWhipsaws in sideways markets
Bearish crossoverFast SMA falls through slow SMATrend may be turning downOften arrives after most of the fall
RSI above 70Strong recent gainsStretched, risk of a pauseStrong trends stay above 70 for weeks
RSI below 30Heavy recent lossesSelling may be exhaustedFalling prices can keep falling
Bullish divergenceLower price low, higher RSI lowSelling pressure fadingCan repeat before the real low
Bearish divergenceHigher price high, lower RSI highBuying pressure fadingRepeats in strong uptrends
RSI crossing 50Moves above or below 50Momentum shiftingNoise near 50 in ranges

Common false-signal traps

  • Sideways markets. When price drifts without a trend, moving averages tangle and cross repeatedly. Each crossover is a false alarm. This is the single most common way beginners lose money with crossovers.
  • Oversold is not a buy order. Price can stay oversold for a long time in a strong downtrend.
  • Overbought is not a sell order. The same applies in strong uptrends.
  • Lag. By the time a slow crossover appears, much of the move may be over.
  • Over-tuning. Changing settings until the past looks perfect usually produces a rule that fails on new data.
  • Ignoring news and liquidity. A results announcement, a policy change or a price limit can override any chart pattern.
  • Using one indicator alone. Two tools that measure different things, trend and momentum, are better than two that measure the same thing.

Interactive lab: see the indicators move

The green box below is the live lab, not a picture. It runs in your browser and nothing is saved or sent anywhere. The chart above it is a static diagram. For three more interactive tools, see Bollinger Bands, Fibonacci retracement and MACD.

Indicator lab: change the inputs and watch the chart react
Sample prices for learning, not a real stock. Pick a scenario, then move the sliders. Everything recalculates as you type.
1. Pick a market scenario
2. Adjust the settings
The live chart needs JavaScript. The diagram above shows the same idea.
Price-
Fast SMA-
Slow SMA-
RSI-
Trend bias-
RSI zone-
Loading
Show the numbers behind the chart (last 8 days)
DayClose (Rs)Fast SMASlow SMARSI
Educational simulation. It shows how the maths behaves, not what a real stock will do.

Five experiments to try

  1. Choppy sideways, default settings. Count the triangles. Each one is a crossover signal in a market that is going nowhere.
  2. Oversold bounce. Find where RSI first drops below 30, then see how many days pass before the fast SMA crosses above the slow one.
  3. Overbought reversal. Drag the what-if slider to -10% and watch RSI drop and the signal badge change. Then set it to +10% and see how little the slow average moves.
  4. Lengthen the averages. Set the fast SMA to 20 and the slow to 40 on any scenario. Signals become fewer and later.
  5. Shorten RSI to 5. It swings through 70 and 30 much more often. A shorter RSI is more sensitive and gives more false signals.

A simple way to combine them

  1. Identify the trend. Is price above or below a medium average such as the 20 or 50-day SMA, and is it sloping up or down?
  2. Use RSI for timing, not direction. In an uptrend, look for RSI pulling back toward 40 to 50 and turning up. In a downtrend, be wary of buying every oversold reading.
  3. Decide your exit first. Pick the price where your idea is wrong, and size the position so that loss is acceptable. Our risk management guide shows how.
  4. Check what the chart cannot see. Earnings dates, dividends and book closure, and news. See how to read PSX results and the KSE-100 explained.
  5. Practise before risking money. Try the same ideas on real charts on the PakGains charts page and keep a log of what you would have done.

Pre-trade checklist

  • What is the trend on the chart I use for holding time, up, down or sideways?
  • Do price, the averages and RSI agree, or are they sending mixed signals?
  • If it is a crossover, is the market trending enough for it to matter?
  • If RSI is extreme, is the trend strong enough that “overbought” or “oversold” is normal?
  • Where is my exit if I am wrong, and how much would I lose?
  • Is the position size small enough that I can accept that loss?
  • Have I checked announcements, liquidity and daily price limits?
  • Do I understand the tax on the profit? See capital gains tax on PSX stocks.
  • Am I following a plan, or reacting to a headline or a tip?

Unfamiliar terms are explained in the glossary. If picking entries feels like too much, a diversified mutual fund is a legitimate alternative.

Educational content only, not investment advice. All prices in the examples and in the lab are simulated and do not represent any real company or index. Indicators do not predict future prices, and you can lose money trading. Consider speaking to a licensed adviser before investing.

Frequently asked questions

Which is better, SMA or RSI?

They answer different questions. The SMA describes trend direction and lags. RSI measures how strong recent moves have been. Used together, the SMA gives context and RSI helps with timing.

Are 10, 20 and 14 the best settings?

No setting is best. 14 days is Wilder's default for RSI and 10 and 20 days are common short-term averages. Shorter settings react faster and give more false signals. Longer ones are slower and later. Match the setting to how long you hold.

Does RSI above 70 mean I should sell?

Not by itself. It means recent gains have been large relative to losses. In a strong uptrend RSI can remain above 70 for a long time. Many traders treat it as a warning to tighten risk, not as an automatic sell.

What is a golden cross?

A bullish signal where the 50-day SMA rises through the 200-day SMA. The opposite, the 50-day falling through the 200-day, is called a death cross. Neither predicts future direction reliably.

Can I use these on PSX shares?

Yes, the maths is the same for any price series. Thin trading, price limits and company announcements can distort the signals, so be extra cautious with illiquid shares.

Sources and further reading

Facts in this guide were last checked against these sources on 21 November 2026.

Found an error or an out-of-date detail? See our editorial policy or tell us.

S

About Sherjeel Islam

Sherjeel Islam is the founder and lead developer behind PakGains. With an extensive background in software engineering, database architecture, and enterprise data systems, he specializes in building real-time market tracking tools and analytical models for Pakistani investors. Sherjeel focuses on bridging the gap between raw market data and practical financial tools, writing in-depth guides on market indicators, cryptocurrency frameworks, and cross-border financial technology.

Financial & Investment Disclaimer

Disclaimer: The content on PakGains is for informational and educational purposes only and does not constitute financial, investment, legal, or tax advice. Financial markets, cryptocurrencies, and banking services involve inherent risk. Always conduct your own research or consult with a licensed financial professional before making financial decisions.