CLIENT.get_my_trades(symbol="BNBETH", recvWindow=100000)
CLIENT.get_my_trades(symbol="BNBETH")
Both give the same error. The strange thing is that I don't get this error with get_aggregate_trades function, only with get_my_trades.
I made sure my internet time is synced.
I get the same error sometimes with get_account()
I see the same error. Has anyone solved it?
I found that my computer time is not synced with a proper NTP server therefore I ran into this issue too.
If you are using OSX, can try this tutorial: https://grok.lsu.edu/article.aspx?articleid=8102 and set the NTP server to the correct NTP server on http://www.pool.ntp.org/zone/us (US for example).
Otherwise, a dirty hack is to "minus" the calculate timestamp
int(time.time() * 1000) -
but that is not pretty nor accurate to do...
Unfortunately Binance is strict with the timestamp differences in their API constraints.
This is my solution for timestamps issue.
The code made equal windows time to binance server time.
from binance.client import Client
client = Client('api_key', 'api_secret')
import time
import win32api
gt = client.get_server_time()
aa = str(gt)
bb = aa.replace("{'serverTime': ","")
aa = bb.replace("}","")
gg=int(aa)
ff=gg-10799260
uu=ff/1000
yy=int(uu)
tt=time.localtime(yy)
win32api.SetSystemTime(tt[0],tt[1],0,tt[2],tt[3],tt[4],tt[5],0)
"The integer 10799260 for adjusting time zone and fine tuning for miliseconds."
The solution from nadirdogan works for me too. I improved/condensed his code a bit
from binance.client import Client
client = Client('api_key', 'api_secret')
import time
import win32api
gt = client.get_server_time()
tt=time.gmtime(int((gt["serverTime"])/1000))
win32api.SetSystemTime(tt[0],tt[1],0,tt[2],tt[3],tt[4],tt[5],0)
Hi @MarcelBeining, I'm glad to see you like my solution :)
from control panel > date and time > internet time
change the server to >>>> time.nist.gov
it worked with me
nbjkl;
from control panel > date and time > internet time
change the server to >>>> time.nist.gov
it worked with me
This works for me on win10, make sure you set control panel icons to small or you may have a hard time finding the internet time setting.
from control panel > date and time > internet time
change the server to >>>> time.nist.gov
it worked with me
You can go to date and time settings(Change the date and time). Then press sync now.
(default) time.windows.com is working for me.
Most helpful comment
from control panel > date and time > internet time
change the server to >>>> time.nist.gov
it worked with me