mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-17 05:11:15 +00:00
feat: improve list-strategies command output
This commit is contained in:
@@ -101,7 +101,7 @@ def _print_objs_tabular(objs: list, print_colorized: bool) -> None:
|
|||||||
names = [s["name"] for s in objs]
|
names = [s["name"] for s in objs]
|
||||||
objs_to_print: list[dict[str, Text | str]] = [
|
objs_to_print: list[dict[str, Text | str]] = [
|
||||||
{
|
{
|
||||||
"name": Text(s["name"] if s["name"] else "--"),
|
"Strategy name": Text(s["name"] if s["name"] else "--"),
|
||||||
"location": s["location_rel"],
|
"location": s["location_rel"],
|
||||||
"status": (
|
"status": (
|
||||||
Text("LOAD FAILED", style="bold red")
|
Text("LOAD FAILED", style="bold red")
|
||||||
@@ -115,11 +115,18 @@ def _print_objs_tabular(objs: list, print_colorized: bool) -> None:
|
|||||||
]
|
]
|
||||||
for idx, s in enumerate(objs):
|
for idx, s in enumerate(objs):
|
||||||
if "hyperoptable" in s:
|
if "hyperoptable" in s:
|
||||||
|
custom_params = [
|
||||||
|
f"{space}: {len(params)}"
|
||||||
|
for space, params in s["hyperoptable"].items()
|
||||||
|
if space not in ["buy", "sell", "protection"]
|
||||||
|
]
|
||||||
objs_to_print[idx].update(
|
objs_to_print[idx].update(
|
||||||
{
|
{
|
||||||
"hyperoptable": "Yes" if len(s["hyperoptable"]) > 0 else "No",
|
"hyperoptable": "Yes" if len(s["hyperoptable"]) > 0 else "No",
|
||||||
"buy-Params": str(len(s["hyperoptable"].get("buy", []))),
|
"buy-Params": str(len(s["hyperoptable"].get("buy", []))),
|
||||||
"sell-Params": str(len(s["hyperoptable"].get("sell", []))),
|
"sell-Params": str(len(s["hyperoptable"].get("sell", []))),
|
||||||
|
"protection-Params": str(len(s["hyperoptable"].get("protection", []))),
|
||||||
|
"custom-Params": ", ".join(custom_params) if custom_params else "",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
table = Table()
|
table = Table()
|
||||||
|
|||||||
Reference in New Issue
Block a user