rpc refactor 9/

This commit is contained in:
kryofly
2018-01-26 13:26:18 +01:00
parent c99ec4d567
commit 11bf579cc3
2 changed files with 16 additions and 5 deletions

View File

@@ -428,3 +428,15 @@ def rpc_performance() -> None:
trades.append({'pair': pair, 'profit': round(rate * 100, 2), 'count': count})
return (False, trades)
def rpc_count() -> None:
"""
Returns the number of trades running
:return: None
"""
if get_state() != State.RUNNING:
return (True, '`trader is not running`')
trades = Trade.query.filter(Trade.is_open.is_(True)).all()
return (False, trades)