alpaca-trade-api-python
alpaca-trade-api-python copied to clipboard
Python client for Alpaca's trade API
This stumped me for a while. Hopefully, the comment helps others who want to test with their paper credentials.
If the connection drops and it tries to reconnect, it fails because the channels are saved in self._streams, which is a set, which is not serializable in JSON, so convert...
This fixed an issue I was having where the Alpaca websocket would throw a warning and hang forever. Turns out, it was awaiting on closing the socket even though it...
### Is there an existing issue for this? - [X] I have searched the existing issues ### Current Behavior `import logging import config from alpaca_trade_api.stream import Stream log = logging.getLogger(__name__)...
### Question form pre-submit checklist. - [X] I have searched the existing issues to ensure there isn't already an issue about this question. - [X] My question has to do...
### Question form pre-submit checklist. - [X] I have searched the existing issues to ensure there isn't already an issue about this question. - [X] My question has to do...
### Is there an existing issue for this? - [X] I have searched the existing issues ### Current Behavior When I call api.cancel_all_orders() I check my account from the UI...
### Is there an existing issue for this? - [X] I have searched the existing issues ### Is your feature request related to a problem? Please describe. Yes, there is...
### Is there an existing issue for this? - [X] I have searched the existing issues ### Is your feature request related to a problem? Please describe. "Corporate Actions Announcements"...
return self.api.get_crypto_bars( symbol=self.symbol, timeframe=alpaca_trade_api.TimeFrame.Minute, start=(datetime.datetime.now(tz=datetime.timezone.utc) - datetime.timedelta(minutes=60)).isoformat(), ) The length is 141, but should be 60.