Skip to content

Commit

Permalink
Merge pull request freqtrade#2479 from freqtrade/fix/bids_to_delta
Browse files Browse the repository at this point in the history
Fix bug where bids_to_ask_delta causes doublebuys
  • Loading branch information
xmatthias authored Nov 5, 2019
2 parents 1a61d89 + c8638ce commit 6df1dd1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions freqtrade/freqtradebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,7 @@ def create_trades(self) -> bool:
(bidstrat_check_depth_of_market.get('bids_to_ask_delta', 0) > 0):
if self._check_depth_of_market_buy(_pair, bidstrat_check_depth_of_market):
buycount += self.execute_buy(_pair, stake_amount)
else:
continue
continue

buycount += self.execute_buy(_pair, stake_amount)

Expand Down
2 changes: 2 additions & 0 deletions tests/test_freqtradebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -3213,6 +3213,8 @@ def test_order_book_depth_of_market(default_conf, ticker, limit_buy_order, fee,
assert trade.open_date is not None
assert trade.exchange == 'bittrex'

assert len(Trade.query.all()) == 1

# Simulate fulfilled LIMIT_BUY order for trade
trade.update(limit_buy_order)

Expand Down

0 comments on commit 6df1dd1

Please sign in to comment.