Indicators and patterns
RSI and moving average on PSX charts, explained
What a simple and an exponential moving average and RSI(14) compute, with OGDC figures dated 9 Oct 2026, and how to add each in SuperX Apex.
By the SuperX research team · Reviewed by Sameel Hayat, Analyst · Published
Editorial standards · Corrections policy · Information, not advice.
A moving average is the average of the last N closing prices, redrawn on every bar. A simple moving average (SMA) gives all N closes the same weight. An exponential moving average (EMA) gives the newest closes more. RSI(14) divides the average gain by the average loss over 14 sessions and scales the result from 0 to 100. As of 9 October 2026, OGDC closed at Rs 306.12, with a 20-day SMA of 315.28, a 50-day SMA of 319.02 and an RSI(14) of 36.47. These are measurements of past prices, not signals. Every figure in this post was recomputed on 4 November 2026 from the daily closes in SuperX’s API (/ohlc, the full history from 2016) and carries the date of the close it uses; the closes themselves are PSX prices, as where SuperX’s data comes from explains. You can add each one free in SuperX Apex, with no account.
What does a simple moving average compute?
An SMA of length N adds the last N closes and divides by N. When a new bar arrives, the oldest close drops out and the newest comes in. That is the whole calculation.
A small worked example uses real OGDC closes from the SuperX market snapshot. For a 5-bar SMA on 9 October 2026, take the closes of 5, 6, 7, 8 and 9 October: 310.34, 317.05, 315.91, 308.66 and 306.12. They sum to 1,558.08, and 1,558.08 divided by 5 is 311.62. On 8 October the window held 2, 5, 6, 7 and 8 October, and the SMA was 313.32.
The “50 day moving average” is 50 bars on a daily chart, which means 50 trading sessions, not 50 calendar days. On a weekly chart the same indicator averages 50 weeks. Here are three SMA lengths for OGDC, as of 9 October 2026:
| Indicator | Value | Close, 9 Oct 2026 |
|---|---|---|
| SMA(20) | 315.28 | 306.12 |
| SMA(50) | 319.02 | 306.12 |
| SMA(200) | 309.86 | 306.12 |
A longer SMA reacts more slowly because each new close is one part in N of the average. It also lags the price: it is built from past closes only, so it cannot show a turn before it has happened. This is a property of the arithmetic, not a fault.
How is an exponential moving average different?
An EMA keeps a running value. Each day it takes a share of today’s close and the rest of yesterday’s EMA. The share is the multiplier 2 divided by (N + 1). The first EMA is the SMA of the first N closes, and the formula takes over from there (StockCharts ChartSchool: moving averages).
In symbols: EMA today = close × k + EMA yesterday × (1 − k), where k = 2 / (N + 1). For N = 50, k = 2 / 51, which is about 0.0392, so each new close carries about 3.9% of the weight.
| SMA | EMA | |
|---|---|---|
| Weights | Equal over the last N closes | Larger for newer closes, smaller for older ones |
| Oldest close | Drops out of the window at once | Never drops out; its weight shrinks each day |
| Start | First value after N closes | Seeded with the SMA of the first N closes |
| OGDC, 9 Oct 2026, length 50 | 319.02 | about 318.2 |
The OGDC EMA(50) is 318.24, computed here from the one year of closes in the snapshot (249 closes) and, as a check, from the full history of 2,495 closes; both give the same figure to the second decimal, so it is shown as about 318.2. SuperX Apex computes it from the full history. The two averages sit close together, because they use the same closes and differ only in weights.
In SuperX Apex, the free PSX tool, the default length of the SMA is 20, the default of the EMA is 50, and both are editable.
What does RSI(14) compute?
The Relative Strength Index compares how much a price rose with how much it fell, over a window of 14 bars. Written in steps (StockCharts ChartSchool: RSI):
- For each bar, take the change in the close from the previous close.
- A positive change is a gain. A negative change is a loss, written as a positive number. The other one is zero.
- The first average gain is the sum of the gains over the first 14 changes, divided by 14. The first average loss is built the same way.
- After that, each average is smoothed: new average = (previous average × 13 + today’s value) / 14.
- RS = average gain / average loss.
- RSI = 100 − 100 / (1 + RS).
If there are no losses in the window, RSI is 100. If there are no gains, it is 0. The value always sits between them.
For OGDC on 9 October 2026, the smoothed average gain was 1.058 rupees and the smoothed average loss was 1.843 rupees. RS is 1.058 / 1.843 = 0.574, and RSI = 100 − 100 / 1.574 = 36.47. This matches the “RSI 14” that the SuperX snapshot recorded for OGDC on that date. The same calculation on three more shares gives the table below, all as of 9 October 2026 (the OGDC stock page and the other stock pages on this site show the latest values, not these).
| Share | Close, 9 Oct 2026 (Rs) | SMA(20) | SMA(50) | RSI(14) |
|---|---|---|---|---|
| OGDC | 306.12 | 315.28 | 319.02 | 36.47 |
| LUCK | 405.38 | 412.78 | 428.06 | 37.52 |
| HBL | 295.76 | 301.42 | 311.13 | 39.65 |
| PPL | 218.94 | 224.50 | 226.75 | 41.42 |
Step 4 gives RSI a long memory, so its value depends on how many closes it starts from. StockCharts advises at least 250 data points to match its figures. SuperX Apex computes each study on the whole history before it draws the view, so a short range on screen does not change the number.
The RSI pane draws guide lines at 30 and 70. They mark where the number stands on its 0 to 100 scale. The formula does not turn them into instructions, and this post does not read them as signals.
Why do the numbers differ between adjusted and unadjusted PSX history?
A price series changes at an ex-date, and the cause of the change decides whether it belongs in the average. SuperX Apex says that daily prices are adjusted for bonus shares, rights and splits, and not for cash dividends. You can switch to the prices as the exchange printed them: click Unadjusted in the note under the chart, or in Pro’s Settings, under Prices, on a phone. The link writes adj=none for them. Pulse and PSX facts explains the switch.
An invented example shows the effect (it is not a real company). Example Cement closes at Rs 100 for 49 sessions. Then it goes ex-date on a 100% bonus issue, and the price opens near Rs 50. Nothing about the company’s value has changed. Only the share count has.
| Series | The 50th close | SMA(50) on that day | RSI(14) after the step |
|---|---|---|---|
| Unadjusted | Rs 50 | 99.00 | 0 (a loss of Rs 50, no gains) |
| Adjusted | Rs 50 (earlier closes cut to Rs 50) | 50.00 | 100 (no losses in the window) |
The unadjusted average mixes shares of two different sizes, and its RSI treats a change in the share count as a crash. The adjusted series removes that step. For a cash dividend, the opposite holds. The cash left the company, so both series keep the drop, and both treat it as an ordinary loss. OGDC’s close fell Rs 7.25 from 7 to 8 October 2026, which was the snapshot’s ex-date for its Rs 6 dividend, and RSI counted all of it as a loss. If you want a line that adds the cash back, the Pro catalogue has Total return (dividends reinvested), which works on adjusted prices only.
Adjustment depends on notices on record. SuperX Apex’ own capability record, dated 17 September 2026, lists 34 symbols with adjusted history, including eight sub-divisions backfilled from notices (LUCK among them). It also says some steps of 30% or more remain unexplained by any held notice. On a daily chart a ? marks a session that moved past the price limit with no corporate action on record. The bars stay as recorded, so check any average or RSI that spans a ?.
How do you add a moving average in SuperX Apex?
In Simple, open the indicators menu in the top bar and choose Moving averages 20 / 50. It draws a 20-bar and a 50-bar SMA, with volume.
In Pro:
- Click Indicators in the top bar, or press I.
- Type “moving” or “ema” in the search.
- Click a row: Moving average (SMA) or Exponential MA (EMA). The line appears on the chart.
- To change the length, find the indicator’s row in the legend and open its settings. The Inputs tab holds the length.
- Each pick adds another instance, so two SMAs can sit on one chart. Click × on a row to remove it.
The guide’s RSI and moving averages section shows each step with a picture. A link can do the same. These open Pro with the indicators already on the chart:
In the link, each indicator is written as its id, a colon and its length. Pro is needed because Simple offers only the four presets. The chart page for OGDC on this site is the lighter way to look at the same history.
How do you add RSI in SuperX Apex?
In Simple, choose RSI 14 from the indicators menu. In Pro, open Indicators, type “rsi” and click the row. RSI draws in a pane under the price, and its length is an input with a default of 14. To see how it works, right-click its legend row and choose Explain this indicator, which gives a short card in words.
- OGDC with RSI(14), one year
- The same chart on the exchange’s own prices
- OGDC with a weekly RSI(14) on a daily chart
The last link uses @1w. The weekly RSI reads no bar from after the day it stands on. For the dividend side of the picture, the OGDC dividend page lists its payouts, and how to read a candlestick chart covers the bars under the lines.
What do these measurements not tell you?
A moving average describes where prices have been. RSI describes the balance of gains and losses in a window. Neither one describes what the price will do next. They also depend on choices: the length, the seed, the smoothing and the history. Another website that starts RSI from fewer closes, or seeds an average differently, prints a different number for the same share on the same day. This is why the figures in this post are dated and the method is written out.
Frequently asked questions
What is the 50-day moving average?
It is the average of the last 50 daily closes, redrawn each day. On OGDC it was 319.02 as of 9 October 2026.
How is RSI calculated?
RSI = 100 − 100 / (1 + RS), where RS is the smoothed average gain divided by the smoothed average loss over 14 bars. OGDC’s RSI(14) was 36.47 on 9 October 2026.
What is the difference between SMA and EMA?
An SMA weights the last N closes equally. An EMA weights newer closes more, using the multiplier 2 / (N + 1). Both lag the price.
Why does RSI differ between websites?
RSI uses smoothing with a long memory, so the result depends on how many closes it starts from and on how the first average is built. Adjusted and unadjusted prices also give different numbers.
Are RSI and moving averages free in SuperX Apex?
Yes. SuperX Apex is free today and needs no account. Open OGDC in SuperX Apex and use the Indicators menu.
Education, not investment advice.