tiagosiebler/bybit-api

Question: Is there a way to change the take_profit and stop_loss on an already open position?

SwftAlpc opened this issue · 2 comments

I tried the following, but it did not work.
Let me know if you need more information.

    return await this.bybit.submitOrder({
      category: 'linear',
      orderType: 'Market',
      symbol: SYMBOL,
      side: body.side,
      qty: '0',
      takeProfit: body.take_profit,
      stopLoss: body.stop_loss,
    });

I believe you can just use the AmendOrder - I can share later when I am back at the pc

ralvs commented

I'm using this

      client.setTradingStop({
        category: 'linear',
        symbol: m.symbol,
        stopLoss: stop, // '0' = clear | NaN = to ignore
        takeProfit: take, // '0' = clear | NaN = to ignore
        positionIdx: 0, // one-way mode
      })