remove unnecessary else statements
This commit is contained in:
parent
1eebbebed1
commit
67995a2f49
@ -64,12 +64,12 @@ def process_maybe_execute_buy(interval):
|
|||||||
# Create entity and execute trade
|
# Create entity and execute trade
|
||||||
if create_trade(float(_CONF['stake_amount']), interval):
|
if create_trade(float(_CONF['stake_amount']), interval):
|
||||||
return True
|
return True
|
||||||
else:
|
|
||||||
logger.info(
|
logger.info(
|
||||||
'Checked all whitelisted currencies. '
|
'Checked all whitelisted currencies. '
|
||||||
'Found no suitable entry positions for buying. Will keep looking ...'
|
'Found no suitable entry positions for buying. Will keep looking ...'
|
||||||
)
|
)
|
||||||
return False
|
return False
|
||||||
except DependencyException as exception:
|
except DependencyException as exception:
|
||||||
logger.warning('Unable to create trade: %s', exception)
|
logger.warning('Unable to create trade: %s', exception)
|
||||||
return False
|
return False
|
||||||
@ -159,16 +159,16 @@ def handle_timedout_limit_buy(trade: Trade, order: Dict) -> bool:
|
|||||||
rpc.send_msg('*Timeout:* Unfilled buy order for {} cancelled'.format(
|
rpc.send_msg('*Timeout:* Unfilled buy order for {} cancelled'.format(
|
||||||
trade.pair.replace('_', '/')))
|
trade.pair.replace('_', '/')))
|
||||||
return True
|
return True
|
||||||
else:
|
|
||||||
# if trade is partially complete, edit the stake details for the trade
|
# if trade is partially complete, edit the stake details for the trade
|
||||||
# and close the order
|
# and close the order
|
||||||
trade.amount = order['amount'] - order['remaining']
|
trade.amount = order['amount'] - order['remaining']
|
||||||
trade.stake_amount = trade.amount * trade.open_rate
|
trade.stake_amount = trade.amount * trade.open_rate
|
||||||
trade.open_order_id = None
|
trade.open_order_id = None
|
||||||
logger.info('Partial buy order timeout for %s.', trade)
|
logger.info('Partial buy order timeout for %s.', trade)
|
||||||
rpc.send_msg('*Timeout:* Remaining buy order for {} cancelled'.format(
|
rpc.send_msg('*Timeout:* Remaining buy order for {} cancelled'.format(
|
||||||
trade.pair.replace('_', '/')))
|
trade.pair.replace('_', '/')))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
# FIX: 20180110, should cancel_order() be cond. or unconditionally called?
|
# FIX: 20180110, should cancel_order() be cond. or unconditionally called?
|
||||||
@ -189,9 +189,9 @@ def handle_timedout_limit_sell(trade: Trade, order: Dict) -> bool:
|
|||||||
trade.pair.replace('_', '/')))
|
trade.pair.replace('_', '/')))
|
||||||
logger.info('Sell order timeout for %s.', trade)
|
logger.info('Sell order timeout for %s.', trade)
|
||||||
return True
|
return True
|
||||||
else:
|
|
||||||
# TODO: figure out how to handle partially complete sell orders
|
# TODO: figure out how to handle partially complete sell orders
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def check_handle_timedout(timeoutvalue: int) -> None:
|
def check_handle_timedout(timeoutvalue: int) -> None:
|
||||||
|
Loading…
Reference in New Issue
Block a user