Add controls boilerplate to main page
This commit is contained in:
@@ -202,3 +202,6 @@ class BaseExchange(object):
|
||||
|
||||
def get_all_positions(self):
|
||||
raise NotImplementedError
|
||||
|
||||
def close_all_positions(self):
|
||||
raise NotImplementedError
|
||||
|
||||
@@ -105,3 +105,13 @@ class OANDAExchange(BaseExchange):
|
||||
item["unrealized_pl"] = float(item["unrealized_pl"])
|
||||
items.append(item)
|
||||
return items
|
||||
|
||||
def close_all_positions(self):
|
||||
# all_positions = self.get_all_positions()
|
||||
|
||||
# for position in all_positions["itemlist"]:
|
||||
# print("POS ITER", position)
|
||||
r = positions.PositionClose(accountID=self.account_id)
|
||||
response = self.call(r)
|
||||
print("CLOSE ALL POSITIONS", response)
|
||||
return response
|
||||
|
||||
Reference in New Issue
Block a user