You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "alpaca_short_bsf46.py", line 145, in close_previous_day
for sec in context.portfolio.positions:
File "/usr/local/lib/python3.6/site-packages/pylivetrader/algorithm.py", line 512, in portfolio
self._portfolio = self._backend.portfolio
File "/usr/local/lib/python3.6/site-packages/pylivetrader/backend/alpaca.py", line 268, in portfolio
z_portfolio.positions = self.positions
File "/usr/local/lib/python3.6/site-packages/pylivetrader/backend/alpaca.py", line 244, in positions
z_position.amount = int(pos.qty)
ValueError: invalid literal for int() with base 10: '418.8667'
changing int(pos.qty) to float in backend/alpaca.py gets past this error
pip show pylivetrader
Name: pylivetrader
Version: 0.7.1
Summary: simple live trading framework
Home-page: https://github.com/alpacahq/pylivetrader.git
The text was updated successfully, but these errors were encountered:
using
context.portfolio.positions
givesfrom https://github.com/alpacahq/pylivetrader/blob/master/pylivetrader/backend/alpaca.py#L244
changing
int(pos.qty)
tofloat
inbackend/alpaca.py
gets past this errorThe text was updated successfully, but these errors were encountered: