Merge pull request #28 from nullart/nullartHFT

bug fixes in unfilledtimeout and tiny bug fix in sell orders
This commit is contained in:
Gert Wohlgemuth 2018-06-13 10:52:55 -07:00 committed by GitHub
commit 9de57f63f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -440,9 +440,8 @@ with limit `{buy_limit:.8f} ({stake_amount:.6f} \
logger.info('Using order book for selling...') logger.info('Using order book for selling...')
orderBook = exchange.get_order_book(trade.pair) orderBook = exchange.get_order_book(trade.pair)
# logger.debug('Order book %s',orderBook) # logger.debug('Order book %s',orderBook)
for i in range(self.config['ask_strategy']['book_order_min'],self.config['ask_strategy']['book_order_max']): for i in range(self.config['ask_strategy']['book_order_min'],self.config['ask_strategy']['book_order_max']+1):
sell_rate = orderBook['asks'][i-1][0] sell_rate = orderBook['asks'][i-1][0]
logger.debug('checking sell rate %s) %.8f > %.8f (%f %%)',i,trade.open_rate,sell_rate,((sell_rate/trade.open_rate)*100)-100)
if self.check_sell(trade, sell_rate, buy, sell): if self.check_sell(trade, sell_rate, buy, sell):
return True return True
break break
@ -485,9 +484,7 @@ with limit `{buy_limit:.8f} ({stake_amount:.6f} \
ordertime = arrow.get(order['datetime']).datetime ordertime = arrow.get(order['datetime']).datetime
# Check if trade is still actually open # Check if trade is still actually open
if int(order['remaining']) == 0: if (int(order['filled']) == 0) and (order['status']=='open'):
continue
if order['side'] == 'buy' and ordertime < timeoutthreashold: if order['side'] == 'buy' and ordertime < timeoutthreashold:
self.handle_timedout_limit_buy(trade, order) self.handle_timedout_limit_buy(trade, order)
elif order['side'] == 'sell' and ordertime < timeoutthreashold: elif order['side'] == 'sell' and ordertime < timeoutthreashold: