create_strategyCreate a strategy in an owned or newly created project, or clone an owned strategy with from_strategy_id.
Area
Strategy Builder
Group
Authoring
Access
Write
Risk
May change server state
▸Details
Full description
Details
Use to start a new strategy. Every strategy belongs to a research project. Pass project_id to add it to an owned project; omit it and a new project named after the strategy is created (project_created is true and project_id names it) and reserved_holdout gives the holdout window that project set aside for out-of-sample validation: relative-lookback backtests shift earlier to avoid it. Tell the user it was reserved; it is spent once, on a finished strategy, with run_strategy settings={"window":"holdout"}. Pass that project_id to later create_strategy calls for the same idea so related strategies share a scratchpad, holdout window and portfolio scope.
Pass from_strategy_id to clone an owned strategy into its source project, inheriting instruments, timeframe, conditions, rules, anchors and zones. A clone takes name and inherits the source's project; instruments and timeframe are for new strategies only.
instruments are the symbols the strategy trades. Pass a single-element
list for a single-instrument leaf, or multiple elements for a basket
that runs the same strategy template across each instrument (a basket
requires an allocation policy set via edit_strategy).
Returns the strategy_id, stored name and warnings when naming limits or uniqueness change the supplied name. Use add_rule for ordinary entry/exit/gate authoring, then set configuration until readiness reads ready. Read builder_discover(action='quickstart') for the incremental authoring loop.
Reuse idempotency_key with identical inputs on retries, e.g. after a timeout. Retries identify the originally created strategy and describe its current name, instruments and readiness. Clone counts describe the original creation. Different inputs under the same key return IDEMPOTENCY_CONFLICT; REQUEST_IN_PROGRESS gives a retry delay.
Examples: # Single-symbol strategy in a new project strategy = create_strategy(name="RSI 14 oversold", instruments=["SPY"], timeframe="1h") # Basket strategy in the same project strategy = create_strategy(name="Mag7 trend", instruments=["AAPL", "MSFT", "GOOG"], timeframe="1d", project_id=strategy.project_id)
Capabilities
Bounded options and operating modes surfaced above the full JSON schema.
Required Inputs
namestringShort strategy name, up to 5 words / 48 chars; a clone's name. Duplicate names in the same project are versioned automatically (e.g. 'RSI dip buy v2').Optional Inputs
from_strategy_idanyOf (2 variants)Owned source strategy to clone; inherits its project and authored configurationidempotency_keyanyOf (2 variants)Optional retry key. Repeating a call with the same key and identical inputs returns the strategy the first call created instead of a new copy.instrumentsanyOf (2 variants)Required for a new strategy; omit when cloning (inherited). The symbols the strategy trades. Single-instrument leaf: ['SPY']. Basket: ['AAPL', 'MSFT', 'GOOG'] — runs the same strategy template across each instrument; a basket (len >= 2) requires an allocation policy set via edit_strategy. 13 tickers name both an equity and a crypto pair (LTC, DASH, LINK, ...); those are rejected as ambiguous — say 'LTC-USD' for the crypto pair or 'EQ:LTC' for the equity. Must contain at least one symbol.project_idanyOf (2 variants)Owned research project to create the strategy in. Omit it to create a new project named after the strategy; the response returns its project_id. A clone stays in its source strategy's project: omit project_id or pass that project's ID.timeframeanyOf (2 variants)Candle timeframe for strategy bars. Required for a new strategy; omit when cloning (inherited).