Skip to content

Commit

Permalink
Simplifications
Browse files Browse the repository at this point in the history
  • Loading branch information
RetGal committed Jan 30, 2024
1 parent fadef87 commit a35838f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions balancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ def __init__(self):
self.max_leverage_in_percent = abs(float(props['max_leverage_in_percent']))
self.backtrade_only_on_profit = bool(str(props['backtrade_only_on_profit']).strip('"').lower() == 'true')
self.report = str(props['report']).strip('"')
currency = self.pair.split("/")
self.base = currency[0]
self.quote = currency[1]
self.base, self.quote = self.pair.split("/")
if self.auto_quote not in self.mm_quotes:
raise SystemExit(f"Invalid value for auto_quote: '{self.auto_quote}' possible values are: {self.mm_quotes}")
if self.report not in self.report_cadences:
Expand Down Expand Up @@ -327,7 +325,8 @@ def create_mail_content(daily: bool = False):
settings_part = create_report_part_settings()
general_part = create_mail_part_general()

performance = ["Performance", "-----------", '\n'.join(performance_part['mail']) + '\n* (change since yesterday noon)', '\n\n']
performance = ["Performance", "-----------", '\n'.join(performance_part['mail']) +
'\n* (change since yesterday noon)', '\n\n']
if CONF.exchange == 'bitmex':
start = ["Start information", "-----------------", '\n'.join(start_values_part['mail']), '\n\n']
else:
Expand Down
4 changes: 2 additions & 2 deletions balancer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ def test_cancel_order_already_filled(self, mock_fetch_order_status, mock_cancel_
@patch('balancer.logging')
@mock.patch.object(ccxt.kraken, 'cancel_order')
@mock.patch.object(ccxt.kraken, 'fetch_order_status')
def test_cancel_orderd_not_found_already_filled(self, mock_fetch_order_status, mock_cancel_order, mock_logging):
def test_cancel_order_not_found_already_filled(self, mock_fetch_order_status, mock_cancel_order, mock_logging):
balancer.CONF = self.create_default_conf()
balancer.CONF.test = False
balancer.LOG = mock_logging
Expand All @@ -960,7 +960,7 @@ def test_cancel_orderd_not_found_already_filled(self, mock_fetch_order_status, m
@patch('balancer.logging')
@mock.patch.object(ccxt.bitmex, 'cancel_order')
@mock.patch.object(ccxt.bitmex, 'fetch_order_status')
def test_cancel_orderd_not_found_already_filled_bitmex(self, mock_fetch_order_status, mock_cancel_order, mock_logging):
def test_cancel_order_not_found_already_filled_bitmex(self, mock_fetch_order_status, mock_cancel_order, mock_logging):
balancer.CONF = self.create_default_conf()
balancer.CONF.exchange = 'bitmex'
balancer.LOG = mock_logging
Expand Down

0 comments on commit a35838f

Please sign in to comment.