Skip to main content

Strategy anatomy

Every strategy the AI assembles is a structured object with a fixed set of fields. This page explains what each field means, how the platform uses it at runtime, and what the valid range is.

Understanding these fields is the fastest way to get from a first backtest to a well-calibrated live strategy.


Identity & classification

FieldTypeWhat it means
namestringThe strategy's display name, derived from the AI conversation
assetstringThe instrument being traded - e.g. ETH/USDT, TCS_SHARE
asset_class_idstringequity_cash or crypto_spot
timeframestringCandle interval: 1m, 5m, 15m, 1h, 4h, 1d
tagstringbullish, bearish, or neutral - the directional bias
typestringmanual (single asset) or dynamic (multi-asset universe)

Entry conditions

The entry block defines when the strategy opens a position. All conditions must be true simultaneously on a completed candle close.

FieldTypeWhat it means
entry_conditionsarrayList of indicator + threshold rules that must all be true
entry_logicstringAlways AND - every condition must hold
entry_onstringcandle_close - positions open at the close of the triggering candle

Example entry condition set:

RSI(14) above 60
EMA(9) above EMA(21)
Volume above 20-period average

All three must be true on the same candle close for a position to open.

Signal plan structure

Internally the AI constructs a SignalPlan that the execution engine evaluates:

interface SignalPlanEntry {
name: string; // indicator name, e.g. "RSI", "EMA"
params: Record<string, unknown>; // indicator parameters, e.g. { period: 14 }
signal_type: 'TRIGGER' | 'FILTER'; // TRIGGER fires the trade; FILTER must also pass
timeframe: string; // candle resolution for this indicator
}

interface SignalPlan {
entry: SignalPlanEntry[];
entry_condition: string; // logical expression, e.g. "A AND B"
exit: SignalPlanEntry[];
exit_condition: string;
signals_available: number; // total indicators available in the KB
signals_used: string[]; // which signals this strategy uses
kb_signals_available: number; // knowledge-base indicator count
kb_signals_used: string[]; // KB-sourced signals used
}

TRIGGER signals are the primary fire condition. FILTER signals must also be true but alone cannot open a position. A typical strategy has 1-2 TRIGGERs and 0-2 FILTERs.


Exit conditions

The exit block controls when an open position is closed. The platform checks exit conditions on every candle close and on every price tick for stop-loss and take-profit.

FieldTypeWhat it means
exit_conditionsarrayIndicator rules - if any is true, the position closes
exit_logicstringAlways OR - any single condition triggers exit
stop_loss_pctfloatDistance from entry price at which the hard stop fires, in %
take_profit_pctfloatFixed take-profit distance from entry, in % (if not trailing)
trailing_tpboolWhether take-profit trails the price instead of being fixed
trailing_tp_trail_pctfloatHow far the TP trails behind peak price, in %
trailing_tp_arms_at_pctfloatTP only activates after price has moved this far in your favour

How trailing TP works:

When trailing_tp is true, the take-profit only arms after price has moved arms_at_pct in your direction. Once armed, it trails trail_pct below the peak price seen since entry. The position closes when price falls back to the trailing level.

Example: entry at 100, arms_at = 1.5%, trail = 0.8%.

  • TP arms when price hits 101.5
  • At that point the trail level is 100.69 (1.5% - 0.8% from entry)
  • If price peaks at 102, the trail level rises to 101.18 (102 x (1 - 0.008))
  • Position closes when price falls to 101.18
Stop-loss fires on tick, not candle close

The stop_loss_pct level is evaluated on every price tick, not just candle closes. A candle can wick down to your stop and close above it - you will still be stopped out.

Multi-target take-profit (TP1 / TP2)

Instead of a single all-or-nothing exit, a strategy can take profit in stages - closing part of the position at a first target (TP1), more at a second (TP2), and so on. This locks in gains early while leaving a portion running for a larger move.

FieldTypeWhat it means
take_profit_targetsarrayOrdered list of profit targets; each closes a slice of the position
target.at_pctfloatDistance from entry, in %, at which this target triggers
target.close_pctfloatPortion of the original position to close when this target hits

Example - a two-stage exit:

TargetTriggers atClosesRemaining
TP1+1.5%50% of the position50%
TP2+3.0%remaining 50%0%
  • At +1.5%, half the position is sold - profit banked, risk on the trade halved.
  • The rest runs to +3.0% (TP2) or until an exit condition / stop fires first.

Multi-target take-profit combines with the other exit mechanics: the stop_loss_pct still protects the whole position, and trailing_tp can manage the final remaining slice after the fixed targets are hit.

Partial exits still respect exit conditions

Between targets, the position remains subject to exit_conditions and the stop-loss. If an exit condition fires before a target is reached, the entire remaining position closes.


Sizing & risk

FieldTypeWhat it means
per_trade_risk_pctfloatMaximum % of allocated capital to risk on a single trade
risk_reward_ratiofloatTarget R:R - used to derive take-profit if not explicitly set
max_position_size_pctfloatMaximum % of allocated capital in one position at a time

How position size is calculated:

position_size = (capital_allocated × per_trade_risk_pct) / stop_loss_pct

If this would exceed max_position_size_pct, the position is capped at that percentage instead. This means the actual loss on a stop-out could be less than per_trade_risk_pct.


Trading window

FieldTypeWhat it means
trading_window_starttimeEarliest time a new position can be opened, in the venue's local time (e.g. 09:15)
trading_window_endtimeLatest time a new position can be opened, in the venue's local time (e.g. 15:30)
max_trades_per_dayintHard cap on new positions per calendar day
max_open_positionsintHow many positions can be open at the same time
continuousboolContinuous markets (crypto) - strategy runs 24/7, no window restriction
A trading window is in the venue's local time

09:15 means 09:15 where the market is, IST on NSE, ET on a US venue, London time on LSE. It is not your local time and it is not UTC.

That matters twice. A window is only meaningful inside the venue's session, so 09:15-15:30 describes a full Indian session and describes nothing at all on a US venue, whose regular session is 09:30-16:00 local. And the offset from UTC changes with daylight saving (Sydney's DST runs opposite to the northern hemisphere, and London, New York, Amsterdam and Madrid all change on different dates) which is why the window is stated in local time rather than converted.

Per-venue sessions are listed on Trading hours & holidays. A window outside its venue's session simply never opens.

Session-bound vs. continuous markets

An equity strategy defaults to its venue's regular session. Crypto strategies with continuous: true ignore the trading window for new entries but still respect max_trades_per_day.


Status fields

These are set by the platform, not the AI, and reflect the current state of the strategy.

FieldMeaning
status: draftCreated but not deployed
status: paperRunning in the paper simulator
status: liveRunning against a real broker/exchange
status: pausedDeployed but not accepting new entries
status: stoppedFully halted; no positions will open
deployedPaper: trueStrategy has an active paper deployment
deployedLive: trueStrategy has an active live deployment

A strategy can be in both deployedPaper and deployedLive simultaneously - those are independent paths.


Next