Fix open trades checks
This commit is contained in:
@@ -393,8 +393,23 @@ class ActiveManagementTestCase(StrategyMixin, SymbolPriceMock, TestCase):
|
||||
self.trades[10:], # Only close newer trades
|
||||
)
|
||||
|
||||
def test_max_open_trades_per_symbol_violated(self):
|
||||
pass
|
||||
@patch("core.trading.active_management.ActiveManagement.handle_violation")
|
||||
def test_max_open_trades_per_symbol_violated(self, handle_violation):
|
||||
for x in range(2):
|
||||
self.add_trade(
|
||||
str(x),
|
||||
"EUR_USD",
|
||||
"long",
|
||||
f"2023-02-13T12:39:1{x}.302917985Z",
|
||||
)
|
||||
|
||||
self.ams.run_checks()
|
||||
self.check_violation(
|
||||
"max_open_trades_per_symbol",
|
||||
handle_violation.call_args_list,
|
||||
"close",
|
||||
self.trades[2:], # Only close newer trades
|
||||
)
|
||||
|
||||
def test_max_loss_violated(self):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user