Add Elasticsearch support
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from oandapyV20 import API
|
||||
from oandapyV20.endpoints import accounts, orders, positions, pricing, trades
|
||||
|
||||
from core.exchanges import BaseExchange
|
||||
from core.exchanges import BaseExchange, common
|
||||
|
||||
|
||||
class OANDAExchange(BaseExchange):
|
||||
@@ -39,7 +39,16 @@ class OANDAExchange(BaseExchange):
|
||||
def get_balance(self):
|
||||
r = accounts.AccountSummary(self.account_id)
|
||||
response = self.call(r)
|
||||
return float(response["balance"])
|
||||
balance = float(response["balance"])
|
||||
|
||||
common.get_balance_hook(
|
||||
self.account.user.id,
|
||||
self.account.user.username,
|
||||
self.account.id,
|
||||
self.account.name,
|
||||
balance,
|
||||
)
|
||||
return balance
|
||||
|
||||
def get_market_value(self, symbol):
|
||||
raise NotImplementedError
|
||||
|
||||
Reference in New Issue
Block a user