Implement updating protection

This commit is contained in:
2023-02-22 07:20:37 +00:00
parent ba8eb69309
commit ed63085e10
4 changed files with 55 additions and 33 deletions

View File

@@ -86,10 +86,11 @@ class ActiveManagement(object):
for action_cast in action_cast_list:
msg += f"ACTION: '{action}' on trade ID '{action_cast['id']}'\n"
msg += f"VIOLATION: '{action_cast['check']}'\n"
if action_cast["extra"]:
extra = action_cast["extra"]
extra = ", ".join([f"{k}: {v}" for k, v in extra.items()])
msg += f"EXTRA: {extra}\n"
if "extra" in action_cast:
if action_cast["extra"]:
extra = action_cast["extra"]
extra = ", ".join([f"{k}: {v}" for k, v in extra.items()])
msg += f"EXTRA: {extra}\n"
msg += "=========\n"
sendmsg(self.strategy.user, msg, title=f"AMS: {action}")
@@ -114,7 +115,7 @@ class ActiveManagement(object):
self.strategy.account.client.close_trade(trade_id, difference, symbol)
def adjust_protection(self, trade_id, new_protection):
pass # TODO
self.strategy.account.client.update_trade(trade_id, **new_protection)
def bulk_adjust(self, action_cast_list):
for item in action_cast_list: