fixed styling issues

This commit is contained in:
Gert Wohlgemuth 2018-05-01 22:23:11 -07:00
parent 4c0f710a76
commit 00aa1bee9d
2 changed files with 31 additions and 30 deletions

View File

@ -18,6 +18,7 @@ class OperationalException(BaseException):
class NotEnoughFundsExeption(BaseException): class NotEnoughFundsExeption(BaseException):
""" """
This happens when the exchange reports that not enough funds where available. We do not want to stop This happens when the exchange reports that not enough funds where available.
the bot in this case and just keep it going and suppress this message We do not want to stop the bot in this case and just keep it going and suppress
this message
""" """

View File

@ -184,9 +184,9 @@ class FreqtradeBot(object):
self.rpc.send_msg( self.rpc.send_msg(
'*Status:* OperationalException:\n```\n{traceback}```{hint}' '*Status:* OperationalException:\n```\n{traceback}```{hint}'
.format( .format(
traceback=traceback.format_exc(), traceback=traceback.format_exc(),
hint='Issue `/start` if you think it is safe to restart.' hint='Issue `/start` if you think it is safe to restart.'
) )
) )
logger.exception('OperationalException. Stopping trader ...') logger.exception('OperationalException. Stopping trader ...')
self.state = State.STOPPED self.state = State.STOPPED
@ -306,15 +306,15 @@ class FreqtradeBot(object):
self.rpc.send_msg( self.rpc.send_msg(
'*{}:* Buying [{}]({}) with limit `{:.8f} ({:.6f} {}, {:.3f} {})` ' '*{}:* Buying [{}]({}) with limit `{:.8f} ({:.6f} {}, {:.3f} {})` '
.format( .format(
exchange.get_name().upper(), exchange.get_name().upper(),
pair.replace('_', '/'), pair.replace('_', '/'),
exchange.get_pair_detail_url(pair), exchange.get_pair_detail_url(pair),
buy_limit, buy_limit,
stake_amount, stake_amount,
self.config['stake_currency'], self.config['stake_currency'],
stake_amount_fiat, stake_amount_fiat,
self.config['fiat_display_currency'] self.config['fiat_display_currency']
) )
) )
# Fee is applied twice because we make a LIMIT_BUY and LIMIT_SELL # Fee is applied twice because we make a LIMIT_BUY and LIMIT_SELL
trade = Trade( trade = Trade(
@ -488,15 +488,15 @@ class FreqtradeBot(object):
"*Current Rate:* `{current_rate:.8f}`\n" \ "*Current Rate:* `{current_rate:.8f}`\n" \
"*Profit:* `{profit:.2f}%`" \ "*Profit:* `{profit:.2f}%`" \
"".format( "".format(
exchange=trade.exchange, exchange=trade.exchange,
pair=trade.pair, pair=trade.pair,
pair_url=exchange.get_pair_detail_url(trade.pair), pair_url=exchange.get_pair_detail_url(trade.pair),
limit=limit, limit=limit,
open_rate=trade.open_rate, open_rate=trade.open_rate,
current_rate=current_rate, current_rate=current_rate,
amount=round(trade.amount, 8), amount=round(trade.amount, 8),
profit=round(profit * 100, 2), profit=round(profit * 100, 2),
) )
# For regular case, when the configuration exists # For regular case, when the configuration exists
if 'stake_currency' in self.config and 'fiat_display_currency' in self.config: if 'stake_currency' in self.config and 'fiat_display_currency' in self.config:
@ -509,13 +509,13 @@ class FreqtradeBot(object):
message += '` ({gain}: {profit_percent:.2f}%, {profit_coin:.8f} {coin}`' \ message += '` ({gain}: {profit_percent:.2f}%, {profit_coin:.8f} {coin}`' \
'` / {profit_fiat:.3f} {fiat})`' \ '` / {profit_fiat:.3f} {fiat})`' \
''.format( ''.format(
gain="profit" if fmt_exp_profit > 0 else "loss", gain="profit" if fmt_exp_profit > 0 else "loss",
profit_percent=fmt_exp_profit, profit_percent=fmt_exp_profit,
profit_coin=profit_trade, profit_coin=profit_trade,
coin=self.config['stake_currency'], coin=self.config['stake_currency'],
profit_fiat=profit_fiat, profit_fiat=profit_fiat,
fiat=self.config['fiat_display_currency'], fiat=self.config['fiat_display_currency'],
) )
# Because telegram._forcesell does not have the configuration # Because telegram._forcesell does not have the configuration
# Ignore the FIAT value and does not show the stake_currency as well # Ignore the FIAT value and does not show the stake_currency as well
else: else: