PXPSX AlphaKSE-100 research engine
AICLRs 31.0+9.1%BERGRs 36.5-14.4%PRLRs 147.7+44.2%AGLRs 16.9+69.1%KAPCORs 51.5+57.5%SITCRs 52.5-4.6%NMLRs 374.1+210.3%NETSOLRs 5,771.3+29.7%BOPRs 138.7-11.7%PSORs 443.1+105.3%NPLRs 18.7+89.3%FMLRs 288.6+94.9%MARIRs 23.5-11.0%THALLRs 140.6+110.3%NRLRs 61.3-22.3%HBLRs 451.9-6.7%SYSRs 1,566.1+36.2%GATMRs 79.9+33.4%GHGLRs 1,075.6+1.5%FCEPLRs 85.0+61.6%PNSCRs 566.1-42.5%AVNRs 463.8+57.3%FFLRs 135.5+33.3%AGTLRs 159.5-34.9%FEROZRs 274.0+45.3%SRVIRs 38.0+63.0%ILPRs 26.7+20.5%KELRs 71.8+64.8%MLCFRs 1.8-5.9%HTLRs 157.8+46.7%PIOCRs 54.6+58.7%IGIHLRs 98.5-4.8%EFERTRs 76.5+20.3%FFCRs 14.2-30.0%GHNIRs 476.1+34.4%PTCRs 14,713.1+1.5%TPLPRs 2,078.1+10.1%UBLRs 355.3-25.8%ISLRs 171.0+2.7%APLRs 38.3+9.0%ABOTRs 4.4-26.4%PKGSRs 61.2+35.3%FABLRs 263.0-1.9%ATLHRs 10.6-5.5%OGDCRs 71.0+43.4%MTLRs 106.9-27.7%NCLRs 5.7+56.9%UNITYRs 758.2+41.8%LUCKRs 67.7+22.9%KTMLRs 158.5+51.2%SNBLRs 172.8+16.1%BWCLRs 196.5+40.1%CHCCRs 25.0-4.0%ASTLRs 9.1+14.5%ITTEFAQRs 12.3-9.9%AGPRs 30.8-42.3%HINOONRs 61.3-35.9%ENGRORs 68.6+46.4%ATRLRs 26.4+81.9%SHELRs 187.1-5.4%JDWSRs 2.1+20.6%EFUGRs 50.9+44.1%KOHCRs 79.1+42.0%BNWMRs 54.3+62.8%GLAXORs 56.9+14.0%CNERGYRs 49.2-1.8%JSBLRs 377.8-24.1%SEARLRs 21.7-21.2%MCBRs 81.8-4.4%BAFLRs 110.1+14.1%TGLRs 236.2-8.1%NCPLRs 27.7+19.9%AIRLINKRs 81.3+23.7%PAELRs 27.5+77.4%PAKTRs 1.7+3.6%INDURs 74.3-34.6%EPCLRs 17.8-50.1%TRGRs 100.9+18.5%SNGPRs 3.6-7.2%MEBLRs 95.1+11.0%PPLRs 12.0+27.2%POLRs 149.8+69.1%BAHLRs 123.3-17.6%GWLCRs 18.0+9.8%ACPLRs 41.8+19.4%FCCLRs 146.4+6.4%HCARRs 752.9-10.6%NBPRs 173.6-16.9%FATIMARs 237.9+68.5%SSGCRs 12.9+40.7%AKBLRs 268.1-10.1%LOTCHEMRs 65.9-7.3%NATFRs 5.0-57.8%MUGHALRs 76.8-47.2%PSMCRs 514.2-32.5%ICIRs 268.1+5.8%HUBCRs 48.3+16.8%NESTLERs 4.6-50.6%ARPLRs 89.9-12.9%DGKCRs 681.9+39.9%PSELRs 113.5-0.4%

How the engine works

Everything the dashboard shows is produced by the pipeline described here. No step is hidden.

The problem this addresses

Around 527 companies list on the Pakistan Stock Exchange, and all of them publish audited accounts. Almost none of that information reaches a retail investor in a usable form. The gap is filled by brokers, whose revenue comes from commission on trades rather than from the outcome of those trades, so the incentive to recommend activity is structural rather than personal.

The engine is an attempt to close that gap mechanically: read the accounts every company already files, rank the market on the evidence, and say in plain language why each name sits where it does. It is scoped to the KSE-100 rather than the full market because index constituents have the cleanest, most complete filings and enough traded volume for a recommendation to be actionable.

The pipeline

1

Ingest

PSX filings and end-of-day prices, SBP macro series. Every filing is stored with both the period it describes and the date it was published.

2

Standardise

Line items are mapped onto one chart of accounts so a bank, a cement maker and a refinery can be compared without pretending they are the same business.

3

Derive

Twenty-nine ratios on a trailing-twelve-month basis, then a winsorised z-score of each against sector peers in the same period.

4

Score

Five pillars combine into a 0-100 composite. Piotroski and Altman fold into quality and safety, and hard risk rules cap the result.

