Closed ljubomirb closed 2 years ago
Ok, so I think I've found a way to push WithRecvWindow
option, hope I'm doing it right.
So, order might now look something like this:
order, err := client.NewCreateOrderService().Symbol(symbolpair).
Side(side).Type(binance.OrderTypeMarket).NewClientOrderID(customID).
Quantity(quantity)). //Price(price))
Do(context.Background(), binance.WithRecvWindow(10000)) //10 secs, default is 5
return order, err
Hi @ljubomirb , You are right, RecvWindow
should be passed in Do(ctx, options...)
. Currently there is no global recvWindow since not every API needs it.
It is recommended that you should keep your host time synced with binance server.
Hi, I received this error, but it is not happening every time, and it probably happens when I give order. I only guess, since error did not show up until today, so it's hard for me to find it. But, as for google tells me, it is probably because computer time and binance time are different as explained here The solution binance tells us is that we must sync computer time with binance server, whereas I would like to avoid this. Thus, I've seen that there is a parameter
recvWindow
that can be changed when giving order, as shown in documentation here. I also see you have it in code on a few places, so I guess it is all already here, just I don't know how to use it, or something small is missing. My questions are:recWindow
client
(globally) to haverecWindow
var bigger, and if so, where?Thank you for your time!