alpacahq/alpaca-backtrader-api

API Never Gets to Strategy.next() on Unsupported Exchange Data

SavageShade opened this issue · 3 comments

I came across the situation this week where when one of the stocks I add data to Cerebro using default datafactory, the API will never get to Strategy.next() call (it will hang forever). I didn't realize the symbol (ADRNY from OTCQX) was not traded in a supported exchange until digging into it further. I would think that would trigger an error somewhere instead of the API hanging. If I should be doing this check myself, can I get pointed to where the data going into the datafactory contains the exchange (or other location if that isn't where I should be looking)?

Hi,
you could use the Assets endpoint:
https://alpaca.markets/docs/api-documentation/api-v2/assets/
it will return data that looks like this:
image

you could just use it directly from the alpaca-trade-api package

That is exactly what I needed to know, thank you! Might be good if the API gives us feedback on if there is a symbol that isn't supported in the future, but this will work great for now. Thanks again!