sammchardy / python-binance

Binance Exchange API python implementation for automated trading
https://python-binance.readthedocs.io/en/latest/
MIT License
5.98k stars 2.2k forks source link

Signature for this request is not valid #1185

Open Pouya10 opened 2 years ago

Pouya10 commented 2 years ago

Hello, I use these codes: (python)

client.futures_cancel_orders(symbol="BTCUSDT", orderIdList=["53666506695"]) Or client.futures_cancel_orders(symbol="BTCUSDT", orderIdList=[53666506695])

But it gives an error: binance.exceptions.BinanceAPIException: APIError(code=-1022): Signature for this request is not valid.

gtellezgiron commented 2 years ago

I have a similar problem. Please help!!! I get the same error when sending the order from a Heroku server as a response from a webhook triggered in Tradingview.

                    order = client_Binance.futures_create_order(
                        symbol="BTCUSDT",
                        side="BUY",
                        type="LIMIT",
                        timeInForce="GTC",
                        quantity="0.029",
                        price="28000.0",
                        recvWindow=6000000,
                        newClientOrderId = "LongTrd 1C5BTC2L",
                        timestamp = 1653043804435
                    )

However, if I send the webhook from my Mac (to the Heroku server) I do not get the same error.

It only occurs when the Heroku server tries to place the order in Binance as a result of a webhook coming from Tradingview and not my local Mac.

arsh-charlesriver commented 1 year ago

I also get that error using almost identical python code. Weirdly enough - I use the same method for placing all my limit orders and it works fine for some, but doesn't work for others. What could be the reason?