Inspiration

I started TradingAI from a simple concern: most investment assistants hide an important question — who actually makes the decision?

A language model can produce a convincing recommendation, but financial decisions also require explicit constraints, reproducible calculations, risk controls, and human accountability.

I wanted to explore a different architecture:

TDI-X thinks. GPT-5.6 explains. Humans decide.

TradingAI existed as an earlier prototype before OpenAI Build Week. During Build Week, I used Codex with GPT-5.6 to audit the original repository and substantially rebuild it as the TradingAI Gold Edition: a safer, deterministic, explainable, and competition-ready personal-finance application.

What it does

TradingAI converts a user's financial intent into a structured investment mandate.

The user defines:

  • available capital;
  • risk profile;
  • investment horizon;
  • indicative return objective;
  • maximum drawdown budget;
  • eligible asset classes;
  • maximum allocation per position;
  • minimum cash reserve;
  • aggregate cryptocurrency ceiling;
  • staged-entry window;
  • leverage exclusion;
  • mandatory human approval.

The application then validates the mandate, creates a deterministic Mandate DNA profile, ranks an illustrative multi-asset universe with TDI-X, constructs a constrained portfolio proposal, checks every implemented rule, applies stress scenarios, and generates an auditable explanation.

The result is not a trade order. It is a simulation-only investment proposal requiring human review.

The core innovation: TDI-X

TDI-X is the deterministic quantitative intelligence layer of TradingAI.

For the Build Week edition, it is implemented as a transparent and inspectable illustrative scoring engine combining:

  • trend and momentum;
  • quality;
  • liquidity;
  • risk efficiency;
  • market-regime alignment;
  • diversification value.

The raw score is then adjusted using explicit mandate parameters such as the selected risk profile, horizon, target return, and cryptocurrency limit.

The interface exposes:

  • the raw TDI-X score;
  • the adjusted score;
  • the robustness indicator;
  • the component decomposition;
  • the mandate adjustments;
  • the inclusion or exclusion reason.

GPT-5.6 is not part of the numerical scoring formula.

Mandate DNA

Mandate DNA converts the selected controls into an interpretable profile across seven dimensions:

  • growth orientation;
  • risk tolerance;
  • liquidity need;
  • resilience priority;
  • diversification priority;
  • volatility tolerance;
  • time-horizon strength.

It is not a personality or scientific suitability assessment. It is a deterministic visual representation of the active mandate.

Constraint-enforced portfolio construction

TradingAI does not merely display constraints. The Gold Edition applies them during portfolio construction.

The engine verifies:

  • exact 100% allocation;
  • exact dollar totals;
  • selected asset-class eligibility;
  • minimum cash reserve;
  • maximum position size;
  • aggregate cryptocurrency ceiling;
  • long-only allocation;
  • leverage and derivatives exclusion;
  • mandatory human approval;
  • approximate drawdown-budget consistency;
  • indicative target-return feasibility.

The Constraint Proof view compares every requested value with the achieved result and returns PASS, WARNING, or FAIL evidence.

When a mandate is infeasible, the application reports the problem instead of silently violating the user's constraints.

Stress Lab

Stress Lab applies deterministic class-level shocks to the generated portfolio.

The scenarios are simplified sensitivity illustrations rather than forecasts, Value-at-Risk models, or historical backtests.

For each scenario, TradingAI displays:

  • estimated dollar impact;
  • post-shock portfolio value;
  • sensitivity percentage;
  • comparison with the selected drawdown budget;
  • asset-level contribution.

How GPT-5.6 is used

GPT-5.6 is used only as a bounded explanation layer.

It may receive the final structured mandate, TDI-X results, portfolio allocation, constraint evidence, and stress-test result. Its role is to:

  • explain the proposal in plain English;
  • communicate trade-offs and uncertainty;
  • identify warnings;
  • summarize the evidence for the user.

GPT-5.6 cannot modify scores, allocations, constraints, or safety controls.

