show trade id in status command; minor bugfix

This commit is contained in:
gcarq 2017-05-17 23:36:08 +02:00
parent d572b7bdbe
commit 6dae42d95d
2 changed files with 4 additions and 0 deletions

View File

@ -192,6 +192,8 @@ def create_trade(stake_amount: float, exchange):
whitelist.remove(latest_trade.pair) whitelist.remove(latest_trade.pair)
logger.debug('Ignoring {} in pair whitelist'.format(latest_trade.pair)) logger.debug('Ignoring {} in pair whitelist'.format(latest_trade.pair))
for trade in open_trades: for trade in open_trades:
if trade.pair not in whitelist:
continue
whitelist.remove(trade.pair) whitelist.remove(trade.pair)
logger.debug('Ignoring {} in pair whitelist'.format(trade.pair)) logger.debug('Ignoring {} in pair whitelist'.format(trade.pair))
if not whitelist: if not whitelist:

View File

@ -69,6 +69,7 @@ class TelegramHandler(object):
orders = [o for o in orders if o['id'] == trade.open_order_id] orders = [o for o in orders if o['id'] == trade.open_order_id]
order = orders[0] if orders else None order = orders[0] if orders else None
message = """ message = """
*Trade ID:* `{trade_id}`
*Current Pair:* [{pair}](https://bittrex.com/Market/Index?MarketName={pair}) *Current Pair:* [{pair}](https://bittrex.com/Market/Index?MarketName={pair})
*Open Since:* `{date}` *Open Since:* `{date}`
*Amount:* `{amount}` *Amount:* `{amount}`
@ -79,6 +80,7 @@ class TelegramHandler(object):
*Current Profit:* `{current_profit}%` *Current Profit:* `{current_profit}%`
*Open Order:* `{open_order}` *Open Order:* `{open_order}`
""".format( """.format(
trade_id=trade.id,
pair=trade.pair.replace('_', '-'), pair=trade.pair.replace('_', '-'),
date=arrow.get(trade.open_date).humanize(), date=arrow.get(trade.open_date).humanize(),
open_rate=trade.open_rate, open_rate=trade.open_rate,