Use bids, not asks for sell-rate detection
This commit is contained in:
parent
29aa159827
commit
a0e6cd93b6
@ -592,7 +592,7 @@ class FreqtradeBot(object):
|
|||||||
logger.debug('Using order book to get sell rate')
|
logger.debug('Using order book to get sell rate')
|
||||||
|
|
||||||
order_book = self.exchange.get_order_book(pair, 1)
|
order_book = self.exchange.get_order_book(pair, 1)
|
||||||
rate = order_book['asks'][0][0]
|
rate = order_book['bids'][0][0]
|
||||||
|
|
||||||
else:
|
else:
|
||||||
rate = self.exchange.get_ticker(pair, refresh)['bid']
|
rate = self.exchange.get_ticker(pair, refresh)['bid']
|
||||||
|
@ -2984,7 +2984,7 @@ def test_get_sell_rate(default_conf, mocker, ticker, order_book_l2) -> None:
|
|||||||
ft = get_patched_freqtradebot(mocker, default_conf)
|
ft = get_patched_freqtradebot(mocker, default_conf)
|
||||||
rate = ft.get_sell_rate(pair, True)
|
rate = ft.get_sell_rate(pair, True)
|
||||||
assert isinstance(rate, float)
|
assert isinstance(rate, float)
|
||||||
assert rate == 0.043949
|
assert rate == 0.043936
|
||||||
|
|
||||||
|
|
||||||
def test_startup_messages(default_conf, mocker):
|
def test_startup_messages(default_conf, mocker):
|
||||||
|
Loading…
Reference in New Issue
Block a user