robinhood-unofficial / pyrh

Python Framework to make trades with the unofficial Robinhood API
https://pyrh.readthedocs.io/en/latest/
MIT License
1.78k stars 603 forks source link

live trade stream/feed support #236

Closed wolfinch closed 4 years ago

wolfinch commented 4 years ago

Checklist

Feature Request

Is there a way to get live trade feeds (price, volume movement). This is an important feature for building a realtime bot around the API. I am sure RH will have some kind of websocket interface for this. Can't we leverage it to make the library ? I would be happy to contribute but wanted to understand if there is any prior work or investigation done on that front.

adithyabsk commented 4 years ago

@joshith Not sure what you mean. Do you mean a live streaming interface that continually pings the Robinhood API for ticker updates? That could definitely be implemented but there needs to be more work done in the core API before it is considered.

wolfinch commented 4 years ago

Yes, ticker updates are what I meant. Nope, polling with the APIs for ticker updates would be a bad implementation. Generally these are implemented using websockets, which should allow subscription for different kind of channels. Iike ticker updates, order updates, L2 order book updates etc. Do you know how RH is doing the updates now? I will be surprised if they are not using any stream channels.

This will be an important feature for making a full feature trading bot with RH apis. Sure, I understand there could be more work on core APIs and we should be prioritizing.

So may I know how are you getting ticker/order/candle updates right now? Are you using any other API/SDK for this or just not using any realtime data ?

On Mon, Apr 27, 2020 at 7:43 PM Adithya Balaji notifications@github.com wrote:

@joshith https://github.com/joshith Not sure what you mean. Do you mean a live streaming interface that continually pings the Robinhood API for ticker updates? That could definitely be implemented but there needs to be more work done in the core API before it is considered.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/robinhood-unofficial/pyrh/issues/236#issuecomment-620343994, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZSILXBS56U4TVSHHF2DC3ROY7EZANCNFSM4MRMPIRA .

-- -joe-

adithyabsk commented 4 years ago

This will be an important feature for making a full feature trading bot with RH apis.

Unfortunately, I'm not sure here. Additionally, I'm not sure Robinhood's mission supports high-frequency trading either way and there are plenty of brokers out there with better platforms for that end. Regardless, I'll try to dig into it when I get a chance, thanks for bringing it to my attention.

wolfinch commented 4 years ago

Sure. the intention here is definitely not about a high frequency trading platform. For which RH is definitely not suitable. But the idea is to analyze the market data and make trading decisions automatically.

The RH app and web interface's charting features are using realtime trading data. So this is available from the platform. We just have to find the interfaces and figure out the way to use them. I will also try to dig in to that if time permits. Can you tell me how are you finding the RH APIs? is there any concrete method you are following or just snooping the APIs the hard way ?

Thanks

On Mon, Apr 27, 2020 at 10:18 PM Adithya Balaji notifications@github.com wrote:

This will be an important feature for making a full feature trading bot with RH apis.

Unfortunately, I'm not sure here. Additionally, I'm not sure Robinhood's mission supports high-frequency trading either way and there are plenty of brokers out there with better platforms for that end. Regardless, I'll try to dig into it when I get a chance, thanks for bringing it to my attention.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/robinhood-unofficial/pyrh/issues/236#issuecomment-620386620, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZSILTKF7FE3RRJBEFPYK3ROZRKLANCNFSM4MRMPIRA .

-- -joe-

adithyabsk commented 4 years ago

Can you tell me how are you finding the RH APIs? is there any concrete method you are following or just snooping the APIs the hard way?

The hard way, indeed.

wolfinch commented 4 years ago

thanks !!

So, I went ahead and looked their API flows. So far from what I see, they are polling for all the updates. For the quotes, for the order flow, for everything. This is unbelievable !! The more I look in to the APIs the more I see how amateurish the RH platform is. :-) I mean, for getting the order history of a ticker, they have to get the complete order history and then filter on the client side. c'mon, they got to be better than that. I have experience with many crypto exchanges, even for the least reputed exchanges there have much better designed APIs.

anyway, in a way I can unblock myself with writing some stream interfaces for me and call their polling APIs in the backend. And later when they improve and start doing the right thing, we can move there.

Thanks

On Tue, Apr 28, 2020 at 9:26 PM Adithya Balaji notifications@github.com wrote:

Can you tell me how are you finding the RH APIs? is there any concrete method you are following or just snooping the APIs the hard way?

The hard way, indeed.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/robinhood-unofficial/pyrh/issues/236#issuecomment-620981853, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZSILSNCWY5ENTBI4UK7PLRO6T6DANCNFSM4MRMPIRA .

-- -joe-

adithyabsk commented 4 years ago

@joshith haha no worries, I'll mark this issue as closed for now.