← All projects

Case study

Luqman

Signals that must prove themselves

Role
Sole author
Stack
Python · pandas
Status
Open source, research project
Since
2024
Code
github.com/OmarAbdo/Luqman ↗

The problem

Luqman started in 2024 as a trading assistant built on deep learning. It had a data pipeline that pulled prices from financial APIs and turned them into training sequences, and LSTM, GRU and CNN models with attention layers trained on those sequences, with sliding-window cross-validation.

The models trained fine and the charts looked good. What I couldn’t answer was whether any of it would hold up on data the model had never seen, and in markets that question decides everything. A feature that leaks one day of the future into the training set, or one that only works on a single stock, produces a beautiful backtest and nothing else.

So in 2026 I rebuilt Luqman around that question. The models came second, and the first job became proving which signals deserve a model at all.

How a signal gets in

Every candidate feature goes through the same proof before any model may use it.

  • Eight stocks across sectors: Apple, Microsoft, JPMorgan, Exxon, Johnson & Johnson, Walmart, Nvidia and Coca-Cola. A feature can’t pass by fitting one company’s history.
  • An information coefficient gate. The rank correlation between the feature and the forward return has to reach at least 0.08, on the full period and on average across time blocks, with the sign consistent in at least 70% of the blocks. At least six of the eight stocks have to pass.
  • A marginal skill gate. Added to a ridge regression, evaluated walk-forward against a zero-return baseline, the feature has to make the model better.

A feature that passes is admitted. Everything else is rejected, and the report says why.

Decisions and what they cost

Point-in-time data, by construction

News, earnings and analyst revisions arrive at specific times. An event published before a day’s close belongs to that day, and one published after the close belongs to the next trading day. Luqman maps every event this way before any feature sees it, so a feature can’t use information that wasn’t public yet. The cost is that each data source needs its timestamps handled properly, and some sources are dropped because they can’t be.

Walk-forward evaluation only

Every evaluation trains on the past and tests on the period right after it, then moves forward. No random splits, because random splits leak the future into training for time series. It means fewer usable test periods and slower runs.

Simple baselines first

A model has to beat “the return is zero” and a ridge regression before anything deeper is worth trying. Most features don’t get that far, and that’s the information I wanted.

What’s in it

  • A data layer with validation, a Parquet store and as-of joins for prices, fundamentals, earnings, analyst grades, macro data, news and the VIX.
  • Feature families for momentum, reversal, volatility, post-earnings drift, analyst revisions, value and quality, and cross-asset signals.
  • An evaluation layer with walk-forward splits, event studies, feature audits and a cross-sectional backtester with volatility-based position sizing.
  • Proof scripts whose printed reports are the record of each run, and a test suite for the leakage-sensitive parts.

What’s next

More feature families through the same gates, and only then a model on top of the admitted ones. Luqman is research, not a trading product, and it doesn’t make claims about returns.