Use "trades" wording in backtest tables

This commit is contained in:
Matthias 2024-06-11 07:03:47 +02:00
parent 90efd04617
commit 09b1b1ab94
2 changed files with 12 additions and 12 deletions

View File

@ -20,7 +20,7 @@ def _get_line_floatfmt(stake_currency: str) -> List[str]:
def _get_line_header( def _get_line_header(
first_column: str, stake_currency: str, direction: str = "Entries" first_column: str, stake_currency: str, direction: str = "Trades"
) -> List[str]: ) -> List[str]:
""" """
Generate header lines (goes in line with _generate_result_line()) Generate header lines (goes in line with _generate_result_line())
@ -54,7 +54,7 @@ def text_table_bt_results(pair_results: List[Dict[str, Any]], stake_currency: st
:return: pretty printed table with tabulate as string :return: pretty printed table with tabulate as string
""" """
headers = _get_line_header("Pair", stake_currency) headers = _get_line_header("Pair", stake_currency, "Trades")
floatfmt = _get_line_floatfmt(stake_currency) floatfmt = _get_line_floatfmt(stake_currency)
output = [ output = [
[ [
@ -81,7 +81,7 @@ def text_table_tags(tag_type: str, tag_results: List[Dict[str, Any]], stake_curr
""" """
fallback: str = "" fallback: str = ""
if tag_type == "enter_tag": if tag_type == "enter_tag":
headers = _get_line_header("TAG", stake_currency) headers = _get_line_header("TAG", stake_currency, "Entries")
else: else:
headers = _get_line_header("Exit Reason", stake_currency, "Exits") headers = _get_line_header("Exit Reason", stake_currency, "Exits")
fallback = "exit_reason" fallback = "exit_reason"
@ -144,7 +144,7 @@ def text_table_strategy(strategy_results, stake_currency: str) -> str:
:return: pretty printed table with tabulate as string :return: pretty printed table with tabulate as string
""" """
floatfmt = _get_line_floatfmt(stake_currency) floatfmt = _get_line_floatfmt(stake_currency)
headers = _get_line_header("Strategy", stake_currency) headers = _get_line_header("Strategy", stake_currency, "Trades")
# _get_line_header() is also used for per-pair summary. Per-pair drawdown is mostly useless # _get_line_header() is also used for per-pair summary. Per-pair drawdown is mostly useless
# therefore we slip this column in only for strategy summary here. # therefore we slip this column in only for strategy summary here.
headers.append("Drawdown") headers.append("Drawdown")

View File

@ -70,13 +70,13 @@ def test_text_table_bt_results():
) )
result_str = ( result_str = (
"| Pair | Entries | Avg Profit % | Tot Profit BTC | " "| Pair | Trades | Avg Profit % | Tot Profit BTC | "
"Tot Profit % | Avg Duration | Win Draw Loss Win% |\n" "Tot Profit % | Avg Duration | Win Draw Loss Win% |\n"
"|---------+-----------+----------------+------------------+" "|---------+----------+----------------+------------------+"
"----------------+----------------+-------------------------|\n" "----------------+----------------+-------------------------|\n"
"| ETH/BTC | 3 | 8.33 | 0.50000000 | " "| ETH/BTC | 3 | 8.33 | 0.50000000 | "
"12.50 | 0:20:00 | 2 0 1 66.7 |\n" "12.50 | 0:20:00 | 2 0 1 66.7 |\n"
"| TOTAL | 3 | 8.33 | 0.50000000 | " "| TOTAL | 3 | 8.33 | 0.50000000 | "
"12.50 | 0:20:00 | 2 0 1 66.7 |" "12.50 | 0:20:00 | 2 0 1 66.7 |"
) )
@ -509,13 +509,13 @@ def test_text_table_strategy(testdatadir):
bt_res_data_comparison = bt_res_data.pop("strategy_comparison") bt_res_data_comparison = bt_res_data.pop("strategy_comparison")
result_str = ( result_str = (
"| Strategy | Entries | Avg Profit % | Tot Profit BTC |" "| Strategy | Trades | Avg Profit % | Tot Profit BTC |"
" Tot Profit % | Avg Duration | Win Draw Loss Win% | Drawdown |\n" " Tot Profit % | Avg Duration | Win Draw Loss Win% | Drawdown |\n"
"|----------------+-----------+----------------+------------------+" "|----------------+----------+----------------+------------------+"
"----------------+----------------+-------------------------+-----------------------|\n" "----------------+----------------+-------------------------+-----------------------|\n"
"| StrategyTestV2 | 179 | 0.08 | 0.02608550 |" "| StrategyTestV2 | 179 | 0.08 | 0.02608550 |"
" 260.85 | 3:40:00 | 170 0 9 95.0 | 0.00308222 BTC 8.67% |\n" " 260.85 | 3:40:00 | 170 0 9 95.0 | 0.00308222 BTC 8.67% |\n"
"| TestStrategy | 179 | 0.08 | 0.02608550 |" "| TestStrategy | 179 | 0.08 | 0.02608550 |"
" 260.85 | 3:40:00 | 170 0 9 95.0 | 0.00308222 BTC 8.67% |" " 260.85 | 3:40:00 | 170 0 9 95.0 | 0.00308222 BTC 8.67% |"
) )