Reputation: 11
I want to set a trailing stop loss for my "LONG" position. For example; Can you show me how to make a trailing stoploss on USDT-M so that when the last price goes 10% above my entry price, it will follow the last price by 5%? Thanks.
I tried to do it by trying the "Set Trading Stop" feature in the Bybit API document, but I was not successful.
Upvotes: 1
Views: 1331
Reputation: 1
This function is working. For Example:
public static void SetTPSL (string symbol, string trailing_stop, string activate_price)
{
var parameters = new Dictionary<string, object>
{
{ "positionIdx", 0 },
{ "symbol", symbol },
{ "trailingStop", trailing_stop },
{ "activePrice", activate_price }
};
var responce = Request.SendRequest("/contract/v3/private/position/trading-stop", HttpMethod.Post, parameters);
}
In this case we placed Trailing stop at 1000 price and 5 point - correction
Upvotes: 0