mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 18:23:55 +00:00
Rename strategy_comparison method
This commit is contained in:
parent
c45204a2c4
commit
b125c975c7
|
@ -153,7 +153,7 @@ def generate_sell_reason_stats(max_open_trades: int, results: DataFrame) -> List
|
||||||
return tabular_data
|
return tabular_data
|
||||||
|
|
||||||
|
|
||||||
def generate_strategy_metrics(all_results: Dict) -> List[Dict]:
|
def generate_strategy_comparison(all_results: Dict) -> List[Dict]:
|
||||||
"""
|
"""
|
||||||
Generate summary per strategy
|
Generate summary per strategy
|
||||||
:param all_results: Dict of <Strategyname: DataFrame> containing results for all strategies
|
:param all_results: Dict of <Strategyname: DataFrame> containing results for all strategies
|
||||||
|
@ -370,7 +370,7 @@ def generate_backtest_stats(btdata: Dict[str, DataFrame],
|
||||||
'csum_max': 0
|
'csum_max': 0
|
||||||
})
|
})
|
||||||
|
|
||||||
strategy_results = generate_strategy_metrics(all_results=all_results)
|
strategy_results = generate_strategy_comparison(all_results=all_results)
|
||||||
|
|
||||||
result['strategy_comparison'] = strategy_results
|
result['strategy_comparison'] = strategy_results
|
||||||
|
|
||||||
|
|
|
@ -817,7 +817,7 @@ def test_backtest_start_multi_strat(default_conf, mocker, caplog, testdatadir):
|
||||||
text_table_strategy=strattable_mock,
|
text_table_strategy=strattable_mock,
|
||||||
generate_pair_metrics=MagicMock(),
|
generate_pair_metrics=MagicMock(),
|
||||||
generate_sell_reason_stats=sell_reason_mock,
|
generate_sell_reason_stats=sell_reason_mock,
|
||||||
generate_strategy_metrics=strat_summary,
|
generate_strategy_comparison=strat_summary,
|
||||||
generate_daily_stats=MagicMock(),
|
generate_daily_stats=MagicMock(),
|
||||||
)
|
)
|
||||||
patched_configuration_load_config_file(mocker, default_conf)
|
patched_configuration_load_config_file(mocker, default_conf)
|
||||||
|
|
|
@ -14,7 +14,7 @@ from freqtrade.edge import PairInfo
|
||||||
from freqtrade.optimize.optimize_reports import (generate_backtest_stats, generate_daily_stats,
|
from freqtrade.optimize.optimize_reports import (generate_backtest_stats, generate_daily_stats,
|
||||||
generate_edge_table, generate_pair_metrics,
|
generate_edge_table, generate_pair_metrics,
|
||||||
generate_sell_reason_stats,
|
generate_sell_reason_stats,
|
||||||
generate_strategy_metrics, store_backtest_stats,
|
generate_strategy_comparison, store_backtest_stats,
|
||||||
text_table_bt_results, text_table_sell_reason,
|
text_table_bt_results, text_table_sell_reason,
|
||||||
text_table_strategy)
|
text_table_strategy)
|
||||||
from freqtrade.resolvers.strategy_resolver import StrategyResolver
|
from freqtrade.resolvers.strategy_resolver import StrategyResolver
|
||||||
|
@ -345,7 +345,7 @@ def test_text_table_strategy(default_conf):
|
||||||
' 43.33 | 0:20:00 | 3 | 0 | 0 |'
|
' 43.33 | 0:20:00 | 3 | 0 | 0 |'
|
||||||
)
|
)
|
||||||
|
|
||||||
strategy_results = generate_strategy_metrics(all_results=results)
|
strategy_results = generate_strategy_comparison(all_results=results)
|
||||||
|
|
||||||
assert text_table_strategy(strategy_results, 'BTC') == result_str
|
assert text_table_strategy(strategy_results, 'BTC') == result_str
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user