knowm / XChange

XChange is a Java library providing a streamlined API for interacting with 60+ Bitcoin and Altcoin exchanges providing a consistent interface for trading and accessing market data.
http://knowm.org/open-source/xchange/
MIT License
3.87k stars 1.94k forks source link

Binance Klines Websocket #4092

Open sf202020sf opened 3 years ago

sf202020sf commented 3 years ago

Hello,

Is there a way to to get reactive the klines from binance? https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md#klinecandlestick-data In a Websocket and with a method onCandlestickEvent method or somthing similar which must be implemented and can handled reactivly? Do you have an example code for this?

I just find the BinanceMarketDataServiceRaw lastKline method but I have to call this method actively.

Thx

earce commented 3 years ago

Use binance xchange-stream-binance for all websocket data

sf202020sf commented 3 years ago

thx for your answer - do you have a small code example how to get Candlesticks/Klines for defined timeframes? I just can find examples for trades and Account Data but the Klines method is not included in streams.

earce commented 3 years ago

klines may not have been implemented by anyone, if that is the case you may need to yourself

sf202020sf commented 3 years ago

ok thanks for your answer - has anybody tried this here in this community? Would be great if you can help me - from my perspective there are not libs for java an github in order to get klines....