SearchFunction#

API documentation for tradeexecutor.backtest.optimiser.SearchFunction Python class in Trading Strategy framework.

class SearchFunction[source]#

Bases: Protocol

The function definition for the optimiser search function.

  • The search function extracts the result variable we want to optimise for from the GridSearchResult

__init__(*args, **kwargs)#

Methods

__init__(*args, **kwargs)

__call__(result)[source]#

The search function extracts the parm

Parameters:

result (GridSearchResult) – The latest backtest result as grid search result object.

Returns:

Value of the function to optimise.

Smaller is better. E.g. if you want to optimise profit, return negative profit.

Return type:

SearchResult

__init__(*args, **kwargs)#