Skip to content

FuncBenchmark

QuantConnect.Benchmarks.FuncBenchmark

FuncBenchmark(py_func: Any)
FuncBenchmark(benchmark: Callable[[datetime], float])

Bases: Object, IBenchmark

Creates a benchmark defined by a function

Signature descriptions:

  • Create a function benchmark from a Python function

  • Initializes a new instance of the FuncBenchmark class

Parameters:

Name Type Description Default
py_func Optional[Any]
None
benchmark Optional[Callable[[datetime], float]]

The functional benchmark implementation

None

evaluate

evaluate(time: Union[datetime, date]) -> float

Evaluates this benchmark at the specified time

Parameters:

Name Type Description Default
time Union[datetime, date]

The time to evaluate the benchmark at

required

Returns:

Type Description
float

The value of the benchmark at the specified time.