Petersoj / alpaca-java

A Java API for Alpaca, the commission free, algo friendly, stock trading broker. https://alpaca.markets
https://petersoj.github.io/alpaca-java/
MIT License
197 stars 82 forks source link

StreamSocket issue #62

Closed louisphilippe2 closed 3 years ago

louisphilippe2 commented 4 years ago

Hi,

Perhaps this is not a software issue but i swear i cannot see how i could add a stream listener for watching the price of stocks. I know it's possible to do it since it's documented on the official API but could not find how here. Is it even implemented?

Thank you

mainstringargs commented 4 years ago

Have you looked at the addPolygonStreamListener in PolygonAPI? Is that what you're looking for or do you mean something else?

louisphilippe2 commented 4 years ago

Hi,

I am reffering to this: https://alpaca.markets/docs/api-documentation/api-v2/market-data/streaming/

I don't have a live trading account. I'm essentially just trying to do paper trading and i was hoping i could websocket the quotes for a trade or two using the Alpaca Data API. I cannot use polygon services.

mainstringargs commented 4 years ago

Ah. that is brand new from Alpaca, so we have yet to implement it.

Petersoj commented 4 years ago

I’ll be done with that PR this weekend hopefully. For now, using the Polygon API is the same thing, since the Alpaca Data Streaming API is just relaying the data from Polygon Feed.

louisphilippe2 commented 4 years ago

From what i gathered in your code, you could make another listen/unlisten enum for the stream message types and let us add the stock symbols from there. If i understand correctly, the websocket should be able to handle it.

Petersoj commented 4 years ago

PR is taking me a little longer than I thought. I only have weekends to work on it.

louisphilippe2 commented 4 years ago

Hello Petersoj, do you have an update on the project? Thank you!

Petersoj commented 4 years ago

@louisphilippe2 See my comment on the other PR about this issue here. I started working on this PR, but then my summer job started to take priority. Feel free to contribute via the instructions in the aforementioned link.

Petersoj commented 3 years ago

The WIP PR for this is now available here. Should be done soon.

Petersoj commented 3 years ago

71 is now completed and will be integrated sometime this week which adds functionality for the new market data API.