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

stream: Add support for the real-time News beta API #64

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dgoulet
Copy link
Contributor

@dgoulet dgoulet commented Aug 15, 2023

Here is an attempt at supporting the beta News real time feed detailed here: https://alpaca.markets/docs/api-references/market-data-api/news-data/realtime/

It is quite straight forward as you'll see following how Quotes and Bars are streamed.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Copy link
Owner

@d-e-s-o d-e-s-o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change seems fine, but apca does not expose anything labeled "beta", as it could break/vanish any time. That's why the news request bindings changes (https://github.com/d-e-s-o/apca/tree/topic/news) have been sitting around for forever.

I am afraid I don't have a good suggestion on how to move forward off hand. Perhaps we could introduce an unstable feature flag, but I suspect this would only help with the above, but couldn't be nicely made to work with the change at hand, because of the modification of the Data enum with a new generic argument. It would be great if you were to inquire with Alpaca when they intend to stabilize their stuff. I'd be interested to hear what what seems to be an indefinite beta period buys them.

src/data/v2/stream.rs Outdated Show resolved Hide resolved
/// .subscribe::<RealtimeData<NewsFeed>>()
/// .await
/// .unwrap();
/// # })
Copy link
Owner

@d-e-s-o d-e-s-o Aug 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no opening parenthesis/brace? I don't think that example can compile.

Co-authored-by: Daniel Müller <d-e-s-o@users.noreply.github.com>
@dgoulet
Copy link
Contributor Author

dgoulet commented Aug 16, 2023

Ah! I didn't know about your news branch there... Good to know that you have it basically all implemented hehe! I guess you can drop this PR now.

But, yeah I think having a beta flag with no guarantee that between apca release it will be stable or even stay the same could be useful. It would allow at least to use "infinite beta" features from Alpaca that are still useful to use.

I can try to ask them on their Slack but I bet I'll get an answer looking like: "We hope to make this stable soon" ;)

@d-e-s-o
Copy link
Owner

d-e-s-o commented Aug 18, 2023

Ah! I didn't know about your news branch there... Good to know that you have it basically all implemented hehe! I guess you can drop this PR now.

I think it covers a different set of stuff than what you added: it's about the request interface, not the streaming support. So I'd say both complement each other. I should probably create a draft PR for improved visibility.

I can try to ask them on their Slack but I bet I'll get an answer looking like: "We hope to make this stable soon" ;)

Probably :-( Let us know if you know something.

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 this pull request may close these issues.

2 participants