Update Deal
Description: Edits an existing deal of DCA Bot using its ID
The endpoint is available for Deal for the statuses bought
and close_strategy_activated
.
Permission: BOTS_READ Security: SIGNED
PATCH
/ver1/deals/{deal_id}/update_deal
Path Parameter
deal_id integer
required
Unique 3Commas ID Deal entity
Body parameters
take_profit number
Percentage value for the bot’s Take Profit.
If multiple steps are specified in take_profit_steps settings
, this parameter should be set to 0
take_profit_steps array[json]
Contains multiple steps with conditions for Taking Profit in this deal
profit_currency string
Profit currency used for calculating the profit from the trades executed by this DCA Bot: quite_currency
or base_currency
take_profit_type string
Take Profit order type for this DCA Bot.
trailing_enabled boolean
Indicates whether trailing is enabled for Take Profit (true
) or not (false
)
sl_to_breakeven_enabled boolean
Enables (true
) or disable (false
) the Move to Breakeven feature for this Deal. To use this feature, you must have at least two Take Profit steps
sl_to_breakeven_data json
The upper limit to which the stop loss will move.
To activate, you need at least two separate targets of Take Profit
Example: {upper_breakeven_limit: 1}
max_safety_orders integer
The maximum total number of Safety Orders allowed for this deal
Minimum: 0
; Maximum: 200
maxactive_safety_orders_count_safety_orders integer
The number of Safety Orders is allowed to place in advance on the exchange's order book
stop_loss_percentage number
The percentage by which the price needs to move in the opposite direction of your Take Profit target to trigger the Stop Loss, at which point the bot will execute a Market Order.
stop_loss_timeout_enabled boolean
Indicates whether the Stop Loss timeout is enabled (true
) or disabled (false
)
stop_loss_timeout_in_seconds integer
Value timeout in seconds
This parameter is required when stop_loss_timeout_enabled
is set to true
tsl_enabled boolean
Indicates whether trailing is enabled (true
) for Stop Loss or not (false
)
stop_loss_type string
The type of action the bot should perform after closing a deal due to the Stop Loss setting: stop_loss
or stop_loss_and_disable_bot
close_timeout integer
The time in seconds after which this deal will close automatically
Minimum: 60
note string
Optional user-defined note for this Deal
min_profit_percentage number
The minimum profit percentage which need to reach for this DCA Bot to complete a deal
Additional Information
Take Profit steps
You should allocate 100% of your position volume across different targets. In total, the maximum number of targets is 4.
One target is one step. Each step is represented as an object with properties:
id
amount_percentage
profit_percentage
Below is an example demonstrating how to fill this parameter with several steps of Take Profit:
[
{
"id": 1,
"amount_percentage": 10,
"profit_percentage": 10
},
{
"id": 2,
"amount_percentage": 20,
"profit_percentage": 15
},
{
"id": 3,
"amount_percentage": 30,
"profit_percentage": 20
},
{
"id": 4,
"amount_percentage": 40,
"profit_percentage": 23
}
]
Response Parameters
If successful, the response includes an updated copy of Deals entity.
Example Request
PATCH /ver1/deals/1234567890/update_deal
Body:
{
"stop_loss_type": "stop_loss",
"stop_loss_percentage": "4",
"stop_loss_timeout_in_seconds": "100",
"max_safety_orders": 6
}
Example Response and errors
Last updated
Was this helpful?