Skip to content

Commit

Permalink
Merge pull request #3 from icyak/fix_pylinter_findings_2
Browse files Browse the repository at this point in the history
fix pylinter findings 2
  • Loading branch information
PeterValachovic authored Nov 27, 2023
2 parents 0ddddf4 + eeb01a0 commit 722c678
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions XTBApi/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,9 +526,9 @@ 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 == 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 +587,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 722c678

Please sign in to comment.