binance-exchange / binance-java-api

binance-java-api is a lightweight Java library for the Binance API, supporting synchronous and asynchronous requests, as well as event streaming using WebSockets.
MIT License
831 stars 628 forks source link

issue with getCandlestickBars #366

Open Najeisleem opened 3 years ago

Najeisleem commented 3 years ago

I'm calling the API with start and end time but its return wrong data, I have test Binance API directly, and its working fine

tonyradz commented 3 years ago

problem is because of Jackson @JsonPropertyOrder(alphabetic = false) is not working on new lib versions when getting candle data. Fields are ordered alphabetically

Najeisleem commented 3 years ago

so I must call it directly from Binance not throw this library, right?

tonyradz commented 3 years ago

Well I am doing manual mapping after extending library:


   openTime = params[0].toLong(),
        open = params[1].toBigDecimal(),
        high = params[2].toBigDecimal(),
        low = params[3].toBigDecimal(),
        close = params[4].toBigDecimal(),
        volume = params[5].toBigDecimal(),
        closeTime = params[6].toLong(),
        quoteAssetVolume = params[7].toBigDecimal(),
        numberOfTrades = params[8].toLong(),
        takerBuyBaseAssetVolume = params[9].toBigDecimal(),
        takerBuyQuoteAssetVolume = params[10].toBigDecimal()

Took half a day to figure out what is what :D

Najeisleem commented 3 years ago

:D thanks alot man

antanas-radzevicius-tg commented 3 years ago

No problem 😉