Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Candles in websockets? #595

Closed
jdx-john opened this issue Jun 1, 2021 · 3 comments · Fixed by #600
Closed

Candles in websockets? #595

jdx-john opened this issue Jun 1, 2021 · 3 comments · Fixed by #600

Comments

@jdx-john
Copy link
Contributor

jdx-john commented Jun 1, 2021

I notice that Kraken's WS API provides ohlc but as far as I can see ExchangeSharp only exposes the REST version.
Is this a deliberate design or perhaps it's not seen as useful?
I wouldn't be surprised if there's already a utility class which will generate candles from the raw trades feed... I keep starting to write things then stumbling across existing implementations!

@vslee
Copy link
Collaborator

vslee commented Jun 1, 2021

Streaming tickers is implemented in ExchangeSharp for many exchanges but not Kraken. If you'd like you submit an implementation as a Pull Request, we'd be happy to merge it!

@jdx-john
Copy link
Contributor Author

jdx-john commented Jun 1, 2021

@vslee I'm not referring to tickers, but to OHLC candles.

I thought that WS functionality for Kraken is supported, e.g. OnGetTickersWebSocketAsync / OnGetTradesWebSocketAsync in ExchangeKrakenAPI?

But my question is that in IExchangeAPI, there is no signature defined at all for streaming OHLC data. Perhaps KRaken is the only exchange who added this (https://docs.kraken.com/websockets/#message-ohlc) or maybe everyone builds their own candles from raw trades data so it's not considered important?

So to submit a PR I would need to add a new API method on the interface and presumably dummy versions for every other exchange, as well as doing the implementation?

@vslee
Copy link
Collaborator

vslee commented Jun 1, 2021

I see what you're saying, ExchangeSharp only had REST support for Candles, but not Websocket support. I just made a PR which adds Websocket support for candles. After my PR is merged, you can then add OHLC support to Kraken by overriding the OnGetCandlesWebSocketAsync() method in ExchangeKrakenAPI.cs.

vslee added a commit that referenced this issue Jun 5, 2021
* Add Candles (OHLC) websocket support in ExchangeAPI

- part of #595

* changed GetCandlesWebSocketAsync() to allow for async callback
@vslee vslee linked a pull request Jun 16, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants