For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

Live feed alpaca-backtrader-api - KeyError: ‘bidprice’



  • I understand that this is not bug by backtrader, but anyway maybe someone had the same.

    When stock is hold by exchange or sometimes after overnight I see that type of error. How I can catch this?

    File "/home/x777/anaconda3/envs/env_backtrader/lib/python3.6/site-packages/backtrader/cerebro.py", line 1130, in run
        runstrat = self.runstrategies(iterstrat)
      File "/home/x777/anaconda3/envs/env_backtrader/lib/python3.6/site-packages/backtrader/cerebro.py", line 1301, in runstrategies
        self._runnext(runstrats)
      File "/home/x777/anaconda3/envs/env_backtrader/lib/python3.6/site-packages/backtrader/cerebro.py", line 1545, in _runnext
        drets.append(d.next(ticks=False))
      File "/home/x777/anaconda3/envs/env_backtrader/lib/python3.6/site-packages/backtrader/feed.py", line 407, in next
        ret = self.load()
      File "/home/x777/anaconda3/envs/env_backtrader/lib/python3.6/site-packages/backtrader/feed.py", line 479, in load
        _loadret = self._load()
      File "/home/x777/anaconda3/envs/env_backtrader/lib/python3.6/site-packages/alpaca_backtrader_api/alpacadata.py", line 301, in _load
        ret = self._load_tick(msg)
      File "/home/x777/anaconda3/envs/env_backtrader/lib/python3.6/site-packages/alpaca_backtrader_api/alpacadata.py", line 401, in _load_tick
        msg['bidprice'])
    KeyError: 'bidprice'
    


});