Skip to main content

Strategy generation process

Who it’s for
Users who want to know what happens between typing and seeing a strategy
Assumes
You have read How the AI reads your words

Nine stages, from your sentence to a deployed strategy. Every one of them can stop the process, and every stop has a reason you are shown.


The whole path

StageWhat happens
1. Your ideaFor example: momentum on RELIANCE, 5m, RSI above 55, 1.2% stop
2. AI understandingRouter and extractor run concurrently, producing one action plus every value you stated
3. Intent extractionThe resolver builds an Intent, marking each value stated, defaulted or derived. The intent is validated before the compiler runs
4. Strategy constructionThe compiler produces a formal object, or typed gaps. See the three outcomes below
5. ValidationA fail-closed gate against the live engine: seven check families, and every finding carries a disposition
6. Risk checksA stop exists, an exit exists, direction and legs agree, and the scale-out ladder cannot oversell the position
7. BacktestReal historical data, full cost model
8. Your reviewThe complete strategy object and the graded result. Nothing has touched a market at this point
9. DeploymentYour explicit action: paper or live, with an allocation

Stage 4 has three outcomes:

OutcomeWhat happens next
OKContinue to validation
GapsOne bounded repair pass, then continue or refuse
RefusedStop, and tell you what cannot be expressed

Stages 2 through 6 all happen inside one chat turn. Stage 7 is a separate action you ask for. Stages 8 and 9 are yours.


Stage 2: AI understanding

Your message is read concurrently by the router (what action?) and the extractor (what values?). Covered in full on How the AI reads your words.

The router

The router picks exactly one tool per turn from a catalog of 18. The set it may choose from depends on the conversation phase.

PhaseLadder tools added to the ambient set
collect_user_inputplan_strategy_signals, edit_condition_term
plan_signals+ modify_signal_selection, assemble_strategy, halting tools
assemble_strategy+ run_backtest, get_backtest_result
backtest_confirmationThe full ladder, improve, re-plan, re-run, start over
backtest_completeThe full ladder

Ambient tools are available in every phase: clarification, market data, indicator search, input edits, starting over, and both reply tools. Those requests are not tied to a construction stage. You can ask "what dividend data do you have for RELIANCE" while collecting inputs, mid-planning, or after a backtest.

Halting tools (pause_workflow, mark_strategy_rejected) are not available while inputs are still being collected. There is no artifact to reject and no automation to pause before the ladder has started.

An unrecognised phase returns the full catalog, a deliberate fail-safe so a reachable tool is never dropped.

Why one tool and not several: the router may call exactly one tool per turn, and two tools carrying overlapping halves of one concept means a message stating both an entry rule and a stop delivers whichever half wins the toss. The input tool now carries the full union of 59 fields, so offering the risk tool as a rival choice could only lose data.


Stage 3: Intent extraction

The resolver turns your words into an Intent: instrument, timeframe, objective, direction, entry rules, exit rules, risk controls, gates, each as a slot carrying a value and its provenance.

Then, before the compiler is invoked, the intent is validated deterministically. An intent that cannot be built is refused with a reason rather than producing a compiler error nobody can attribute. Missing blocking values are named:

Intent Validation
result: FAIL
compiler_ready: NO
errors: 1
ERRORS
instrument required before a strategy can be built

At this point the four inheritable slots (instrument, timeframe, objective, direction) are filled from conversation state if this message did not restate them. Rules are never inherited.


Stage 4: Strategy construction

The compiler turns the Intent into a formal strategy object. It returns one of three statuses.

StatusMeaningWhat happens
OKEverything you stated was read faithfullyContinue to validation
GAPSSome spans could not be read; they are listed with reasonsOne bounded repair pass
REFUSEDAt least one gap is NOT_REPRESENTABLEStop. Retrying cannot help

The bounded repair pass

Pass 1. The resolver reads your whole message and produces an Intent. The compiler consumes that Intent and returns a result, which is one of three things:

ResultWhat happens
OKDone
RefusedYou are told what cannot be expressed, and the pipeline stops
GapsContinue to pass 2

Pass 2. The resolver re-reads only the open spans and produces patches. Each patch is parsed against the engine grammar, and anything illegal is rejected. The compiler runs again on the patched Intent. Anything other than OK is a refusal, and the pipeline does not loop again.

Four properties, each load-bearing:

Bounded. Two passes, never three. A span that failed twice will fail a third time.

Additive. Pass 2 receives only the spans pass 1 could not close. Everything already read is frozen, otherwise a correctly-read stop-loss could come back different on retry.

Gated. Every patch is parsed against the engine grammar before insertion. The engine rejects an unknown function but silently resolves an unknown identifier to NaN, so a fabricated indicator would make your entry false on every bar and produce a zero-trade backtest with no error anywhere.

Reason-driven. NOT_REPRESENTABLE and AMBIGUOUS_SCOPE never retry. The first has no answer to find; the second's honest resolution is a question to you.

Caching on meaning, not wording

Results are cached against the intent, not the prompt. "buy reliance 5min sl 2%" and "reliance 5 min, stop 2 percent" are different strings and the same intent, so they share one cache entry. Infinitely many phrasings collapse onto finitely many intents, a reach a prompt-level cache cannot have.


Stage 5: Validation

The fail-closed gate. Detailed on Validation system. Summary: seven check families, run against the live quant engine, and no engine means a hard error, never a silent pass.

Findings do not simply pass or fail. Each carries a disposition saying what should happen, repair it automatically, drop an optional element, ask you, or block. See Repair system.


Stage 6: Risk checks

Part of validation, called out separately because it is the family with the most direct consequence:

  • A stop-loss exists. A strategy with no stop does not pass.
  • An exit exists. A strategy that can enter and never leave does not pass.
  • Direction and legs agree, a long-only strategy cannot carry a short leg.
  • A scale-out ladder cannot sell more than the position it holds.
  • Gates fit the market. An exchange session window transplanted onto a 24/7 crypto symbol, or a window disjoint from the instrument's own session, is a finding.

These are strategy-object checks at build time. They are a different layer from the nine execution gates that run on every live order. See How risk is enforced.


Stage 7: Backtest

You ask for it; it is not automatic. The strategy runs over historical data with the full cost model applied, slippage, commission and, in Indian markets, statutory charges. See Backtesting.

You can state a period, a starting balance, and cost overrides in the same sentence:

backtest the last 6 months with 5 lakh

See Choosing a test period.


Stage 8: Your review

The complete strategy object and the graded result. Nothing has touched a market at this point. Every field is visible with its provenance, so you can see what you stated and what the platform supplied.

This is the stage to actually read. A strategy you skimmed is a strategy you authored anyway.

Stage 9: Deployment

An explicit action on a specific strategy with a specific capital allocation, in paper or live. Nothing deploys itself. See Paper vs live.


Where it can stop, and what you see

StageStop reasonWhat you see
3A blocking value is missingA specific question, not a generic error
4AMBIGUOUS_SCOPEThe exact words, and a question about what you meant
4NOT_REPRESENTABLEWhat the platform cannot express, and the nearest thing it can
4Still incomplete after pass 2A refusal rather than a third attempt
5A finding dispositioned BLOCKThe reason, in language addressed to you
5A finding dispositioned ASKOne question with concrete options
7Requested window before 1 Jan 2024The earliest supported date
7No trades in the windowA grade D result and the reason

A stop is not a failure of the platform. It is the platform declining to produce something that would mean something different from what you asked for.


Next