Relative Content

Tag Archive for pythonlistalpaca

How to comprehend and collect a value from a complex list using the Alpaca API?

request_close = StockLatestTradeRequest(symbol_or_symbols = “TSLA”, start = datetime.now(), timeframe = TimeFrame.Minute, limit = 1) price = [{x[‘p’]} for x in data_client.get_stock_latest_trade(request_close)[“TSLA”]][0].pop() print(price) Im trying to use a different method in the alpaca API as seen above but it doesn’t work because the output is different. How am I supposed to format it? I tried doing […]