Hello,
I’m building a trading software and I selected Alpaca as broker as I understood this is one of the best option for API trading, however I face a blocking issue, that is price data is far off!
I understand that I can pay 99$ for quality historical quotes via sip feed, but I would still expect some decent data, at least for current market price on the free version.
I’m using the following code (with alpaca-py) to retrieve current market price:
from alpaca.data.historical import StockHistoricalDataClient
from alpaca.data.requests import StockLatestQuoteRequest
# Create data client for market data
data_client = StockHistoricalDataClient(
api_key=self.settings["api_key"],
secret_key=self.settings["api_secret"]
)
# Normalize input to list for uniform processing
is_single_symbol = isinstance(symbol_or_symbols, str)
symbols_list = [symbol_or_symbols] if is_single_symbol else symbol_or_symbols
# Get latest quotes - Alpaca natively supports bulk fetching
request = StockLatestQuoteRequest(symbol_or_symbols=symbols_list)
quotes = data_client.get_stock_latest_quote(request)
Now i’m getting things which are completely messed up, like Netflix (NFLX) price bid is 1000$ (WTF?), while the price on alpaca site is 1,109.36$
I’ve made a script that compares bid/ask for both paper (account 1) and live (account 2) accounts, the price is exactly the same:
========================================================================================================================
PRICE COMPARISON RESULTS
========================================================================================================================
Bid/Ask Price Comparison (Sorted by Spread)
┏━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┓
┃ ┃ Account 1 ┃ Account 1 ┃ Account 1 ┃ Account 2 ┃ Account 2 ┃ Account 2 ┃ Bid ┃ Ask ┃ ┃
┃ Symbol ┃ Bid ┃ Ask ┃ Spread % ┃ Bid ┃ Ask ┃ Spread % ┃ Diff % ┃ Diff % ┃ Notes ┃
┡━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━┩
│ SHOP │ $140.0000 │ $178.6100 │ 24.237% │ $140.0000 │ $178.6100 │ 24.237% │ +0.000% │ +0.000% │ │
│ NFLX │ $1000.0000 │ $1110.0000 │ 10.427% │ $1000.0000 │ $1110.0000 │ 10.427% │ +0.000% │ +0.000% │ │
│ META │ $688.0000 │ $760.0000 │ 9.945% │ $688.0000 │ $760.0000 │ 9.945% │ +0.000% │ +0.000% │ │
│ TXN │ $160.0000 │ $176.0000 │ 9.524% │ $160.0000 │ $176.0000 │ 9.524% │ +0.000% │ +0.000% │ │
│ ANET │ $152.0600 │ $157.3300 │ 3.407% │ $152.0600 │ $157.3300 │ 3.407% │ +0.000% │ +0.000% │ │
│ UNH │ $365.0000 │ $376.0000 │ 2.969% │ $365.0000 │ $376.0000 │ 2.969% │ +0.000% │ +0.000% │ │
│ AVGO │ $363.8000 │ $374.0000 │ 2.765% │ $363.8000 │ $374.0000 │ 2.765% │ +0.000% │ +0.000% │ │
│ SNOW │ $268.7800 │ $275.0000 │ 2.288% │ $268.7800 │ $275.0000 │ 2.288% │ +0.000% │ +0.000% │ │
│ ARM │ $174.6400 │ $178.0000 │ 1.906% │ $174.6400 │ $178.0000 │ 1.906% │ +0.000% │ +0.000% │ │
│ CRWD │ $544.3800 │ $553.5100 │ 1.663% │ $544.3800 │ $553.5100 │ 1.663% │ +0.000% │ +0.000% │ │
│ BILL │ $50.0000 │ $50.7800 │ 1.548% │ $50.7300 │ $50.7800 │ 0.099% │ +1.460% │ +0.000% │ │
│ TSM │ $297.0000 │ $300.0000 │ 1.005% │ $297.0000 │ $300.0000 │ 1.005% │ +0.000% │ +0.000% │ │
│ ADBE │ $361.8700 │ $364.9100 │ 0.837% │ $361.8700 │ $364.9100 │ 0.837% │ +0.000% │ +0.000% │ │
│ MSFT │ $541.1800 │ $545.5000 │ 0.795% │ $541.1800 │ $545.5000 │ 0.795% │ +0.000% │ +0.000% │ │
│ BABA │ $177.3500 │ $178.6000 │ 0.702% │ $177.3800 │ $177.4200 │ 0.023% │ +0.017% │ -0.661% │ │
│ COST │ $921.8700 │ $925.0100 │ 0.340% │ $921.8700 │ $925.0100 │ 0.340% │ +0.000% │ +0.000% │ │
│ ARLP │ $24.4200 │ $24.5000 │ 0.327% │ $24.4200 │ $24.5000 │ 0.327% │ +0.000% │ +0.000% │ │
│ TMUS │ $220.7400 │ $221.2400 │ 0.226% │ $220.7400 │ $220.7900 │ 0.023% │ +0.000% │ -0.203% │ │
│ GAIN │ $14.0900 │ $14.1200 │ 0.213% │ $14.0900 │ $14.1200 │ 0.213% │ +0.000% │ +0.000% │ │
I hope I’m doing something wrong and there’s a way to get proper live prices, because otherwise I don’t see how one can build a working strategy relying on this api.