5

Rank

A gradient-boosted ranker is retrained walk-forward on the same features and blended into the composite.

6

Explain

The metrics that moved the score the most are turned into sentences, with the figures that produced them attached.

7

Validate

The whole thing is replayed quarter by quarter against the KSE-100, paying costs and respecting liquidity.

Point-in-time discipline

The single assumption that separates a real backtest from a flattering one.

A company's December quarter describes December, but nobody could read it until the accounts were filed. Scoring December using December's numbers on the first of January would hand the model information it could not have had, and it is the most common reason a stock screen looks brilliant on paper and disappoints in practice.

Annual accounts

120 days

Filing deadline used as the date an annual report becomes usable.

Quarterly accounts

45 days

The equivalent lag applied to interim filings.

Label horizon

63 days

The model may only train on a quarter whose return had already been realised.

The five pillars

Each pillar is the mean of its sector-relative z-scores, mapped so that 50 is the sector average and three standard deviations reaches either end of the scale.

Profitability & earnings quality

30% of the composite

Whether the business earns a real return on the capital it employs, and whether the profit it reports turns into cash.

Return on equity, assets and invested capital, net and operating margin, cash conversion, accrual ratio, free cash flow margin, Piotroski F-Score.

Valuation

25% of the composite

What you pay for that stream of earnings relative to what sector peers cost.

P/E, P/B, P/S, EV/EBITDA, earnings yield, free cash flow yield, dividend yield.

Balance-sheet strength

20% of the composite

Whether the balance sheet can survive a bad year without diluting or defaulting.

Debt to equity, interest cover, net debt to EBITDA, current ratio, equity to assets, Altman Z''-Score.

Growth

15% of the composite

Whether the business is getting bigger, and whether the growth reaches the bottom line.

Trailing revenue and earnings growth, three-year revenue CAGR, equity growth.

Price trend

10% of the composite

Whether the market has already started agreeing, which historically persists over months.

12-1 month momentum, price against the 200-day average, six-month relative strength, three-month return, one-year volatility.

Piotroski F-Score

Nine binary tests of whether a business improved on itself over the past year: is it profitable, is it cash generative, are returns rising, is profit backed by cash, is leverage falling, is liquidity improving, has it avoided issuing shares, is the margin widening, and are assets working harder.

Banks and insurers have no gross margin, no inventory and no meaningful current ratio, so the three tests that depend on them are replaced with lender equivalents: capital strengthening, spread widening and balance-sheet productivity. Where a test cannot be assessed at all, it is recorded as such rather than silently counted as a pass.

Altman Z''-Score

The original 1968 Z-Score was fitted on US manufacturers. The engine uses Altman's later emerging-market variant, which drops the sales-to-assets term that penalises asset-heavy firms, uses book rather than market equity, and adds a constant so the scale is comparable across markets. Above 5.85 is sound, below 4.15 is distress.

Financial companies are excluded from the Altman score entirely, as Altman himself excluded them: working capital and asset turnover do not describe a balance-sheet lender. Those names are assessed on capital adequacy and interest cover instead.

Risk gates

Rules that override a flattering composite. A statistically cheap company in trouble is not a buy, and the score is not allowed to say otherwise.

Altman Z in the distress zonecapped at 45
Piotroski F-Score of 3 or lesscapped at 50
Negative shareholders' equitycapped at 25
Loss-making over the trailing yearcapped at 55
Operating profit below 1.5x finance costcapped at 50
Median traded value under Rs 5m a daycapped at 60

Where the numbers come from

This deployment runs on a simulated point-in-time history of the KSE-100.

PSX publishes company accounts as PDFs and offers no free, survivorship-free bulk history of standardised financial statements, so a decade of clean panel data cannot be assembled from its public endpoints. Rather than backtest on data that does not exist, the project ships a structural simulator: a Pakistan-shaped macro path drives a business cycle, each company carries persistent latent traits, statements are built to satisfy the accounting identities, and prices are pulled toward a fundamental fair value by a mean-reverting force alongside market and sector factors.

That makes every figure on this dashboard a simulation result, not a claim about any real company. The scoring, the explanations and the walk-forward testing work the same way on real data; what a live version still needs is a reliable source of standardised statements built from the PDFs companies publish.

Regulatory position

Distributing personalised investment recommendations to the public in Pakistan falls under the SECP's investment-advisory framework, including its Securities Managers and digital advisory regimes. This project is an academic research prototype: it produces a mechanical ranking with its reasoning attached, it is not tailored to any individual's circumstances, and it is not offered as advice. Any move toward distribution through broker platforms would need to be licensed first, which sits outside the scope of the final year project and is noted here as future work rather than an implementation step.

Research and educational project. Not investment advice. Figures are produced by a point-in-time simulation of the KSE-100 built for reproducible backtesting. Generated 2026-09-12 12:55:38 · universe KSE-100 · history 2014-01-01 to 2025-12-31 · model xgboost.XGBRanker(rank:pairwise).