Skip to main content

Edit SmartTrade

PATCH
/v2/smart_trades/:id
Permission: SMART_TRADES_WRITE
Security: SIGNED

Updates a existing SmartTrade in place using its ID.

Update SmartTrade is available for SmartTrade with status: waiting_position and waiting_targets.


Path Parameter

idintegerrequired

Unique 3Commas ID for this SmartTrade entity.

Body Parameters

leverageobject

Details of the Leverage applied to this SmartTrade.

Hide child parametersShow child parameters
enabledbooleanrequired

Enables leverage settings for this SmartTrade. Set to true to activate the parameter group.

default: false
typestring

Leverage type for the futures account: cros or isolated.

valueinteger

Cross or isolated leverage value. Leverage value is dependent on the exchange. It should be based on the rules of the exchange regarding currency rates, limits, and leverage data.

positionobject

Settings of the position applied to this SmartTrade.

Hide child parametersShow child parameters
unitsobject

Details of the units applied to this SmartTrade.

Hide child parametersShow child parameters
valuenumber

The amount of units for the position trade.

It should be based on the rules of the exchange regarding currency rates, limits, and leverage data.

priceobject

Details of the price applied to this SmartTrade

Hide child parametersShow child parameters
valuenumber

The price of the position order.

It should be based on the rules of the exchange regarding currency rates, limits, and leverage data.

conditionalobject

Settings of the conditional order applied to this SmartTrade.

Hide child parametersShow child parameters
order_typestring

The type of position trade for this SmartTrade. Possible values: market, limit.

priceobject

Details of Price applied to this SmartTrade.

Hide child parametersShow child parameters
typestring

Defines the price type used as a trigger for the conditional order. Possible values: bid, ask, last.

valuenumber

The conditional trigger price value.

trailingobject

Details of the trailing applied for position trade.

Hide child parametersShow child parameters
enabledboolean

Indicates whether trailing is enabled for the conditional order.

percentnumber

The percentage distance from the market price at which the trailing entry activates.

take_profitobject

Details of Take Profit settings and the steps applied to this SmartTrade.

Hide child parametersShow child parameters
enabledbooleanrequired

Enables Take Profit for this SmartTrade. Set to true to activate the parameter group.

default: false
stepsarray

Detailed information about each Take Profit step.

Hide child parametersShow child parameters
order_typestring

Take Profit order type for this SmartTrade: market or limit.

This parameter is required when take_profit[enabled] is set to true.

volumenumber

Take Profit order volume.

This parameter is required when take_profit[enabled] is set to true

priceobject

Settings for the price of Take Profit.

Hide child parametersShow child parameters
typestring

Type of price for Take Profit: bid, ask, or last.

valuenumber

Specific price value for Take Profit. Applied only if position has no trailing or trailing is finished.

percentnumber

Percentage-based price level for Take Profit. Applies only if position has no trailing or position trailing is finished.

trailingobject

Trailing settings for the last Take Profit step.

Hide child parametersShow child parameters
enabledboolean

Enables trailing for the last Take Profit step. Applies only to the last step of Take Profit.

default: false
percentnumber

Trailing percentage for Take Profit order. This parameter is required when take_profit[steps][trailing][enabled] is set to true.

min: 0,01
max: 100
stop_lossobject

Details of Stop Loss settings applied to this SmartTrade.

Hide child parametersShow child parameters
enabledbooleanrequired

Enables Stop Loss for this SmartTrade. Set to true to activate the parameter group.

default: false
breakevenboolean

Enables the move to Breakeven feature for this SmartTrade. To use this feature, you must have at least two Take Profit steps.

default: false
order_typestringrequired

Stop Loss type for this SmartTrade: market or limit. This parameter is required when stop_loss[enabled] is set to true.

priceobject

Details of the Stop Loss price value configuration.

Hide child parametersShow child parameters
valuenumber

The price of the Stop Loss trade.

conditionalobject

Detailed information about conditional Stop Loss order.

Hide child parametersShow child parameters
priceobject

Details of the price configuration for a conditional Stop Loss order.

Hide child parametersShow child parameters
typestring

The type of price for the stop loss order used to close the position: bid, ask, last.

valuenumber

The specific price value set to trigger the Stop Loss order.

percentnumber

Represents a percentage-based Stop Loss condition used when the position has an active trailing that has not yet completed.

trailingobject

Details of the trailing configuration for conditional Stop Loss order.

Hide child parametersShow child parameters
enabledboolean

