Hi,
this indicates a server communication issue.
when did you experience that? during market open hours or outside of market hours?
did it happen again?
what repository are you using? (backtrader, pylivetrader, direct alpaca-trade-api)
what happened when you restarted?
I get it all day long. Even if I stop and wait 10 seconds. It’s annoying and it makes me lose money. There is no way I can run my script on auto because this error requires me to manually set up sells. The buys may post but once this error comes, I am screwed. Let me ask you, is this due to the web socket? Like the OP I have more than two stocks that I am following and trading at one time. Will using AL for ordering and Poly (paid plan) for data and the web socket connect spare me of this error code?
Hi,
you have 2 choices for websocket connection as you mantioned (Alpaca data stream and Polygon data stream for paid accounts). of course - try both if you encounter an issue with the alpaca data steam.
no matter what you choose, your orders will be with Alpaca.
are you using python? if not what is your stack?
are you using the python SDK or doing it directly against the API servers?
are you using the backtrader integration or pylivetrader or did you write your own manager?
@GreenCauliflower and @TBD - I got this message too, and I can confirm it’s because I was making too many API calls per second. In Python, I now have a
time.sleep(0.5)
after every API call, so the script basically pauses for half a second (which is conservative since we’re allowed to make about 3 calls per second) before making another call. Hope that helps.
Polygon - I noticed it does not like me to run 3 or more scripts. If I do I get the error regardless of whether or not its buying or selling. I was able to confirm this today because I finally used IOC. My script gets every last tick in almost real time. No errors on two running.
Yes, Python.
API
Manager that uses AL API and Backtrader.
The problem is it does not like me to run more than 3 scripts at a time. Basically I can only follow two symbols or have two strategies. It sucks big time. I realized I need more than one account. Also, it doesn’t see to like “Day” and “Extending.” The minute I switched to ICO with Extended off (no choice), I was making big moves. LOL It worked how the paper account worked, super fast.
I was using a modified version of the Scalping Algorithm in one of the Alpaca articles and code pulled directly from the AlpacaMarkets GitHub.
I figured out in order to get the scalping code to work I had change my Market Data Subscription plan from Free to Unlimited. Which seems counterintuitive to the concept of a paper account, let alone attempting code that Alpaca puts out itself for users to “try”.
Hope this helps someone avoid some head banging against the wall.
I am just starting with Alpaca, trying the recipies I find in GitHub using the paper account, unfortunatelly many of the recipies are broken (needs debugging).
For this one in aprticular, I get the following 10 seconds after starting and it goes forever