mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-09-20 01:21:11 +00:00
feat: Add margin/Trading mode output to bt-output
This commit is contained in:
parent
f714e306da
commit
1a2578a4b7
|
@ -263,12 +263,32 @@ def text_table_add_metrics(strat_results: Dict) -> None:
|
|||
else []
|
||||
)
|
||||
|
||||
trading_mode = (
|
||||
(
|
||||
[
|
||||
(
|
||||
"Trading Mode",
|
||||
(
|
||||
""
|
||||
if not strat_results.get("margin_mode")
|
||||
or strat_results.get("trading_mode", "spot") == "spot"
|
||||
else f"{strat_results['margin_mode'].capitalize()} "
|
||||
)
|
||||
+ f"{strat_results['trading_mode'].capitalize()}",
|
||||
)
|
||||
]
|
||||
)
|
||||
if "trading_mode" in strat_results
|
||||
else []
|
||||
)
|
||||
|
||||
# Newly added fields should be ignored if they are missing in strat_results. hyperopt-show
|
||||
# command stores these results and newer version of freqtrade must be able to handle old
|
||||
# results with missing new fields.
|
||||
metrics = [
|
||||
("Backtesting from", strat_results["backtest_start"]),
|
||||
("Backtesting to", strat_results["backtest_end"]),
|
||||
*trading_mode,
|
||||
("Max open trades", strat_results["max_open_trades"]),
|
||||
("", ""), # Empty line to improve readability
|
||||
(
|
||||
|
|
|
@ -504,6 +504,8 @@ def generate_strategy_stats(
|
|||
"exit_profit_only": config["exit_profit_only"],
|
||||
"exit_profit_offset": config["exit_profit_offset"],
|
||||
"ignore_roi_if_entry_signal": config["ignore_roi_if_entry_signal"],
|
||||
"trading_mode": config["trading_mode"],
|
||||
"margin_mode": config["margin_mode"],
|
||||
**periodic_breakdown,
|
||||
**daily_stats,
|
||||
**trade_stats,
|
||||
|
|
Loading…
Reference in New Issue
Block a user