From 4223c12fa97d73c44bd4c54c7d8ec9088dfa91ab Mon Sep 17 00:00:00 2001 From: Peter Valachovic Date: Mon, 27 Nov 2023 22:16:29 +0100 Subject: [PATCH 1/2] fix pylinter findings 2 --- XTBApi/api.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/XTBApi/api.py b/XTBApi/api.py index 46a27bb..e8c8a71 100644 --- a/XTBApi/api.py +++ b/XTBApi/api.py @@ -526,9 +526,10 @@ def get_prices_operate(self, mode, symbol): conversion_mode_2 = {MODES.BUY.value: 'low', MODES.SELL.value: 'high'} price_2 = symbol_info[conversion_mode_2[mode.value]] factor_price_2 = 0.008 - if mode == MODES.BUY or mode == MODES.BUY_LIMIT: + #if mode == MODES.BUY or mode == MODES.BUY_LIMIT: + if mode in (MODES.BUY,MODES.BUY_LIMIT): price_2 = round(price_2 * (1 - factor_price_2), 2) - elif mode == MODES.SELL or mode == MODES.SELL_LIMIT: + elif mode in(MODES.SELL,MODES.SELL_LIMIT): price_2 = round(price_2 * (1 + factor_price_2), 2) return price, price_2 @@ -587,4 +588,4 @@ def close_all_trades(self): self.logger.debug("closing %i trades", len(self.trade_rec)) trade_ids = self.trade_rec.keys() for trade_id in trade_ids: - self._close_trade_only(trade_id) \ No newline at end of file + self._close_trade_only(trade_id) From eeb01a05b54611def36814443376e8443c60e618 Mon Sep 17 00:00:00 2001 From: Peter Valachovic Date: Mon, 27 Nov 2023 22:17:12 +0100 Subject: [PATCH 2/2] fix pylinter findings 2 --- XTBApi/api.py | 1 - 1 file changed, 1 deletion(-) diff --git a/XTBApi/api.py b/XTBApi/api.py index e8c8a71..c43874b 100644 --- a/XTBApi/api.py +++ b/XTBApi/api.py @@ -526,7 +526,6 @@ def get_prices_operate(self, mode, symbol): conversion_mode_2 = {MODES.BUY.value: 'low', MODES.SELL.value: 'high'} price_2 = symbol_info[conversion_mode_2[mode.value]] factor_price_2 = 0.008 - #if mode == MODES.BUY or mode == MODES.BUY_LIMIT: if mode in (MODES.BUY,MODES.BUY_LIMIT): price_2 = round(price_2 * (1 - factor_price_2), 2) elif mode in(MODES.SELL,MODES.SELL_LIMIT):