Fixed models and rpc performance functions, added skeletons for tests.

This commit is contained in:
theluxaz
2021-10-25 23:43:22 +03:00
parent 22dd2ca003
commit b51f946ee0
4 changed files with 272 additions and 77 deletions

View File

@@ -685,8 +685,7 @@ class RPC:
Shows a performance statistic from finished trades
"""
pair_rates = Trade.get_overall_performance()
# Round and convert to %
[x.update({'profit': round(x['profit'] * 100, 2)}) for x in pair_rates]
return pair_rates
def _rpc_buy_tag_performance(self, pair: Optional[str]) -> List[Dict[str, Any]]:
@@ -695,8 +694,7 @@ class RPC:
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_reason_performance(self, pair: Optional[str]) -> List[Dict[str, Any]]:
@@ -705,8 +703,7 @@ class RPC:
Shows a performance statistic from finished trades
"""
sell_reasons = Trade.get_sell_reason_performance(pair)
# Round and convert to %
[x.update({'profit': round(x['profit'] * 100, 2)}) for x in sell_reasons]
return sell_reasons
def _rpc_mix_tag_performance(self, pair: Optional[str]) -> List[Dict[str, Any]]:
@@ -715,8 +712,7 @@ class RPC:
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]: