nb_trades and avg_trade_duration added to cli
This commit is contained in:
parent
ac0c931492
commit
36030176bb
@ -53,20 +53,23 @@ class EdgeCli(object):
|
|||||||
|
|
||||||
def _generate_edge_table(self, results: dict) -> str:
|
def _generate_edge_table(self, results: dict) -> str:
|
||||||
|
|
||||||
floatfmt = ('s', '.2f', '.2f', '.2f', '.2f', '.2f')
|
floatfmt = ('s', '.2f', '.2f', '.2f', '.2f', '.2f', 'd', '.d')
|
||||||
tabular_data = []
|
tabular_data = []
|
||||||
headers = ['pair', 'stoploss', 'win rate', 'risk reward ratio',
|
headers = ['pair', 'stoploss', 'win rate', 'risk reward ratio',
|
||||||
'required risk reward', 'expectancy']
|
'required risk reward', 'expectancy', 'total number of trades', 'average duration (min)']
|
||||||
|
|
||||||
for result in results.items():
|
for result in results.items():
|
||||||
tabular_data.append([
|
if result[1].nb_trades > 0:
|
||||||
result[0],
|
tabular_data.append([
|
||||||
result[1].stoploss,
|
result[0],
|
||||||
result[1].winrate,
|
result[1].stoploss,
|
||||||
result[1].risk_reward_ratio,
|
result[1].winrate,
|
||||||
result[1].required_risk_reward,
|
result[1].risk_reward_ratio,
|
||||||
result[1].expectancy
|
result[1].required_risk_reward,
|
||||||
])
|
result[1].expectancy,
|
||||||
|
result[1].nb_trades,
|
||||||
|
round(result[1].avg_trade_duration)
|
||||||
|
])
|
||||||
|
|
||||||
return tabulate(tabular_data, headers=headers, floatfmt=floatfmt, tablefmt="pipe")
|
return tabulate(tabular_data, headers=headers, floatfmt=floatfmt, tablefmt="pipe")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user