Add /stopbuy command to telegram

fixes #1607
This commit is contained in:
Matthias
2019-03-17 19:35:25 +01:00
parent bdc0134e88
commit a467d76832
2 changed files with 24 additions and 0 deletions

View File

@@ -328,6 +328,16 @@ class RPC(object):
self._freqtrade.state = State.RELOAD_CONF
return {'status': 'reloading config ...'}
def _rpc_stopbuy(self) -> Dict[str, str]:
"""
Handler to stop buying, but handle open trades gracefully.
"""
if self._freqtrade.state == State.RUNNING:
# Set 'max_open_trades' to 0
self._freqtrade.config['max_open_trades'] = 0
return {'status': 'Setting max_open_trades to 0. Run /reload_conf to reset.'}
def _rpc_forcesell(self, trade_id) -> None:
"""
Handler for forcesell <id>.