Added sell_tag and buy/sell telegram performance functions

This commit is contained in:
theluxaz
2021-10-13 00:02:28 +03:00
parent 0a52d7c24f
commit b898f86364
11 changed files with 1673 additions and 18 deletions

View File

@@ -669,6 +669,37 @@ class RPC:
[x.update({'profit': round(x['profit'] * 100, 2)}) for x in pair_rates]
return pair_rates
def _rpc_buy_tag_performance(self, pair: str) -> List[Dict[str, Any]]:
"""
Handler for buy tag performance.
Shows a performance statistic from finished trades
"""
buy_tags = Trade.get_buy_tag_performance(pair)
# Round and convert to %
[x.update({'profit': round(x['profit'] * 100, 2)}) for x in buy_tags]
return buy_tags
def _rpc_sell_tag_performance(self, pair: str) -> List[Dict[str, Any]]:
"""
Handler for sell tag performance.
Shows a performance statistic from finished trades
"""
sell_tags = Trade.get_sell_tag_performance(pair)
# Round and convert to %
[x.update({'profit': round(x['profit'] * 100, 2)}) for x in sell_tags]
return sell_tags
def _rpc_mix_tag_performance(self, pair: str) -> List[Dict[str, Any]]:
"""
Handler for mix tag performance.
Shows a performance statistic from finished trades
"""
mix_tags = Trade.get_mix_tag_performance(pair)
# Round and convert to %
[x.update({'profit': round(x['profit'] * 100, 2)}) for x in mix_tags]
return mix_tags
def _rpc_count(self) -> Dict[str, float]:
""" Returns the number of trades running """
if self._freqtrade.state != State.RUNNING: