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