Even more...
This commit is contained in:
parent
3d91fb394a
commit
a2f3170ab5
|
@ -41,10 +41,15 @@ class OANDAExchange(BaseExchange):
|
||||||
|
|
||||||
def get_balance(self, return_usd=False):
|
def get_balance(self, return_usd=False):
|
||||||
r = accounts.AccountSummary(self.account_id)
|
r = accounts.AccountSummary(self.account_id)
|
||||||
|
print("r", r)
|
||||||
response = self.call(r)
|
response = self.call(r)
|
||||||
|
print("response", response)
|
||||||
balance = float(response["balance"])
|
balance = float(response["balance"])
|
||||||
|
print("balance", balance)
|
||||||
currency = response["currency"]
|
currency = response["currency"]
|
||||||
|
print("currency", currency)
|
||||||
balance_usd = common.to_currency("sell", self.account, balance, currency, "USD")
|
balance_usd = common.to_currency("sell", self.account, balance, currency, "USD")
|
||||||
|
print("balance_usd", balance_usd)
|
||||||
|
|
||||||
common.get_balance_hook(
|
common.get_balance_hook(
|
||||||
self.account.user.id,
|
self.account.user.id,
|
||||||
|
@ -53,8 +58,11 @@ class OANDAExchange(BaseExchange):
|
||||||
self.account.name,
|
self.account.name,
|
||||||
balance_usd,
|
balance_usd,
|
||||||
)
|
)
|
||||||
|
print("common.get_balance_hook", common.get_balance_hook)
|
||||||
if return_usd:
|
if return_usd:
|
||||||
|
print("YES return_usd")
|
||||||
return balance_usd
|
return balance_usd
|
||||||
|
print("NO return_usd")
|
||||||
return balance
|
return balance
|
||||||
|
|
||||||
def get_market_value(self, symbol):
|
def get_market_value(self, symbol):
|
||||||
|
|
Loading…
Reference in New Issue