Close Position using market order

I want to close an open position but there is some limits.
For example I have an open long position and I want to close it.

If I want to place a short market order it might happen that the position size does not close completely. (ex : the position size is 100 USDT and its changing every second but the new short market order quantity is 90 USDT or 120 USDT )

If I want to place a Stop Market or Take Profit Market , in some cases it happens that price has a pump in seconds so , if I try to put stop or take profit order I get this error “Order would trigger immediately”.

What should I do?

The quantity is determined by the amount of base asset (crypto) not the quote asset (usdt). So if you have x number of BTC in a long position. You just have to close it with X number of BTC with short.