Begin implementing OANDA
This commit is contained in:
@@ -20,17 +20,7 @@ def get_positions(user, account_id=None):
|
||||
positions = account.client.get_all_positions()
|
||||
|
||||
for item in positions:
|
||||
item = dict(item)
|
||||
item["account_id"] = account.id
|
||||
item["unrealized_pl"] = float(item["unrealized_pl"])
|
||||
items.append(item)
|
||||
# try:
|
||||
# parsed = ccxt_s.CCXTRoot.from_dict(order)
|
||||
# except ValidationError as e:
|
||||
# log.error(f"Error creating trade: {e}")
|
||||
# return False
|
||||
# self.status = parsed.status
|
||||
# self.response = order
|
||||
return items
|
||||
|
||||
|
||||
@@ -77,7 +67,7 @@ class PositionAction(LoginRequiredMixin, View):
|
||||
unique = str(uuid.uuid4())[:8]
|
||||
|
||||
account = Account.get_by_id(account_id, request.user)
|
||||
success, info = trades.get_position_info(account, asset_id)
|
||||
success, info = account.client.get_position_info(asset_id)
|
||||
if not success:
|
||||
message = "Position does not exist"
|
||||
message_class = "danger"
|
||||
|
||||
Reference in New Issue
Block a user