Begin implementing get all open trades

This commit is contained in:
2022-12-22 07:20:49 +00:00
parent b818e7e3f5
commit a18c150fe2
3 changed files with 67 additions and 0 deletions

View File

@@ -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

View File

@@ -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",