Implement more validation and conversion

This commit is contained in:
2022-11-04 07:20:14 +00:00
parent d34ac39d68
commit 60979652d9
8 changed files with 294 additions and 158 deletions

View File

@@ -21,7 +21,9 @@ class OANDAExchange(BaseExchange):
return self.call(r)
def get_supported_assets(self):
return False
r = accounts.AccountInstruments(accountID=self.account_id)
response = self.call(r)
return [x["name"] for x in response["itemlist"]]
def get_balance(self):
raise NotImplementedError
@@ -59,7 +61,6 @@ class OANDAExchange(BaseExchange):
r = positions.OpenPositions(accountID=self.account_id)
response = self.call(r)
print("Positions", response)
for item in response["itemlist"]:
item["account"] = self.account.name
item["account_id"] = self.account.id