fix NoneType issue
This commit is contained in:
parent
0949f54c7d
commit
5402f8ba30
3
main.py
3
main.py
@ -192,8 +192,9 @@ def create_trade(stake_amount: float, exchange):
|
||||
raise ValueError('stake amount is not fulfilled (currency={}'.format(conf['stake_currency']))
|
||||
|
||||
# Remove currently opened and latest pairs from whitelist
|
||||
latest_trade = Trade.query.filter(Trade.is_open.is_(False)).order_by(Trade.id.desc()).first()
|
||||
trades = Trade.query.filter(Trade.is_open.is_(True)).all()
|
||||
latest_trade = Trade.query.filter(Trade.is_open.is_(False)).order_by(Trade.id.desc()).first()
|
||||
if latest_trade:
|
||||
trades.append(latest_trade)
|
||||
for trade in trades:
|
||||
if trade.pair in whitelist:
|
||||
|
Loading…
Reference in New Issue
Block a user