Begin implementing get all open trades
This commit is contained in:
@@ -218,6 +218,10 @@ class BaseExchange(ABC):
|
||||
def get_all_positions(self):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def get_all_open_trades(self):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def close_position(self, side, symbol):
|
||||
pass
|
||||
|
||||
@@ -129,6 +129,10 @@ class OANDAExchange(BaseExchange):
|
||||
items.append(item)
|
||||
return items
|
||||
|
||||
def get_all_open_trades(self):
|
||||
r = trades.OpenTrades(accountID=self.account_id)
|
||||
return self.call(r)
|
||||
|
||||
def close_position(self, side, symbol):
|
||||
data = {
|
||||
f"{side}Units": "ALL",
|
||||
|
||||
Reference in New Issue
Block a user