darfting edge rpc messages

This commit is contained in:
Misagh
2019-03-24 22:36:33 +01:00
parent 96ea27322d
commit 1dfbf6eed6
2 changed files with 38 additions and 0 deletions

View File

@@ -470,6 +470,29 @@ class Telegram(RPC):
except RPCException as e:
self._send_msg(str(e), bot=bot)
@authorized_only
def _edge(self, bot: Bot, update: Update) -> None:
"""
Handler for /edge
Shows informaton related to Edge
"""
try:
edge_pairs = self._rpc_edge()
edge_pairs_tab = tabulate(edge_pairs,
headers=[
'Pair',
f'Winrate',
f'Expectancy',
f'Stoploss'
],
tablefmt='simple')
message = f'<b>Edge only validated following pairs:</b>\n<pre>{edge_pairs_tab}</pre>'
self._send_msg(message, bot=bot, parse_mode=ParseMode.HTML)
except RPCException as e:
self._send_msg(str(e), bot=bot)
@authorized_only
def _help(self, bot: Bot, update: Update) -> None:
"""