prepare_grid_combinations#

API documentation for tradeexecutor.backtest.grid_search.prepare_grid_combinations Python function.

prepare_grid_combinations(parameters, result_path, clear_cached_results=False, marker_file='README-GRID-SEARCH.md')[source]#

Get iterable search matrix of all parameter combinations.

  • Make sure we preverse the original order of the grid search parameters.

  • Set up the folder to store the results

Parameters:
  • parameters (Union[Dict[str, List[Any]], type]) –

    A grid of parameters we will search.

    Can be a dict or a class of which all members will be enumerated.

  • result_path (Path) – A folder where resulting state files will be stored.

  • clear_cached_results

    Clear any existing result files from the saved result cache.

    You need to do this if you change the strategy logic outside the given combination parameters, as the framework will otherwise serve you the old cached results.

  • marker_file – Safety to prevent novice users to nuke their hard disk with this command.

Returns:

List of all combinations we need to search through

Return type:

List[GridCombination]