No API key is committed to the repository. When no key is available, the application uses an explicitly labelled deterministic local fallback so the project remains testable and does not falsely claim that an API call occurred.

How I used Codex

Codex was used as the primary repository-level development agent during Build Week.

It helped me:

  • audit the original TradingAI prototype;
  • identify gaps between product claims and actual behavior;
  • extract the deterministic business logic from the Streamlit interface;
  • implement mandate validation and Mandate DNA;
  • implement TDI-X scoring and eligibility;
  • replace the static portfolio with constraint-enforced construction;
  • add stress testing, audit exports, and reporting;
  • integrate the bounded OpenAI Responses API adapter;
  • rebuild the Gold Edition user interface;
  • create and run automated tests;
  • review secrets and prohibited brokerage integrations;
  • update the README and competition documentation;
  • create a sanitized competition package.

Product vision, requirements, prioritization, acceptance criteria, testing decisions, and final submission decisions remained human-governed.

AI-assisted development workflow

The project used three clearly separated AI roles:

  • ChatGPT supported product vision, competition positioning, requirements, architecture discussions, documentation, and demo planning.
  • Codex with GPT-5.6 performed repository-level implementation, testing, review, and packaging.
  • GPT-5.6 in the application is an optional runtime explanation layer that cannot modify deterministic outputs.

This separation mirrors the product philosophy itself: AI can calculate or explain within bounded roles, while humans retain ownership and responsibility.

Challenges I ran into

The main challenge was not creating another attractive AI dashboard. It was making the behavior match the claims.

The original prototype had several weaknesses:

  • some displayed constraints did not fully control the allocation;
  • the portfolio was too static;
  • explanation inputs were not sufficiently connected to the final TDI-X results;
  • the application did not provide enough machine-readable evidence;
  • the distinction between quantitative scoring and language generation needed to be clearer.

The most important work was therefore architectural rather than cosmetic: separating deterministic domain logic from the interface, enforcing the mandate, testing infeasible cases, and keeping GPT-5.6 outside the numerical decision path.

Accomplishments

The Gold Edition currently includes:

  • a ten-page English Streamlit experience;
  • validated investment mandates;
  • deterministic Mandate DNA;
  • transparent TDI-X scoring;
  • opportunity ranking with inclusion reasons;
  • constraint-enforced portfolio construction;
  • exact percentage and dollar totals;
  • deterministic staged-entry schedules;
  • three stress-test scenarios;
  • bounded GPT-5.6 explanation and honest local fallback;
  • downloadable session-audit JSON;
  • a downloadable offline HTML report;
  • simulation-only safety controls;
  • automated domain and security tests.

The final verification completed successfully with 20 automated tests passing.

What I learned

I learned that explainability is not only a paragraph generated after a decision.

Real explainability requires:

  • structured inputs;
  • traceable calculations;
  • explicit constraints;
  • reproducible outputs;
  • honest uncertainty;
  • evidence that can be inspected independently.

I also learned how effective Codex can be when the task contains a clear finish line, explicit safety boundaries, acceptance tests, and a human review loop.

What's next

TradingAI Gold Edition uses bundled illustrative data and simplified competition models.

A production evolution would require:

  • licensed and governed market data;
  • historical validation and walk-forward testing;
  • transaction-cost and tax modelling;
  • stronger portfolio optimization;
  • model-risk governance;
  • jurisdiction-specific suitability controls;
  • secure user authentication;
  • persistent audit storage;
  • broker-independent paper simulation;
  • regulatory and cybersecurity review.

Real-money execution remains deliberately disabled.

Safety and limitations

TradingAI Gold Edition:

  • uses illustrative demo data;
  • does not provide live market predictions;
  • does not guarantee returns;
  • does not provide financial, legal, tax, or accounting advice;
  • does not contain a brokerage or order endpoint;
  • does not enable leverage or derivatives;
  • requires human approval for every simulated intention.

Created and directed by Youness Laamiri, PhD.

Independent project submitted to OpenAI Build Week 2026.

Built With

Share this project:

Updates