Skip to content
Bilal Khan
  1. 01About
  2. 02Work
  3. 03Experience
  4. 04Photography
  5. 05Contact
All work
02 · Personal · Quant · 2026

Signal Stack

An indicator stack where every module answers exactly one orthogonal question, then gets AND-gated.

DIRECTIONPATH QUALITYMAGNITUDERISK DISTANCETRADEABILITYENTRY = ALLSCHEMATIC

At a glance

Why
Composite scores hide which condition failed. Separate, single-purpose modules make every decision explainable.
My role
Designed the five-module architecture and calibrated each threshold against empirical null distributions.
Result
A non-repainting stack: a signal that appears intrabar cannot quietly disappear before the close.
Stack
  • Pine Script v6
  • Python
  • NumPy
  • SciPy
  • TradingView
  • Dukascopy tick data

Rather than blending signals into a composite score, the stack splits into modules that each answer one question and nothing else: direction, path quality, economic magnitude, risk distance, and market efficiency.

Structure

Flow MA Core answers direction. Trend Regime Gate answers path quality. Leg Extension answers whether the move is economically large enough to be worth taking. RS Volatility Stop answers how far away risk sits. Tradeability Gate answers whether the market is efficient enough right now to act at all.

Entries require every condition to agree; exits fire on any single one. The asymmetry is deliberate — the cost of missing a trade and the cost of holding a bad one are not the same.

Calibration

Thresholds are calibrated against empirical null distributions rather than percentile ranks. Percentile ranks fire uniformly by construction and therefore carry no information about whether anything unusual is happening; a null distribution tells you how surprised to be.

The whole stack is non-repainting: intrabar signals are monotone non-decreasing within the live bar, so a signal that appears cannot quietly un-appear before the close.