Skip to content
Stock Market

Bollinger Bands, Fibonacci Retracement and MACD Explained With Interactive Charts for PSX Investors

Learn Bollinger Bands, Fibonacci retracement and MACD with accessible SVG charts and three live simulators you can change yourself, for PSX investors.

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

Moving averages and RSI are only the start. Three more tools show up on almost every chart platform used for PSX shares: Bollinger Bands (how volatile is the share?), Fibonacci retracement (where might a pullback pause?) and MACD (is momentum building or fading?). This guide explains the formula behind each one, shows a labelled chart, and then gives you a live simulator so you can change the settings and watch the chart react. If you are new to the basics, read technical analysis basics and the SMA and RSI lab first.

All prices on this page are simulated for teaching. They are not real PSX quotes and say nothing about any listed company or the KSE-100.

Bollinger Bands: measuring volatility

Bollinger Bands, developed by John Bollinger, draw three lines around price:

  • Middle band: the 20-day simple moving average (SMA) of closing prices.
  • Upper band: the middle band plus 2 standard deviations of the last 20 closes.
  • Lower band: the middle band minus 2 standard deviations.

Standard deviation measures how widely prices have been scattered around their average. When daily moves get bigger, it rises and the bands move apart. When prices go quiet, it falls and the bands pinch together. Two helper numbers are widely used:

  • %B shows where the latest close sits inside the bands: 0 is the lower band, 1 the upper band, above 1 is outside the top.
  • Bandwidth is (upper minus lower) divided by the middle band. A bandwidth near the bottom of its recent range is called a squeeze.
Bollinger Bands squeeze then breakout (example)Example price chart with a 20-day middle band and bands two standard deviations either side. The bands pinch together during a quiet spell, then price breaks above the upper band and the bands widen. A lower panel plots bandwidth, which falls into the lowest 20 percent zone before the breakout.9095100105110115120125130135Price (Rs)Rs 133.04Bandwidth: (upper - lower) / middle, in %0510152025Width %Squeeze zone: lowest 20%1112131415161718191Trading day (the last point is "now")
Figure 1. A Bollinger Bands squeeze. The bands narrow during the quiet spell (bandwidth sits in the lowest 20% of its range), then price breaks out and the bands widen. Red-outlined dots mark closes outside the bands. Simulated prices.
Text version of Figure 1
ReadingValue
Latest closeRs 133.04
Middle band (20-day SMA)Rs 119.42
Upper band (+2 SD)Rs 131.35
Lower band (-2 SD)Rs 107.49
%B1.07 (above the upper band)
Bandwidth20.0%, wider than 89% of readings shown

How to read it, and what goes wrong

  • A squeeze is about volatility, not direction. Quiet markets tend to be followed by bigger moves, but the band alone cannot tell you whether the break will be up or down. Wait for price to close beyond a band, and check volume.
  • Touching a band is not a sell or buy signal. In a strong trend price can ride the upper band for weeks.
  • Statistics assume a bell curve, and prices are not one. With 2 standard deviations, you would expect about 95% of closes inside the bands if returns were normally distributed. Real prices have fatter tails, so spikes outside happen more often than that.

Bollinger Bands lab

Pick a regime, then change the period and the multiplier. A smaller multiplier makes the bands hug price (more touches, more false signals). A larger one makes touches rare and late.

Bollinger Bands lab: tighten, widen and watch the squeeze
Sample prices for learning, not a real stock. Change the regime, period and multiplier and the bands redraw.
1. Pick a volatility regime
2. Adjust the bands
The live chart needs JavaScript. The static diagram above shows the same idea.
Price-
Middle band-
Upper band-
Lower band-
%B position-
Bandwidth-
Width rank-
Loading
Show the numbers behind the chart
DayCloseMiddleUpperLowerWidth %
Educational simulation. Numbers are illustrative, not a forecast or advice.

Fibonacci retracement: planning around a pullback

