binance-trader icon indicating copy to clipboard operation
binance-trader copied to clipboard

Timestamp for this request was 1000ms ahead of the server's time.

Open hellsayenci opened this issue 7 years ago • 10 comments

I am running your code via docker on my mac. When bot decides to buy there is an error that says Unable to perform ticker and an exception like the issue title. How can I fix this?

Thanks

hellsayenci avatar Jan 09 '18 11:01 hellsayenci

Same error here.

rickdeaconx avatar Jan 10 '18 00:01 rickdeaconx

+1

det-peralta avatar Jan 11 '18 11:01 det-peralta

+2

VasTShadowZz avatar Jan 11 '18 21:01 VasTShadowZz

docker run --rm --privileged alpine hwclock -s

fixes this

rickdeaconx avatar Jan 11 '18 21:01 rickdeaconx

To anyone having this issue...

Control Panel Time & Date Internet Time Change Settings Check Synchronize with an Internet time server Type pool.ntp.org into the server Update Now Your Welcome c:

VasTShadowZz avatar Jan 11 '18 21:01 VasTShadowZz

Thanks but there is still an 1 hour difference between the docker time and machine time

stevengehner avatar Jan 15 '18 13:01 stevengehner

Here is an example stacktrace:

2018-01-20 19:05:08.132 INFO 17 --- [pool-1-thread-1] io.github.unterstein.BinanceTrader : nothing bought, let`s check 2018-01-20 19:05:08.132 INFO 17 --- [pool-1-thread-1] io.github.unterstein.BinanceTrader : Buy detected 2018-01-20 19:05:08.133 INFO 17 --- [pool-1-thread-1] io.github.unterstein.TradingClient : Buying 1 for 0.00820201

2018-01-20 19:05:08.487 ERROR 17 --- [pool-1-thread-1] io.github.unterstein.BinanceTrader : Unable to perform ticker

com.binance.api.client.exception.BinanceApiException: Timestamp for this request was 1000ms ahead of the server's time. at com.binance.api.client.impl.BinanceApiServiceGenerator.executeSync(BinanceApiServiceGenerator.java:57) ~[binance-api-client-1.0.0.jar!/:na] at com.binance.api.client.impl.BinanceApiRestClientImpl.newOrder(BinanceApiRestClientImpl.java:103) ~[binance-api-client-1.0.0.jar!/:na] at io.github.unterstein.TradingClient.buy(TradingClient.java:66) ~[classes!/:0.0.1-SNAPSHOT] at io.github.unterstein.BinanceTrader.tick(BinanceTrader.java:55) ~[classes!/:0.0.1-SNAPSHOT] at io.github.unterstein.BinanceBotApplication.schedule(BinanceBotApplication.java:53) [classes!/:0.0.1-SNAPSHOT] at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source) ~[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_151] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_151] at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65) [spring-context-4.3.5.RELEASE.jar!/:4.3.5.RELEASE] at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) [spring-context-4.3.5.RELEASE.jar!/:4.3.5.RELEASE] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_151] at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_151] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_151] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_151] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_151]

mgrapiniak avatar Jan 20 '18 19:01 mgrapiniak

Hi is this fixed? I'm still running into this issue. And @VasTShadowZz suggested solution did not work.

wenyi189 avatar Feb 06 '18 19:02 wenyi189

The problem described here is not an issue with the script, but rather an issue with the end host not being synchronized with ntp.

elysium-12 avatar Feb 07 '18 11:02 elysium-12

Windows has a program called Dimension 4, it synchronizes your clock at regular intervals. it was the only thing I tried that fixed the timestamp error permanently when working with Binance for another project.

TroyHGP avatar Dec 21 '19 20:12 TroyHGP