Amirali YaghoutiSenior Software Engineer

ai Case study

Trading Strategy Research System

Generating trading rules is easy and almost entirely worthless without the second half: an evaluation that is hard to pass and an explanation a person can argue with. This system is mostly the second half.

The business problem

A model asked to produce trading strategies will produce them indefinitely, and they will look plausible. The difficulty is that a strategy which fits historical data is the default output, not the exception, and a plausible explanation attached to an overfitted rule is more dangerous than no explanation at all.

What I delivered

  • A system that designs candidate strategy logic and, for each one, produces the reasoning behind it in a form a person can inspect.
  • An evaluation stage that candidates must pass before they are treated as anything more than a hypothesis.
  • Explicit handling of high-risk logic, so that the decisions with the largest downside are the ones surfaced for review rather than the ones buried.
  • A structure where generation and judgement are separate stages, so the thing proposing a strategy is not the thing approving it.

Technical approach

  • Generation and evaluation are deliberately separated. A system that scores its own output converges on whatever it is good at producing.
  • Every candidate has to state its reasoning, because a rule you cannot explain is one you cannot decide to trust or discard.
  • The sensitive decisions are routed for review rather than automated. In trading, the decisions with the worst downside are exactly the ones worth a person's attention.
  • The output is treated as a hypothesis throughout. Nothing here is a recommendation, and the architecture reflects that.

Result and evidence

Candidate strategies arrive with their reasoning attached and having passed an evaluation stage, which makes them arguable. That is the property that makes the output useful rather than merely voluminous.

Commercial value

The scarce resource in this kind of work is not ideas, it is a reliable way to reject most of them. Building the rejection path properly is what makes the generation worth running.

implementation-brief.readme

Readable implementation brief

implementation_brief {
  project: "Trading Strategy Research System"
  stages: "generate -> explain -> evaluate -> review"
  separation: "the generator never scores its own output"
  requirement: "every candidate states its reasoning"
  routing: "high-risk logic goes to a person, not a trigger"
  stance: "output is a hypothesis, never a recommendation"
}

What this project shows

Keeping generation and judgement separate is the whole design. Any system that grades its own homework will report that it is doing well.

Routing high-risk logic to a person rather than automating it is a limit I put in on purpose. Knowing where automation should stop is part of building it.