After a rally, price often gives back part of the gain before continuing or reversing. Fibonacci retracement divides the last swing, from a swing low to a swing high, into fractions: 23.6%, 38.2%, 50%, 61.8% and 78.6%. The ratios come from the Fibonacci number sequence (the 50% level is a simple half and is added by convention). The levels are simple arithmetic:

Level price = swing high - (swing high - swing low) x ratio

For a rally from Rs 100 to Rs 200 the 38.2% level is 200 - 100 x 0.382 = Rs 161.80. Many traders treat pullbacks of under 38.2% as a sign of a strong trend, 38.2% to 61.8% as normal, and deeper ones as a warning that the trend may be failing. A close below the swing low breaks the structure altogether.

Fibonacci retracement levels on a rally from Rs 100 to Rs 200 (example)A rally from a swing low of 100 to a swing high of 200, then a pullback to 161.8, which is the 38.2 percent retracement. Horizontal levels are drawn at 23.6, 38.2, 50, 61.8 and 78.6 percent. A stop is drawn at the 50 percent level and a first target at the 23.6 percent level.80100120140160180200220Price (Rs)0% (swing high) 200.023.6% 176.438.2% 161.850% 150.061.8% 138.278.6% 121.4100% (swing low) 100.0StopTarget 1Entry 161.8Swing highSwing lowTime (illustrative path)
Figure 2. Fibonacci retracement of a Rs 100 to Rs 200 rally. Price has pulled back to the 38.2% level (Rs 161.80). Using the 50% level (Rs 150) as the stop and the 23.6% level (Rs 176.40) as the first target gives a reward-to-risk of 1.24 to 1. Simulated prices.
Text version of Figure 2
LevelPrice (Rs)
0% (swing high)200.00
23.6%176.40
38.2%161.80
50%150.00
61.8%138.20
78.6%121.40
100% (swing low)100.00

The honest way to use it

  • Levels are reference points, not magnets. Price may reverse at one, pause at another, or ignore all of them. Many traders watch the same levels, which may help or may not.
  • Swing choice is subjective. Two traders can draw different swings on the same chart and get different levels.
  • Use the levels to size risk. If you buy near a level, the next level down gives a natural place for a stop and the next level up a first target. The ratio of potential reward to risk is what matters. Many traders look for at least 2 to 1. See risk management and position sizing.

Fibonacci explorer

Type your own swing low, swing high and pullback price (or drag the slider). The explorer highlights the zone price is testing and calculates reward-to-risk for you.

Fibonacci explorer: where is the pullback, and what is the risk to reward?
Type your own swing low, swing high and pullback price. The levels, the tested zone and the reward-to-risk ratio update live.
1. Enter a swing and a pullback price
The live chart needs JavaScript. The static diagram above shows the same idea.
Retracement depth-
Zone-
Entry-
Stop-
First target-
Reward : risk (target 1)-
Reward : risk (swing high)-
Loading
Show the numbers behind the chart
LevelPrice (Rs)
Educational simulation. Numbers are illustrative, not a forecast or advice.

MACD: momentum from two moving averages

MACD (moving average convergence divergence), created by Gerald Appel, has three parts:

  1. MACD line = 12-day exponential moving average (EMA) minus 26-day EMA. An EMA is like an SMA but weights recent days more heavily, so it reacts faster.
  2. Signal line = 9-day EMA of the MACD line.
  3. Histogram = MACD line minus signal line, drawn as bars.

When the fast EMA is above the slow one, MACD is above zero. When MACD crosses above its signal line, the histogram turns positive: a bullish crossover. A cross below is bearish. A growing histogram means momentum is strengthening, a shrinking one means it is fading.

MACD with bearish divergence (example)Top panel: price with a 12-day and a 26-day exponential moving average. Bottom panel: the MACD line, a 9-day signal line and a histogram. Price makes a higher high near day 91 than near day 57, but the MACD peak is lower, and MACD then crosses below its signal line.90100110120130140150160170Price (Rs)MACD (12, 26, 9): line, signal and histogram-15-10-5051015MACD1163146617691106Trading day (the last point is "now")
Figure 3. MACD anatomy with a bearish divergence: price makes a higher high near day 91 than near day 57, but the MACD peak is lower. Triangles mark signal-line crossovers. Simulated prices.
Text version of Figure 3
Reading (latest day)Value
CloseRs 132.83
EMA 12138.08
EMA 26142.41
MACD (EMA 12 minus EMA 26)-4.33
Signal (9-day EMA of MACD)-3.60
Histogram (MACD minus signal)-0.73