Enables trailing for a conditional Stop Loss order.

timeoutobject

Details of the timeout configuration.

Hide child parametersShow child parameters
enabledboolean

Indicates whether the timeout setting for the stop loss is enabled.

valueinteger

The timeout duration for the Stop Loss order, in seconds.

Example Request

PATCH
/v2/smart_trades/12345678
{
"position": {
"type": "buy",
"units": {
"value": "34.0"
},
"price": {
"value": "0.00000442"
}
},
"take_profit": {
"enabled": true,
"steps": [
{
"id": 1225026814,
"order_type": "limit",
"units": {
"value": "34.0"
},
"price": {
"type": "last",
"value": "0.00000508"
},
"volume": "100.0",
"total": "0.00017272",
"trailing": {
"enabled": false
}
}
]
},
"stop_loss": {
"enabled": true,
"order_type": "market",
"conditional": {
"price": {
"type": "last",
"value": "0.00000280"
},
"trailing": {
"enabled": false
}
}
}
}

Response Parameters

If successful, the response includes an updated copy of SmartTrade entity.

Example Responses

{
"id": 32037964,
"version": 2,
"account": {
"id": 32199203,
"type": "paper_trading",
"name": "Paper Account 1251857",
"market": "Binance Spot account simulator",
"link": "/accounts/32199203"
},
"pair": "BTC_1INCH",
"instant": false,
"status": {
"type": "waiting_targets",
"basic_type": "waiting_targets",
"title": "Waiting Targets"
},
"leverage": {
"enabled": false
},
"position": {
"type": "buy",
"editable": false,
"units": {
"value": "34.0",
"editable": false
},
"price": {
"value": "0.00000442",
"value_without_commission": "0.00000442",
"editable": false
},
"total": {
"value": "0.00015043"
},
"order_type": "limit",
"status": {
"type": "finished",
"basic_type": "finished",
"title": "Finished"
}
},
"take_profit": {
"enabled": true,
"price_type": "value",
"steps": [
{
"id": 1317007688,
"order_type": "limit",
"editable": true,
"units": {
"value": null
},
"price": {
"type": "last",
"value": "0.00000508",
"percent": null
},
"volume": "100.0",
"total": null,
"trailing": {
"enabled": false,
"percent": null
},
"status": {
"type": "idle",
"basic_type": "idle",
"title": "Pending"
},
"closed_at": null,
"data": {
"cancelable": true,
"panic_sell_available": false
},
"position": 1
}
]
},
"stop_loss": {
"enabled": true,
"price_type": "value",
"breakeven": false,
"order_type": "market",
"editable": true,
"status": {
"type": "idle",
"basic_type": "idle",
"title": "Pending"
},
"units": {
"value": null
},
"total": {
"value": null
},
"price": {
"value": null,
"percent": null
},
"closed_at": null,
"conditional": {
"price": {
"value": "0.0000028",
"type": "last",
"percent": null
},
"trailing": {
"enabled": false,
"percent": null
}
},
"timeout": {
"enabled": false,
"value": null
}
},
"reduce_funds": {
"steps": []
},
"market_close": {},
"note": "",
"note_raw": null,
"skip_enter_step": false,
"data": {
"editable": true,
"current_price": {
"day_change_percent": "1.799",
"bid": "0.00000283",
"ask": "0.00000284",
"last": "0.00000283",
"quote_volume": "0.19732848"
},
"target_price_type": "price",
"orderbook_price_currency": "BTC",
"base_order_finished": true,
"missing_funds_to_close": "0.0",
"liquidation_price": null,
"average_enter_price": "0.00000442",
"average_close_price": null,
"average_enter_price_without_commission": "0.00000442",
"average_close_price_without_commission": null,
"panic_sell_available": true,
"add_funds_available": true,
"reduce_funds_available": true,
"force_start_available": false,
"force_process_available": true,
"cancel_available": true,
"finished": false,
"base_position_step_finished": true,
"entered_amount": "34.0",
"entered_total": "0.00015043028",
"closed_amount": "0.0",
"closed_total": "0.0",
"commission": 0.001,
"created_at": "2024-12-17T16:08:51.237Z",
"updated_at": "2025-02-13T18:12:44.122Z",
"type": "smart_trade"
},
"profit": {
"volume": "-0.0000543065",
"usd": "-5.188117714065",
"percent": "-36.1",
"roe": null
},
"margin": {
"amount": null,
"total": null
},
"is_position_not_filled": false
}