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

API limits reached when using AlpacaBroker #78

Open
ningsuhen opened this issue May 31, 2024 · 1 comment
Open

API limits reached when using AlpacaBroker #78

ningsuhen opened this issue May 31, 2024 · 1 comment

Comments

@ningsuhen
Copy link

Hi,

I noticed this in version 2.2.0 and not sure if this is resolved in the upcoming release 3.0.0 but it seems like the Broker.sync() is called for each event and when using AlpacaLiveFeed with subscription to Trades, it makes too many calls to the broker.sync(). Because of this, it hits the API limits. I've tried upgrading the Alpaca account but it doesn't have increased limits for account API calls.

Is this a known issue? If not, any way to fix this?

Thanks

@jbaron
Copy link
Collaborator

jbaron commented May 31, 2024

This can happen if you use high frequency data (like live quotes) and are not allowed too many API calls (I believe for Alpaca that also depends on the type of account you have). For Bar data (even 1 second bars) I didn't witness it yet.

Some other broker implementations throttle the sync, so it is not calling the real broker API's too often. This logic can also be added to the AlpacaBroker (or perhaps have all live Brokers inherit from an abstract class that takes care of this). Will put it on the back log.

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

No branches or pull requests

2 participants