You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't seem to be able to get the stream to work. i am correctly instantiating DataStreamClient with valid keys from live import.
fromdotenvimportdotenv_valuesfromalpaca.data.enumsimportDataFeedfromalpaca.data.liveimportStockDataStream# Load environment variables from .env fileconfig=dotenv_values(".env")
API_KEY=config['APCA_API_KEY_ID']
SECRET_KEY=config['APCA_API_SECRET_KEY']
# Instantiate the StockDataStreamstream=StockDataStream(
api_key=API_KEY,
secret_key=SECRET_KEY,
feed=DataFeed.IEX, # or DataFeed.SIP if you have access
)
print(stream)
# Define your callback function to handle incoming dataasyncdefhandle_bar(bar):
# Process the bar data (this is just a placeholder, adjust according to your data structure)print(bar)
# Subscribe to live updates for a symbol, e.g., "AAPL"stream.subscribe_bars(handle_bar, "AAPL")
# Start streamingstream.run()
Expected Behavior
Expecting candles to come through, but only seeing:
<alpaca.data.live.stock.StockDataStream object at 0x11939f0b0> which is the print from instantiating client.
I have entered valid steps to reproduce my issue or have attached a minimally reproducible case in code that shows my issue happening; and understand that without this my issue will be flagged as invalid and closed after 30 days.
Anything else?
thats it.
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Current Behavior
I don't seem to be able to get the stream to work. i am correctly instantiating DataStreamClient with valid keys from live import.
Expected Behavior
Expecting candles to come through, but only seeing:
<alpaca.data.live.stock.StockDataStream object at 0x11939f0b0>
which is the print from instantiating client.SDK Version I encountered this issue in
Steps To Reproduce
Filled out the Steps to Reproduce section?
Anything else?
thats it.
The text was updated successfully, but these errors were encountered: