Skip to content

Commit

Permalink
Add "sane" defaults to protection triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
xmatthias committed Sep 20, 2021
1 parent fd23ab3 commit 3ce05c0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/telegram-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ Example configuration showing the different settings:
`buy` notifications are sent when the order is placed, while `buy_fill` notifications are sent when the order is filled on the exchange.
`sell` notifications are sent when the order is placed, while `sell_fill` notifications are sent when the order is filled on the exchange.
`*_fill` notifications are off by default and must be explicitly enabled.
`protection_trigger` notifications are sent when a protection triggers and `protection_trigger_global` notifications trigger when global protections are triggered.


`balance_dust_level` will define what the `/balance` command takes as "dust" - Currencies with a balance below this will be shown.
Expand Down
9 changes: 9 additions & 0 deletions freqtrade/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,15 @@
'enum': TELEGRAM_SETTING_OPTIONS,
'default': 'off'
},
'protection_trigger': {
'type': 'string',
'enum': TELEGRAM_SETTING_OPTIONS,
'default': 'off'
},
'protection_trigger_global': {
'type': 'string',
'enum': TELEGRAM_SETTING_OPTIONS,
},
}
},
'reload': {'type': 'boolean'},
Expand Down
2 changes: 2 additions & 0 deletions tests/rpc/test_rpc_telegram.py
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,8 @@ def test_send_msg_buy_cancel_notification(default_conf, mocker) -> None:

def test_send_msg_protection_notification(default_conf, mocker, time_machine) -> None:

default_conf['telegram']['notification_settings']['protection_trigger'] = 'on'

telegram, _, msg_mock = get_telegram_testobject(mocker, default_conf)
time_machine.move_to("2021-09-01 05:00:00 +00:00")
lock = PairLocks.lock_pair('ETH/BTC', arrow.utcnow().shift(minutes=6).datetime, 'randreason')
Expand Down

0 comments on commit 3ce05c0

Please sign in to comment.