How it works · model logistic-v1
Our Methodology
A transparent, end-to-end look at how PSX Expert turns raw Pakistan Stock Exchange data into technical indicators, fundamental ratios, a composite 0–100 score, and an explainable forecast — with nothing hidden behind a black box.
Last reviewed Source: PSX Data Portal, end of day Live accuracy ledger
From exchange data to a graded forecast
Five steps. Every forecast on the site went through all of them.
- 01 Data End-of-day prices, volumes and company figures from the PSX Data Portal — archived raw, then cleaned.
- 02 Indicators RSI, MACD, moving averages, ATR and the rest from price and volume; P/E, EPS and yield alongside.
- 03 Model logistic-v1 estimates how likely the stock is to beat the market over the next 10 trading sessions.
- 04 Scoring That probability becomes a 0–100 score, a Strongly bearish … Strongly bullish reading and a confidence figure.
- 05 Accuracy ledger Every published call is recorded when issued and graded against the real close 10 sessions later.
1. Data collection
Everything we publish starts with real numbers from the official PSX Data Portal (dps.psx.com.pk). Our collectors fetch end-of-day (EOD) prices, traded volumes, and company metadata directly from the exchange's own published feeds — we do not buy second-hand datasets or re-key numbers by hand, both of which introduce errors and delay.
- History depth: roughly five years of daily EOD bars per symbol, enough to estimate long-window indicators and to backtest across multiple market cycles.
- Coverage: the full universe of listed equities you can browse on the stocks and sectors pages.
- Raw-response archiving: every fetched payload is stored verbatim before parsing. If a number ever looks wrong, we can replay the exact upstream response to audit it — data lineage you can trust.
- Refresh cadence: EOD data is updated after each trading session; fundamentals refresh as the exchange republishes them.
Before any indicator is computed, the raw series is cleaned: duplicate dates are removed, non-trading days are excluded, obvious bad ticks are flagged, and prices are aligned to a consistent calendar. Clean inputs are the foundation of every figure below.
2. Technical indicators
From the cleaned price-and-volume history we compute a standard toolkit of technical indicators. Each one summarises a different aspect of price behaviour — trend, momentum, volatility, or participation. We compute them with conventional parameters so the numbers match what you would see in widely used charting software.
- SMA & EMA: simple and exponential moving averages smooth price to reveal the underlying trend. The EMA weights recent days more heavily, so it turns faster than the SMA.
- RSI (Relative Strength Index): a 0–100 momentum oscillator measuring the speed of recent gains versus losses. Readings above 70 are often called overbought, below 30 oversold.
- MACD: the difference between a fast and a slow EMA, plotted with its own signal line. Crossovers and the histogram flag shifts in trend momentum.
- ATR (Average True Range): the average size of daily price swings — a pure volatility gauge. It feeds the risk figure shown with each model reading.
- Bollinger Bands: a moving average plus and minus a multiple of standard deviation. The bands widen in volatile periods and contract in calm ones, framing relative price extremes.
- Stochastic Oscillator: locates the close within its recent high–low range to highlight momentum exhaustion and potential turning points.
- ADX (Average Directional Index): measures trend strength (not direction). A high ADX says the prevailing move is robust; a low one says the market is ranging.
- OBV (On-Balance Volume): a running total that adds volume on up days and subtracts it on down days, showing whether volume is confirming the price move.
- Williams %R: a fast oscillator, inverse to the Stochastic, that flags short-term overbought and oversold conditions.
- Momentum & rate-of-change: raw price change over fixed look-back windows, the simplest read on whether a stock is accelerating or fading.
No single indicator is reliable on its own — each can give false signals. Their value comes from being read together, which is exactly what our scoring step does. You can compare and filter on these readings using the screener.
3. Fundamentals
Technicals describe price; fundamentals describe the business behind it. For each company we surface the headline valuation, profitability, income, and risk metrics so you can judge whether a chart is supported by underlying value.
- P/E (price-to-earnings): price per rupee of annual earnings — a quick read on how expensive the stock is relative to profits.
- EPS (earnings per share): profit attributable to each share, the denominator behind the P/E.
- P/B (price-to-book): price relative to net asset value, useful for asset-heavy sectors such as banks.
- Dividend yield: trailing dividends as a percentage of price — what an income investor earns from payouts alone.
- ROE (return on equity): how efficiently the company converts shareholder capital into profit.
- Beta: sensitivity of the stock to the broad market; above 1 means it tends to swing more than the index.
- Volatility: the dispersion of recent returns — a direct measure of how bumpy the ride has been.
- 52-week range & market cap: where price sits between its yearly high and low, and the company's total equity value.
These same metrics feed our market-cap-weighted KSE-100 index reconstruction, so the benchmark you see is built from the same exchange-published inputs as the individual stocks.
4. Scoring
To make many indicators digestible, we distil them into four sub-scores, each on a common scale, then blend them into a single overall figure from 0 to 100. The score is a relative ranking aid — not a price prediction or a buy order.
Trend
Moving-average alignment, MACD posture, and ADX strength — is price in a healthy directional move?
Momentum
RSI, Stochastic, Williams %R, and rate-of-change — is that move gaining or losing energy?
Value
P/E, P/B, dividend yield, and earnings quality — is the price reasonable for the fundamentals?
Stability
Volatility, ATR, beta, and drawdown behaviour — how steady and predictable is the stock?
The four sub-scores are shown on every stock page as context. What the overall 0–100
score means depends on which engine is publishing. While the logistic model (section 5) is
live, the overall score is its probability expressed out of 100. When that model is not
beating its baseline, a transparent rule engine (rule-engine-v2) takes over and
the overall score is the four sub-scores blended with fixed, published weights —
40% trend, 35% momentum, 15% value, 10% stability. Either way the weights are the same for
every stock and the inputs are visible, so two analysts looking at the same data will always
arrive at the same score — there is no hidden tuning per stock.
5. The forecast engine
Our forecast is produced by a logistic regression model, versioned logistic-v1 and shown on every stock page next to the reading. It is trained across the end-of-day history of every listed stock on seventeen inputs: the technical indicators described above plus price-action measures — returns over 5, 20 and 60 sessions, recent volatility, distance from the 60-session high and low, volume pressure and the stock's strength relative to the KSE-100. Fundamentals are shown beside it but are not among its inputs. It outputs a probability that is then mapped to a reading.
Training is scheduled each weekday evening, with a fuller retrain at the weekend. A newly trained model replaces the live one only if it scores better on price history held back from training, and any model may publish only while it beats the simple baseline on that held-back history by at least 1.0 percentage point — and only while its live graded record is not losing to the base rate. When it fails either test, the readings fall back to the rule engine described in section 4. The date of the last training run is on the model performance page.
We chose logistic regression deliberately, and the reason is inspectability. It is a linear model: each input feature carries a weight, so any output can be decomposed into the exact contribution of each factor. It is not a neural network or any model whose reasoning cannot be traced. That transparency costs us some predictive power, and we think that is the right trade for a site that publishes its reasoning.
Being a trained statistical model rather than a hand-written rule set has a consequence worth stating plainly: it learned its weights from history, so it assumes the future resembles the past. In a genuine regime change — a policy shock, a currency crisis — that assumption breaks precisely when a forecast would be most valuable.
For each stock the model emits:
- Reading AI signalThe model's directional reading of the stock over the next ten sessions, on a five-step scale from strongly bearish to strongly bullish, built from price and indicator history. A description of the data, not investment advice. Glossary
- a directional read on a five-step scale — strongly bearish, bearish, neutral, bullish, strongly bullish — describing what the inputs lean toward.
- Probability
- the model's own estimate, out of 100, of the stock beating the KSE-100 over the next 10 sessions. Shown only for the logistic model; the rule engine's score is a blend, not a probability.
- Confidence ConfidenceHow strongly the model leans toward its call. It is not the probability of being right — the graded record against the base rate is the figure for that. Glossary
- for the logistic model, the probability it gives to the side it reads; for the rule engine, how far its score sits from neutral and how far trend and momentum agree. Either way a measure of the model's own conviction, not a probability of profit — the graded record below says how often a reading has actually come true.
- Explanation
- a short, plain-language summary of the inputs that drove the reading, including when they disagree with it.
The model also computes support and resistance levels and a risk figure, which the stock pages show. It does not publish a price target, a stop level, an expected return or a suggested action: a written price objective is investment research, and we do not issue it.
Every contributing factor is displayed alongside the reading — the RSI level, the moving-average cross, the valuation read, and so on — so you can see which conditions the model was reading and weigh each yourself. This is information to support your own research, not financial advice.
6. Backtesting & accuracy
A forecast is only meaningful if you know how often it has been right. We test the model against roughly five years of real PSX history — the same exchange-published EOD data described above — and measure directional accuracy: how frequently the reading matched the subsequent move.
Every accuracy figure we publish is read against its base rate: how often you would have been right by always naming whichever direction turned out to be more common over the same windows. Markets rarely split fifty-fifty — over a given stretch most stocks may rise, or most may fall — so a hit rate well above 50% can still be worse than that constant guess. A model has an edge only when it beats the base rate, and when it does not, we say so. We deliberately do not publish inflated win rates or cherry-picked trades.
The live ledger
A backtest can only tell you how the model would have done. So every forecast published on this site is also written, at the moment it is issued, to an append-only ledger, and graded 10 trading sessions later against the close that actually printed. Holds are not graded, because a call with no direction cannot be right or wrong. The running record — hit rate, the baseline it has to beat, and whether higher confidence has meant higher accuracy — is on the model performance page.
7. Limitations & roadmap
We want you to use these tools with clear eyes. The most important limitations:
- Outputs are derived from historical price and fundamental data; they cannot anticipate news, policy shifts, results surprises, or liquidity shocks.
- EOD data means intraday moves are not captured, and thinly traded symbols can produce noisier indicators.
- Even when the model beats its base rate, the margin is a few percentage points and many readings turn out wrong — position sizing and risk management remain entirely your responsibility.
- When the newest prices are late, readings are paused rather than shown out of date.
- Nothing here is a recommendation to buy or sell. Always do your own research and consider consulting a licensed financial adviser.
On the roadmap: any change to the model — new inputs, a different label, another model class — has to beat the live model on history held back from training before it may publish, and the explainable rule engine stays in place as the fallback for whenever it does not, so you can always see the reasoning.
Questions about how any number is produced? Read more about us, review our disclaimer, check the FAQ, or contact us at support@psxexpert.com. How we source, label and correct what we publish is set out in our editorial policy. This page was last updated on .