Skip to content

Commit

Permalink
fix pylinter findings 2
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterValachovic committed Nov 27, 2023
1 parent 0ddddf4 commit 4223c12
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions XTBApi/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
self._close_trade_only(trade_id)

0 comments on commit 4223c12

Please sign in to comment.