Skip to content
All stories

Finner · personal R&D

Reading stock tips from WhatsApp, and checking every one

Stock-tip groups on WhatsApp post calls all day in Roman Urdu. Some are noise, some are hype, and nobody keeps score of who is actually right.

Context

Finner is a chat-first personal-finance app for salaried and freelancing Pakistanis. In my own build it also reads the stock calls posted in the WhatsApp groups I follow, checks every one in plain code, and keeps a score for each group and sender against what the price actually did. It never places a trade. It describes the call; I decide.

How it works, step by step

  1. Step 1 of 12

    Built

    Catch the message

    The phone picks up each new message from the groups I chose, even when the app is closed. Private chats are ignored.

    At this step

    PASM khareedain 12.40-12.60 SL 11.80 TP 13.50 / 14.20

    A Kotlin NotificationListenerService reads WhatsApp group notifications for tracked groups only and dedupes by hash. Muted groups come in through an encrypted backup import, with the key kept in the Android Keystore.
  2. Step 2 of 12

    Built

    Skip the chatter

    A message with fewer than two numbers can't be a stock call, so it never reaches the AI. That removes about two thirds of all messages.

    At this step

    5 numbers found → read it

    The read loop drops anything with fewer than 2 numbers before any model call. On a sample set about 65% of messages stopped here, which keeps AI cost and noise down.
  3. Step 3 of 12

    Built

    Read it like a trader would

    AI turns the message into a clear call: which stock, buy or sell, entry, stop loss and targets. It copies the numbers. It never calculates them.

    At this step

    { "symbol": "PASM", "side": "buy", "entry": [12.40, 12.60], "stop": 11.80, "targets": [13.50, 14.20] }

    One call per message: a WorkManager job sends it to a sign-in-protected Supabase edge function (Qwen) that must answer in a strict JSON schema. Up to 3 of my past corrections ride along as worked examples.
  4. Step 4 of 12

    Built

    Check it in code, not by AI

    Plain code checks the reading: the stock must be real, the stop below the entry, every target above it. Failures become “not a signal”, with the reason.

    At this step

    ✓ PASM listed ✓ 11.80 < 12.40 ✓ 13.50 and 14.20 > 12.60

    SignalValidator (Kotlin): symbol pattern plus the PSX list, a clear side, positive numbers, stop < entry low < every target (mirrored for sells). No stop means “incomplete”. 15 unit tests.
  5. Step 5 of 12

    Built

    Load real prices

    Each evening the exchange's official closing-price file is loaded into the app. Nothing is scraped from websites.

    The PSX daily closing file (date, symbol, open, high, low, close, volume) is shared into the app and stored per day. No scraping: PSX blocks bots and it would break their terms.
  6. Step 6 of 12

    Built

    See what really happened

    For 10 trading days each call is tracked: target first, or stop first? A day that touched both counts as unclear, never as a win.

    At this step

    waiting entry → open → target · stop · expired · unclear

    Outcomes are resolved on daily bars with a 10-trading-day expiry. A day spanning both levels is AMBIGUOUS, and a gap through the stop fills at the open. 14 tests.
  7. Step 7 of 12

    Built

    Spot the red flags

    Hype words like “guaranteed”, “pakka” or “VIP”, and one stock pushed by several groups within half an hour, are flagged.

    RedFlags: a Roman Urdu + English hype lexicon, plus cross-group pushes (the same symbol from 2+ groups within 30 minutes, and mentions within ±7 days).
  8. Step 8 of 12

    Built

    Score every group and sender

    Each group and sender gets a report card: how often they were right, and gain or loss per unit of risk. Too few calls to judge? The card says so.

    ReportCard uses resolved calls only: hit rate, average R, expectancy after costs, median days to target. Under 20 resolved calls the card says so in words. Goes live as price history builds.
  9. Step 9 of 12

    Built

    Size it to my own money

    It works out how many shares fit my risk limit, and what being wrong would cost in rupees and in days of essential spending.

    Position size is floor(capital × risk% ÷ |entry − stop|), capped by capital, with the stop-out cost shown in PKR and in days of essentials. 10 tests.
  10. Step 10 of 12

    Built

    Keep an honest journal

    What I actually did (took it, skipped it, exited) is saved with the profit or loss, so I can see whether following tips ever beats skipping them.

    A journal table (took / skipped / exit) with realised P&L. It refuses impossible trades, such as an exit before the entry. 9 tests.
  11. Step 11 of 12

    Planned

    Alert within seconds

    Next: a phone alert with the group's record, the top red flag and the position size, plus Took it / Skip / Later buttons.

    Planned: native notification actions that write journal rows directly, working with the app closed through the native pipeline.
  12. Step 12 of 12

    Planned

    Read screenshots and voice notes

    Next: calls posted as chart screenshots or voice notes go through the same reader and the same checks.

    Planned: a vision model and speech-to-text feeding the same strict-JSON reader and the same validator.

Try it yourself

Paste a stock call, like the ones posted in WhatsApp groups, and watch the same checks run.

0/500

Try an example

A simplified, rules-only version running in your browser. Nothing you type is sent anywhere. The real reader uses AI first, then runs these same checks.

Verification slip

Checked in code

Paste a stock call to check it

Decisions & tradeoffs

Chose
checking every reading in plain code
over
trusting the AI's answer
because
a model can misread Roman Urdu or invent a number. Code rules catch that and keep the reason, so a wrong reading never reaches a score.
Chose
the exchange's official daily price file
over
scraping price websites
because
PSX blocks bots and scraping would break their terms. The official file is exact and repeatable.
Chose
counting a day that touched both stop and target as unclear
over
counting it as a win
because
with daily prices you can't know which came first. Calling it a win would flatter every group.

What's real today

Personal R&D, not a public feature. Buy/sell calls are regulated advice in Pakistan, and Play doesn't allow notification readers in finance apps, so this lives only in my own build. Report cards go live as daily prices build up; alerts and screenshot/voice reading come next.

What it achieved

of messages never reach the AI
~65%
AI call per message, and every number is checked in code
1
unit tests on checks, outcomes, report cards, sizing and journal
55
orders placed by the app: it informs, I decide
0

Stack & role

Solo: product, the Android native layer, the AI reader, the checks and the maths.