Signals and traps

SignalWhat it meansCommon trap
MACD crosses above signalMomentum turning upMany false crosses in sideways markets
MACD crosses above zeroFast EMA has moved above slow EMA: a trend changeSlow, so a lot of the move may be over
Histogram shrinkingMomentum fading even if price still risingCan reverse within days
Bearish divergencePrice makes a higher high but MACD makes a lower highCan persist a long time before price turns

MACD simulator

Choose a scenario and move the trend acceleration slider. Try the flat consolidation scenario to see how many crossovers appear when nothing is trending.

MACD simulator: change the trend and watch the crossovers
Sample prices for learning, not a real stock. Pick a scenario and dial the trend speed up or down.
1. Pick a scenario
2. Adjust the trend
The live chart needs JavaScript. The static diagram above shows the same idea.
Price-
EMA 12-
EMA 26-
MACD-
Signal-
Histogram-
Loading
Show the numbers behind the chart
DayCloseMACDSignalHistogram
Educational simulation. Numbers are illustrative, not a forecast or advice.

Putting the three together

The tools overlap less than you might expect, which is why they work better as a team than alone:

  • Volatility (Bollinger): is the share quiet or stretched?
  • Location (Fibonacci): where are the nearby reference prices for a stop and a target?
  • Momentum (MACD): is the move gaining or losing strength?

A reasonable process is to check the trend first, use Fibonacci levels to plan an entry, stop and target, and look for MACD and Bollinger context to confirm or warn. If they disagree, that is useful information too: it often means waiting. Also consider tax and costs: see capital gains tax on PSX stocks. To see more charts, visit the charts page, and look up unfamiliar terms in the glossary.

Pre-trade checklist

  • Is the trend up, down or sideways on a longer timeframe?
  • Are the Bollinger Bands tight (squeeze) or wide (after a spike)?
  • Which swing am I measuring, and does the pullback hold the 38.2% to 61.8% zone?
  • What is my stop, my first target, and is reward-to-risk at least 2 to 1?
  • Is MACD supporting the idea, or showing divergence or a shrinking histogram?
  • Is the share liquid enough to exit at my stop? Check volume and price limits.
  • Is the position small enough that being wrong is affordable?

Educational content only, not investment advice. All prices in the examples and simulators 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

What do Bollinger Bands tell me?

They show how far price is from its recent average in standard-deviation terms. Narrow bands mean recent volatility is low and wide bands mean it is high. They do not tell you which way price will move next.

Is a close outside the Bollinger Band a sell signal?

Not by itself. In a strong trend price can keep closing at or beyond a band, which is called walking the band. Many traders use it as a sign of strength, and look for other evidence before acting.

Which Fibonacci retracement level is the most important?

None is guaranteed. The 38.2%, 50% and 61.8% levels are watched most often, so some traders react there, but price frequently passes straight through. Use them to plan risk, such as a stop below the next level, rather than to predict a reversal.

How do I pick the swing low and swing high?

Use clear, recent turning points on the chart you trade, a swing low followed by the swing high it led to. Different traders choose different swings, which is one reason retracement levels are subjective.

What are the standard MACD settings?

12, 26 and 9: the difference between the 12-day and 26-day exponential moving averages, a 9-day EMA of that difference as the signal line, and the gap between them as the histogram. Shorter settings react faster and give more false signals.

Can I use these on PSX shares?

The maths works on any price series. Thin trading, price limits and announcements can distort signals on illiquid PSX shares, so be extra cautious and check volume.

Sources and further reading

Facts in this guide were last checked against these sources on 22 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.