curl --request POST \
--url https://api.kraken.com/0/private/AddStrategy \
--header 'API-Key: <api-key>' \
--header 'API-Sign: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"nonce": 1781169958000,
"symbol": "BTC/USD",
"asset_class": "forex",
"strategy_type": "twap",
"side": "buy",
"volume": "1.5",
"ordertype": "limit",
"price": "67000.0",
"expiretm": "+3600"
}
'{
"error": [],
"result": {
"strategy_id": "ASMBA64-R23M2-J7JRJV"
}
}Add Strategy
Create a new algorithmic strategy. The only supported strategy_type today is twap.
A TWAP executes the total volume evenly between starttm and expiretm, as market or limit child orders. The response returns the strategy_id. Use it with CancelStrategy and QueryStrategies.
Validation rules
- The resolved time horizon (
expiretm−starttm) must be at least 60 seconds. Bothstarttmandexpiretmmust be no more than 30 days from now. expiretmmust be in the future.priceis required whenordertypeislimit, and must be omitted whenordertypeismarket.symbol,volumeandpricefollow the same pair, precision and order minimum rules as Add Order.- xStocks pairs are not supported.
Set validate to true to validate the request without creating or submitting the strategy to the execution engine. The response returns an empty strategy_id. This does not run the creation-time balance check or guarantee that a subsequent creation request will succeed.
API Key Permissions Required: Orders and trades - Create & modify orders
curl --request POST \
--url https://api.kraken.com/0/private/AddStrategy \
--header 'API-Key: <api-key>' \
--header 'API-Sign: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"nonce": 1781169958000,
"symbol": "BTC/USD",
"asset_class": "forex",
"strategy_type": "twap",
"side": "buy",
"volume": "1.5",
"ordertype": "limit",
"price": "67000.0",
"expiretm": "+3600"
}
'{
"error": [],
"result": {
"strategy_id": "ASMBA64-R23M2-J7JRJV"
}
}Authorizations
The "API-Key" header should contain your API key.
Authenticated requests should be signed with the "API-Sign" header, using a signature generated with your private key, nonce, encoded payload, and URI path.
Body
Nonce used in construction of API-Sign header
Strategy type. twap is the only supported value today.
twap Asset pair id or altname, e.g. BTC/USD or XBTUSD.
Standard spot pairs. Tokenized assets and synthetic pairs are not supported for Spot TWAP creation.
forex Direction of the strategy.
buy, sell Total quantity to execute over the strategy horizon, in base currency.
Order type of the child orders:
market= child orders execute at the market pricelimit= child orders are limited byprice
market, limit Strategy end time. Must be in the future, at least 60 seconds after the resolved starttm, and no more than 30 days from now.
+<n>= end<n>seconds from now<n>= unix timestamp (seconds) of the end time
If true, validate the request without creating or submitting the strategy. The response returns an empty strategy_id. The creation-time balance check is not run.
Limit price of the child orders. Required when ordertype is limit. Must be omitted when ordertype is market.
Strategy start time. Defaults to now. Must be no more than 30 days from now.
0= now (default)+<n>= start<n>seconds from now<n>= unix timestamp (seconds) of the start time
Was this page helpful?