Skip to content
Permalink
Browse files

simple notification to stdout. Usefull for testing

  • Loading branch information...
december-soul committed May 31, 2018
1 parent 5f1d61c commit 4e2f04501e41510fbabb054c64afc626fac20be5
Showing with 27 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +7 −0 app/defaults.yml
  3. +7 −1 app/notification.py
  4. +12 −0 docs/config.md
@@ -3,3 +3,4 @@ settings.env
config.yml
.vscode
.idea/
lib/ta-lib/
@@ -52,6 +52,13 @@ notifiers:
optional:
username: null
password: null
stdout:
required:
enable: null
optional:
parse_mode: html
template: "{{exchange}}-{{market}}-{{indicator}}-{{indicator_number}} is {{status}}!{{ '\n' -}}"


indicators:
momentum:
@@ -11,6 +11,7 @@
from notifiers.gmail_client import GmailNotifier
from notifiers.telegram_client import TelegramNotifier
from notifiers.webhook_client import WebhookNotifier
from notifiers.stdout_client import StdoutNotifier

class Notifier():
"""Handles sending notifications via the configured notifiers
@@ -82,6 +83,11 @@ def __init__(self, notifier_config):
)
enabled_notifiers.append('webhook')

self.stdout_configured = self._validate_required_config('stdout', notifier_config)
if self.stdout_configured:
self.stdout_client = StdoutNotifier()
enabled_notifiers.append('stdout')

self.logger.info('enabled notifers: %s', enabled_notifiers)


@@ -98,7 +104,7 @@ def notify_all(self, new_analysis):
self.notify_gmail(new_analysis)
self.notify_telegram(new_analysis)
self.notify_webhook(new_analysis)

self.notify_stdout(new_analysis)

def notify_discord(self, new_analysis):
"""Send a notification via the discord notifier
@@ -276,6 +276,18 @@ notifiers:
password: abcd1234
```

## StdOut

An example of notifier settings for stdout. This will just print the notification to stdout.
Usefull for testing

```yml
notifiers:
stdout:
required:
enable: true
```

## Notifier Templating
The notifier templates are built with a templating language called [Jinja2](http://jinja.pocoo.org/docs/2.10/templates/) and anything that is a valid Jinja message is valid for crypto-signal. The options available are as follows:

0 comments on commit 4e2f045

Please sign in to comment.
You can’t perform that action at this time.