Notify API of order via webhook alert, error report:'code': -1102, 'msg': "Mandatory parameter 'timeinforce' was not sent, was empty/null, or malformed."

51bitquant/binance-tradingview-webhook-bot: A tradingview webhook trading bot for Binance Exchange. (github.com)

I found an open source trading bot on github that can interface with Binance and tradviewing, and I created a post request to send to webhook:
{“action”: “long”,
“symbol”: “BTCUSDT”,
“exchange”: “binance_future”,
“price”:“3001”,
“close”: “3001”,
“passphrase”: “*******”,
“strategy_name”: “BTCUSDT_1h”,
“some other key”: “some other value you need”
}
The system returns after receiving the request:
{‘code’: -1102,
‘msg’: “Mandatory parameter ‘timeinforce’ was not sent, was empty/null, or malformed.”}
The Binance api of this project has initialized the time_inforce parameter in the parameter of the order method, why the error message will indicate that no parameter is sent?
API order method:
def place_order(self, symbol: str, order_side: OrderSide, order_type: OrderType, quantity: Decimal, price: Decimal,
time_inforce=“GTC”, client_order_id=None, recvWindow=5000, stop_price=0):

The error message is from Binance server and is not incorrect. You need to debug what the underlying library is actually sending to the Binance server based on your parameter definitions. Notice that it says “Mandatory parameter ‘timeinforce’ was not sent, was empty/null, or malformed.” .

Since binance-tradingview-webhook-bot is not an official Binance library, you’ll probably receive more support if you reach out to the repository’s community or maintainers to clarify your question (in case you can’t find the reason on your own).

1 Like