When the exchange.IO API is called, the error message {"code": -2021, "msg": "Order would immediately trigger. "} is generated, but the exchange.Buy ((-1, quantity) is not.

Author: The wind shadow 1124, Created: 2023-10-05 16:48:10, Updated: 2023-10-08 11:40:34

1、调用币安API接口:
var message = "symbol=ETHUSDT&side=BUY&positionSide=SHORT&type=TAKE_PROFIT_MARKET&closePosition=true&stopPrice="+ticker.Last+"&timestamp=" + Date.now();

var orderInfos = exchange.IO("api", "POST", "/fapi/v1/order", message);

报错信息:“{"code": -2021, "msg": "Order would immediately trigger."}”

2、直接用FMZ的exchange.Buy(-1,quantity),就不会报错。

More

The Little DreamIt seems that the code is not quite right: What's up? var message = "symbol=" + "ETHUSDT" + "& side=BUY" + orderid +"& positionSide=SHORT" +&type="+"TAKE_PROFIT_MARKET"+"closePosition=true"+"&stopPrice="+ticker.Last+"×tamp="+Date.now(); What's up? In this case, ``ordid `` has no parameter name, only one value. ```closePosition `` has less `` and `` symbols. I recommend checking again.

The Little DreamOrder would immediately trigger. This error is returned by the exchange interface, which literally means that the parameters should be set incorrectly, which will result in the order being settled directly.

The wind shadow 1124When the market price reaches the calculated stop loss price, Exchange.IO calls the TAKE_PROFIT_MARKET type to stop the market price, and reports: Order would immediately trigger. But the FMZ API can be used to make transactions immediately, without any errors, as follows: exchange.SetDirection (("closebuy"); exchange.Sell ((-1, quantity);

The Little DreamThe exchange.IO calls do not need to pass on parameters for participatory signatures such as timestamps. See specific error messages.

The wind shadow 1124This is the latest update. This is a list of all the different ways ETHUSDT is credited in the database.