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.
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.
- 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 day | Price (Rs) | 5-day SMA | 20-day SMA |
|---|---|---|---|
| 21 | 100 | 100 | 100 |
| 22 | 100 | 100 | 100 |
| 23 | 100 | 100 | 100 |
| 24 | 100 | 100 | 100 |
| 25 | 100 | 100 | 100 |
| 26 | 100 | 100 | 100 |
| 27 | 100 | 100 | 100 |
| 28 | 100 | 100 | 100 |
| 29 | 100 | 100 | 100 |
| 30 | 100 | 100 | 100 |
| 31 | 110 | 102 | 101 |
| 32 | 110 | 104 | 101 |
| 33 | 110 | 106 | 102 |
| 34 | 110 | 108 | 102 |
| 35 | 110 | 110 | 103 |
| 36 | 110 | 110 | 103 |
| 37 | 110 | 110 | 104 |
| 38 | 110 | 110 | 104 |
| 39 | 110 | 110 | 105 |
| 40 | 110 | 110 | 105 |
| 41 | 110 | 110 | 106 |
| 42 | 110 | 110 | 106 |
| 43 | 110 | 110 | 107 |
| 44 | 110 | 110 | 107 |
| 45 | 110 | 110 | 108 |
| 46 | 110 | 110 | 108 |
| 47 | 110 | 110 | 109 |
| 48 | 110 | 110 | 109 |
| 49 | 110 | 110 | 110 |
| 50 | 110 | 110 | 110 |
Common settings
| Setting | Typical use |
|---|---|
| 10-day and 20-day SMA | Short-term trend and swing trading |
| 50-day SMA | Medium-term trend |
| 200-day SMA | Long-term trend |
How to read it
- Price versus the average. Price above a rising SMA suggests an uptrend. Price below a falling SMA suggests a downtrend.
- Slope. A flat average means no trend. A steep one means a strong move.
- 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).
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
| Signal | What you see | Usual reading | Common trap |
|---|---|---|---|
| Price above rising SMA | Price over a sloping-up average | Uptrend intact | Late entry after a long run |
| Bullish crossover | Fast SMA rises through slow SMA | Trend may be turning up | Whipsaws in sideways markets |
| Bearish crossover | Fast SMA falls through slow SMA | Trend may be turning down | Often arrives after most of the fall |
| RSI above 70 | Strong recent gains | Stretched, risk of a pause | Strong trends stay above 70 for weeks |
| RSI below 30 | Heavy recent losses | Selling may be exhausted | Falling prices can keep falling |
| Bullish divergence | Lower price low, higher RSI low | Selling pressure fading | Can repeat before the real low |
| Bearish divergence | Higher price high, lower RSI high | Buying pressure fading | Repeats in strong uptrends |
| RSI crossing 50 | Moves above or below 50 | Momentum shifting | Noise 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.
Show the numbers behind the chart (last 8 days)
| Day | Close (Rs) | Fast SMA | Slow SMA | RSI |
|---|
Five experiments to try
- Choppy sideways, default settings. Count the triangles. Each one is a crossover signal in a market that is going nowhere.
- Oversold bounce. Find where RSI first drops below 30, then see how many days pass before the fast SMA crosses above the slow one.
- 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.
- Lengthen the averages. Set the fast SMA to 20 and the slow to 40 on any scenario. Signals become fewer and later.
- 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
- 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?
- 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.
- 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.
- 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.
- 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.
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.
Keep reading
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.