Merge pull request #2389 from hroff-1902/minor-freqtrade

Minor freqtradebot cleanup
This commit is contained in:
Matthias 2019-10-19 09:52:48 +02:00 committed by GitHub
commit 93b213ae0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -748,8 +748,8 @@ class FreqtradeBot:
"""
buy_timeout = self.config['unfilledtimeout']['buy']
sell_timeout = self.config['unfilledtimeout']['sell']
buy_timeoutthreashold = arrow.utcnow().shift(minutes=-buy_timeout).datetime
sell_timeoutthreashold = arrow.utcnow().shift(minutes=-sell_timeout).datetime
buy_timeout_threshold = arrow.utcnow().shift(minutes=-buy_timeout).datetime
sell_timeout_threshold = arrow.utcnow().shift(minutes=-sell_timeout).datetime
for trade in Trade.query.filter(Trade.open_order_id.isnot(None)).all():
try:
@ -773,17 +773,16 @@ class FreqtradeBot:
self.wallets.update()
continue
if (order['side'] == 'buy'
and order['status'] == 'canceled'
if ((order['side'] == 'buy' and order['status'] == 'canceled')
or (order['status'] == 'open'
and order['side'] == 'buy' and ordertime < buy_timeoutthreashold)):
and order['side'] == 'buy' and ordertime < buy_timeout_threshold)):
self.handle_timedout_limit_buy(trade, order)
self.wallets.update()
elif (order['side'] == 'sell' and order['status'] == 'canceled'
elif ((order['side'] == 'sell' and order['status'] == 'canceled')
or (order['status'] == 'open'
and order['side'] == 'sell' and ordertime < sell_timeoutthreashold)):
and order['side'] == 'sell' and ordertime < sell_timeout_threshold)):
self.handle_timedout_limit_sell(trade, order)
self.wallets.update()