[X] I have searched the existing issues to ensure there isn't already an issue about this question.
[X] My question has to do with the Python SDK and isn't a general question about the API. (If it is please open your issue here)
[X] My question isn't about how to do a specific algorithm or asking for trade advice (answers to these are outside the scope of this repo).
Question
I use next code to get symbol's latest price, but it has a large gap with alpaca web trade dashboard.
How can I get latest price same as alpaca web trade dashboard ?
req = StockLatestQuoteRequest(symbol_or_symbols=symbol)
res = stock_historical_data_client.get_stock_latest_quote(req)
data = res[symbol]
print(data)
return (data.ask_price + data.bid_price) / 2.0
@seedpower You need to have a market data subscription to query the latest SIP quote. Without the subscription get_stock_latest_quote returns the latest IEX quote.
Question form pre-submit checklist.
Question
I use next code to get symbol's latest price, but it has a large gap with alpaca web trade dashboard. How can I get latest price same as alpaca web trade dashboard ?