GridCombination#

API documentation for tradeexecutor.backtest.grid_search.GridCombination Python class in Trading Strategy framework.

class GridCombination[source]#

Bases: object

One combination line in grid search.

__init__(index, result_path, parameters)#
Parameters:
Return type:

None

Methods

__init__(index, result_path, parameters)

as_dict()

Get as kwargs mapping.

destructure()

Open parameters dict.

get_full_result_path()

Get the path where the resulting state file is stored.

get_label()

Human readable label for this combination

get_relative_result_path()

Get the path where the resulting state file is stored.

to_strategy_parameters()

validate()

Check arguments can be serialised as fs path.

Attributes

searchable_parameters

Get all parameters that are searchable.

index

How many of nth grid combinations this is

result_path

In which folder we store the result files of all grid search runs

parameters

Alphabetically sorted list of parameters

index: int#

How many of nth grid combinations this is

result_path: Path#

In which folder we store the result files of all grid search runs

Each individual combination will have its subfolder based on its parameter.

parameters: Tuple[GridParameter]#

Alphabetically sorted list of parameters

Each parameter can have 0…n values.] If parameter is not “single”, i.e. single value, then it is searchable.

property searchable_parameters: List[GridParameter]#

Get all parameters that are searchable.

Searchable parameters have two or more values.

get_relative_result_path()[source]#

Get the path where the resulting state file is stored.

Try to avoid messing with 256 character limit on filenames, thus break down as folders.

Return type:

Path

get_full_result_path()[source]#

Get the path where the resulting state file is stored.

Return type:

Path

validate()[source]#

Check arguments can be serialised as fs path.

as_dict()[source]#

Get as kwargs mapping.

Return type:

dict

get_label()[source]#

Human readable label for this combination

Return type:

str

destructure()[source]#

Open parameters dict.

This will return the arguments in the same order you pass them to prepare_grid_combinations().

Return type:

List[Any]

__init__(index, result_path, parameters)#
Parameters:
Return type:

None