backtrader.mathsupport module¶
Math Support Module - Mathematical functions for indicator calculations.
This module provides mathematical utility functions for calculating statistics used in technical indicators, such as average, variance, and standard deviation.
- Functions:
average: Calculate arithmetic mean with optional Bessel’s correction. variance: Calculate variance from a sequence. standarddev: Calculate standard deviation with Bessel’s correction option.
Note
These functions are primarily used for indicator calculations. For large datasets, numpy-based implementations would provide better performance.
- backtrader.mathsupport.average(x, bessel=False)[source]¶
:param : param x: iterable with len :param : param bessel: default False, reduces the length of the array for the
division.
- Returns:
A float with the average of the elements of x