This command will open a BTC/USDT position, with base order price set at $42,000. If the order is not completely filled within the expiration time, it will be canceled. If the expiration time is not set, then the default value of 300 seconds will be used.
This command initiates a BTC/USDT position with a base order size that is half of the default size.
position_size specifies the relative size of the position compared to the default settings. It accepts values ranging from 0 to 1, where 1 represents 100% of the default size.
This command will open a BTC/USDT position, with base order price set at $42,000. A market order will be executed if the order is not filled within the expiration time.
Open a position with aggressive limit order control
When opening a position, you have the option to fine-tune how your limit entry order is placed within the market spread. This is particularly useful for executing trades with a level of aggressiveness that matches your trading strategy, while also incorporating safeguards against excessive market spread.
Spread Aggressiveness (spread_aggressiveness): This setting allows you to define the aggressiveness of your limit order placement within the current market spread. A value of 0 aims for the least aggressive placement, targeting the best bid price for buys, which can help in minimizing the cost of entry. A value of 1 targets the most aggressive placement, aiming for the best ask price, which can be beneficial in fast-moving markets where getting the position filled is a priority over the entry cost.
Maximum Deviation from Best Price (max_deviation_from_best_price): To protect against the risk of entering a position at an unfavorable price in markets with a wide spread, this setting limits how far from the best available price your order can be placed. It's defined as a percentage of the best price, ensuring that your order remains within a reasonable range of current market prices.
With the add funds function, you can add more orders to your currently open position. The size is a percentage of the base order size and can be larger than 1 (e.g. if size is 1 and the filled base order of the is 0.001 BTC then the add funds will be of 0.001 BTC).
Add funds to a LONG position
If the base order filled amount is 0.001 BTC, this will open an additional order of 0.002 BTC to the current open BTC/USDT position.
Alternatively, in the case of trading with extremely volatile assets or if your position size is variable, you might prefer to use the argument bo_settings_size that is the relative quote asset value of the BO subscription settings So if the BO size of the subscription is 10 USDT and bo_settings_size is 2, then the add funds order will be 20 USDT.
If you want to add an order identifier, you can add client_id to the request. The client_idis a string of max length 36 that can be used in case you want to cancel specific add funds orders.
You can select up to 10 specific add funds orders to cancel with the argument client_ids
{
"bot_id": "1",
"action": "cancel-all-api-add-funds-orders",
"base_asset": "BTC",
"quote_asset": "USDT",
"api_key": "<API KEY>",
"side": "long",
"client_ids": ["my client order id 1", "my client order id 2"]
}
Cancel add funds orders with client order ids with failure if any client id is not found
In case you want to raise an error when client_ids are not found among the add funds orders, then you can set the argument fail_if_ids_not_found to true.
{
"bot_id": "1",
"action": "cancel-all-api-add-funds-orders",
"base_asset": "BTC",
"quote_asset": "USDT",
"api_key": "<API KEY>",
"side": "long",
"client_ids": ["my client order id 1", "my client order id 2"],
"fail_if_ids_not_found": "true"
}
Remove funds
With the remove funds function, you can remove funds to your currently open position, by partially closing the position. The size can be expressed as a percentage of the base order size, or as a percentage of the total position size.
Remove funds based on base order size
This command will open a sell order of 100% the base order size.
If you want to add an order identifier, you can add client_id to the request. The client_idis a string of max length 36 that can be used in case you want to cancel specific add funds orders.
You can select up to 10 specific remove funds orders to cancel with the argument client_ids
{
"bot_id": "1",
"action": "cancel-all-api-remove-funds-orders",
"base_asset": "BTC",
"quote_asset": "USDT",
"api_key": "<API KEY>",
"side": "long",
"client_ids": ["my client order id 1", "my client order id 2"]
}
Cancel remove funds orders with client order ids with failure if any client id is not found
In case you want to raise an error when client_ids are not found among the remove funds orders, then you can set the argument fail_if_ids_not_found to true.
{
"bot_id": "1",
"action": "cancel-all-api-remove-funds-orders",
"base_asset": "BTC",
"quote_asset": "USDT",
"api_key": "<API KEY>",
"side": "long",
"client_ids": ["my client order id 1", "my client order id 2"],
"fail_if_ids_not_found": "true"
}
Edit Take Profit
This allows you to edit the take profit settings of open positions.
Override deviation
This command will set the take profit of the BTC/USDT position to 5%.
With this command, you'll set the take profit target price to a defined price ($42,000). If a safety order is hit after the take profit is edited, the take profit will be updated based on the position settings (taking the initial take profit deviation).
This command will either open a position if a position for that symbol side is not yet active; otherwise will execute the first available safety order at the mark price. All the arguments to open position can be used with this command
Our webhook allows you to efficiently execute multiple commands in a single operation. This is particularly useful for scenarios where you need to perform several actions in a sequence without initiating multiple requests.
Endpoint
To utilize this feature, send your requests to the following endpoint: