From 7a2e9ef5356fc055efdcf73e4021c7adfa22844f Mon Sep 17 00:00:00 2001 From: jblestang Date: Mon, 1 Jan 2018 23:21:43 +0100 Subject: [PATCH] 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 --- freqtrade/main.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/freqtrade/main.py b/freqtrade/main.py index 8b6c3713a..ff5d4b5aa 100755 --- a/freqtrade/main.py +++ b/freqtrade/main.py @@ -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(