Add fiat display in sell msg (#271)

* Display amount (fiat currency) in the sell message
* Display also base currency
* Adding more info in Buy Message, the stake amount, and the amount using FIAT Converter
* fix display style and width
* Fixing flake8
This commit is contained in:
jblestang 2018-01-01 23:21:43 +01:00 committed by Gérald LONLAS
parent 079f2e3609
commit 7a2e9ef535
1 changed files with 11 additions and 2 deletions

View File

@ -255,12 +255,21 @@ def create_trade(stake_amount: float) -> bool:
amount = stake_amount / buy_limit
order_id = exchange.buy(pair, buy_limit, amount)
fiat_converter = CryptoToFiatConverter()
stake_amount_fiat = fiat_converter.convert_amount(
stake_amount,
_CONF['stake_currency'],
_CONF['fiat_display_currency']
)
# Create trade entity and return
rpc.send_msg('*{}:* Buying [{}]({}) with limit `{:.8f}`'.format(
rpc.send_msg('*{}:* Buying [{}]({}) with limit `{:.8f} ({:.6f} {}, {:.3f} {})` '.format(
exchange.get_name().upper(),
pair.replace('_', '/'),
exchange.get_pair_detail_url(pair),
buy_limit
buy_limit, stake_amount, _CONF['stake_currency'],
stake_amount_fiat, _CONF['fiat_display_currency']
))
# Fee is applied twice because we make a LIMIT_BUY and LIMIT_SELL
trade = Trade(