Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix pylinter findings 2 #3

Merged
merged 2 commits into from
Nov 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Loading