Skip to content
Amer Khorsheed
All work

Case 04Decision support · Quant engineering

A trading engine whose best feature is saying no.نظام دعم القرار

Year
2026
Status
Alpha · productizing
Discipline
Decision support · Quant engineering
MDSS operator terminal, dark theme, BTCUSDT proposal
0
orders placed, by design
35
architecture decisions recorded
2
locales, natively

01 — The problem

Discretionary traders drown in signals that cannot be audited and models that sound confident. What they lack is a system that shows its maths, records what it knew and when, and refuses when the evidence is not there.

A deterministic, refusal-first trade-proposal engine for crypto and gold/FX. It evaluates market structure, multi-venue price consensus and macro events, then proposes an auditable, falsifiable trade — or declines with a typed reason. It never places an order.

02 — What I built

  1. 01

    A pure NumPy numeric core for indicators, swing anchors, levels, sizing, R-multiples and fees — with zero LLM involvement.

  2. 02

    Bitemporal point-in-time storage that separates when a fact happened from when the engine observed it.

  3. 03

    A React operator terminal: candlestick charts with entry ladders, a conviction scorecard, falsification conditions and the full sizing derivation.

  4. 04

    An empirical calibration curve — stated conviction against realised hit rate with Wilson intervals.

  5. 05

    Bilingual English/Arabic UI with per-locale rationale, a command palette and keyboard navigation.

03 — Architecture

How the pieces fit.

  1. L1Terminal
    • React + TypeScript
    • EN/AR with RTL
    • Cmd-K palette, vim-style jumps
  2. L2Engine
    • Deterministic NumPy core
    • Typed refusal reasons
    • Falsification statements
  3. L3Evidence
    • Multi-venue reconciliation
    • Macro-calendar horizons
    • Evidence classes: REAL / SYNTHETIC / NOT BUILT
  4. L4Store
    • Bitemporal facts
    • SQLite → TimescaleDB path
    • Alembic migrations

Requests flow top to bottom · each layer depends only on the one beneath

04 — Decisions that matter

Decisions

D01

Refusal is a product feature

Unaligned structure, an economic release inside the horizon or a failed price consensus each produce an explicit, typed refusal instead of a weak trade.

D02

No model near the numbers

Every level and size is a pure, testable function — language models may explain, never compute.

D03

Radical honesty about evidence

Every result in the repository is classed as REAL, SYNTHETIC FIXTURE or NOT BUILT, so a demo can never pass as proof.

05 — Security & trust

  • Strictly no order placement — the terminal action is a proposal and a notification.
  • Evaluations run only on request, because they touch live venues and write to the store.
  • A `doctor` command that verifies every required and optional dependency before use.

06 — Stack

  • Python 3.12
  • NumPy
  • FastAPI
  • SQLite
  • TimescaleDB
  • React
  • TypeScript
  • Docker

07 — In the product

MDSS operator terminal, light theme
Light theme — the same proposal, the same audit trail.

Next case · 05

Bousla

Streaming and a verified Islamic library, for one organisation.