set_trading_stop
Set take profit, stop loss, and trailing stop parameters for trades on Bybit Server. Specify category, symbol, and optional settings to manage risk and automate trading strategies effectively.
Instructions
Set trading stop
Args:
category (str): Category (spot, linear, inverse, etc.)
symbol (str): Symbol (e.g., BTCUSDT)
takeProfit (Optional[str]): Take profit price
stopLoss (Optional[str]): Stop loss price
trailingStop (Optional[str]): Trailing stop
positionIdx (Optional[int]): Position index
Returns:
Dict: Setting result
Example:
set_trading_stop("spot", "BTCUSDT", "55000", "45000", "1000", 0)
Reference:
https://bybit-exchange.github.io/docs/v5/position/trading-stop
Input Schema
Name | Required | Description | Default |
---|---|---|---|
category | Yes | Category (spot, linear, inverse, etc.) | |
positionIdx | No | Position index | |
stopLoss | No | Stop loss price | |
symbol | Yes | Symbol (e.g., BTCUSDT) | |
takeProfit | No | Take profit price | |
trailingStop | No | Trailing stop |
Input Schema (JSON Schema)
{
"properties": {
"category": {
"description": "Category (spot, linear, inverse, etc.)",
"title": "Category",
"type": "string"
},
"positionIdx": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "Position index",
"title": "Positionidx"
},
"stopLoss": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Stop loss price",
"title": "Stoploss"
},
"symbol": {
"description": "Symbol (e.g., BTCUSDT)",
"title": "Symbol",
"type": "string"
},
"takeProfit": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Take profit price",
"title": "Takeprofit"
},
"trailingStop": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Trailing stop",
"title": "Trailingstop"
}
},
"required": [
"category",
"symbol"
],
"title": "set_trading_stopArguments",
"type": "object"
}