Fix error when ask_last_balance is not set

closes #5181
This commit is contained in:
Matthias
2021-10-07 06:51:29 +02:00
parent 526bdaa2dc
commit 29863ad2bf
2 changed files with 9 additions and 2 deletions

View File

@@ -1058,7 +1058,7 @@ class Exchange:
ticker_rate = ticker[conf_strategy['price_side']]
if ticker['last'] and ticker_rate:
if side == 'buy' and ticker_rate > ticker['last']:
balance = conf_strategy['ask_last_balance']
balance = conf_strategy.get('ask_last_balance', 0.0)
ticker_rate = ticker_rate + balance * (ticker['last'] - ticker_rate)
elif side == 'sell' and ticker_rate < ticker['last']:
balance = conf_strategy.get('bid_last_balance', 0.0)