I recently started to use Alpaca API, and I need help with some issue:
I’m trying to get the current share of a stock.I succeeded to do it like that:
position_data = (api.get_position(symbol)) current_price = float (positiondata.current_price)
The problem with that, is that I get the prich only if I got open position
Tnd with that, the price is not acuret enough:
symbol_bars = api.get_barset(symbol, 'minute', 1).df.iloc symbol_price = symbol_bars[symbol]['close']
Someone has an idea how can I get a stock acuret price with out having open position?