@ -146,6 +146,7 @@ class AlpacaExchange(BaseExchange):
return (success, response)
for item in response["itemlist"]:
item["account"] = self.account.name
item["account_id"] = self.account.id
item["unrealized_pl"] = float(item["unrealized_pl"])
items.append(item)
@ -85,7 +85,8 @@ class OANDAExchange(BaseExchange):
print("Positions", response)
item["account_id"] = self.account_id
return (True, items)
@ -21,8 +21,6 @@ def get_positions(user, account_id=None):
if not success:
items.append({"name": account.name, "status": "error"})
continue
for position in positions:
position["account"] = account.name
for item in positions: