@@ -35,8 +35,10 @@ class RPCMessageType(Enum):
|
||||
WARNING_NOTIFICATION = 'warning'
|
||||
STARTUP_NOTIFICATION = 'startup'
|
||||
BUY_NOTIFICATION = 'buy'
|
||||
BUY_FILL_NOTIFICATION = 'buy_fill'
|
||||
BUY_CANCEL_NOTIFICATION = 'buy_cancel'
|
||||
SELL_NOTIFICATION = 'sell'
|
||||
SELL_FILL_NOTIFICATION = 'sell_fill'
|
||||
SELL_CANCEL_NOTIFICATION = 'sell_cancel'
|
||||
|
||||
def __repr__(self):
|
||||
|
@@ -209,6 +209,10 @@ class Telegram(RPCHandler):
|
||||
"Cancelling open buy Order for {pair} (#{trade_id}). "
|
||||
"Reason: {reason}.".format(**msg))
|
||||
|
||||
elif msg['type'] == RPCMessageType.BUY_FILL_NOTIFICATION:
|
||||
message = ("\N{LARGE CIRCLE} *{exchange}:* "
|
||||
"Buy order for {pair} (#{trade_id}) filled for {open_rate}.".format(**msg))
|
||||
|
||||
elif msg['type'] == RPCMessageType.SELL_NOTIFICATION:
|
||||
msg['amount'] = round(msg['amount'], 8)
|
||||
msg['profit_percent'] = round(msg['profit_ratio'] * 100, 2)
|
||||
@@ -240,6 +244,10 @@ class Telegram(RPCHandler):
|
||||
message = ("\N{WARNING SIGN} *{exchange}:* Cancelling Open Sell Order "
|
||||
"for {pair} (#{trade_id}). Reason: {reason}").format(**msg)
|
||||
|
||||
elif msg['type'] == RPCMessageType.SELL_FILL_NOTIFICATION:
|
||||
message = ("\N{LARGE CIRCLE} *{exchange}:* "
|
||||
"Sell order for {pair} (#{trade_id}) filled at {close_rate}.".format(**msg))
|
||||
|
||||
elif msg['type'] == RPCMessageType.STATUS_NOTIFICATION:
|
||||
message = '*Status:* `{status}`'.format(**msg)
|
||||
|
||||
|
@@ -49,8 +49,12 @@ class Webhook(RPCHandler):
|
||||
valuedict = self._config['webhook'].get('webhookbuy', None)
|
||||
elif msg['type'] == RPCMessageType.BUY_CANCEL_NOTIFICATION:
|
||||
valuedict = self._config['webhook'].get('webhookbuycancel', None)
|
||||
elif msg['type'] == RPCMessageType.BUY_FILL_NOTIFICATION:
|
||||
valuedict = self._config['webhook'].get('webhookbuyfill', None)
|
||||
elif msg['type'] == RPCMessageType.SELL_NOTIFICATION:
|
||||
valuedict = self._config['webhook'].get('webhooksell', None)
|
||||
elif msg['type'] == RPCMessageType.SELL_FILL_NOTIFICATION:
|
||||
valuedict = self._config['webhook'].get('webhooksellfill', None)
|
||||
elif msg['type'] == RPCMessageType.SELL_CANCEL_NOTIFICATION:
|
||||
valuedict = self._config['webhook'].get('webhooksellcancel', None)
|
||||
elif msg['type'] in (RPCMessageType.STATUS_NOTIFICATION,
|
||||
|
Reference in New Issue
Block a user